mirror of
https://github.com/apache/struts.git
synced 2026-08-05 14:47:09 +00:00
57c33654cd
This commit addresses recommendation #4 from the visitor pattern research: "Test repopulation behavior specifically with indexed properties to confirm it works as expected." Two new test methods have been added to VisitorFieldValidatorTest: 1. testArrayConversionErrorRepopulation() - Tests conversion errors in indexed array properties (testBeanArray[0].count, etc.) - Verifies that conversion errors are properly detected with correct indexed notation - Confirms repopulateField parameter preserves invalid values 2. testListConversionErrorRepopulation() - Tests conversion errors in indexed list properties (testBeanList[1].count, etc.) - Verifies proper field error key generation for list elements - Validates that elements without conversion errors don't generate false positives Supporting validation configuration files: - TestBean-validateArrayWithConversion-validation.xml - TestBean-validateListWithConversion-validation.xml - VisitorValidatorTestAction-validateArrayWithConversion-validation.xml - VisitorValidatorTestAction-validateListWithConversion-validation.xml These tests verify the VisitorFieldValidator correctly handles: - Conversion error detection for indexed properties - Field name construction with proper index notation - Error message generation for specific indexed elements - Selective validation (only elements with conversion errors fail) Research notes documenting the visitor pattern investigation are included in thoughts/lukaszlenart/notes/2025-10-17-struts2-iterator-validation-visitor-pattern.md Also updated .claude/settings.json to refine permissions: - More specific WebFetch domain (struts.apache.org vs apache.org) - Added git checkout and git log permissions for better workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>