WW-5579 Add missing DoubleRangeFieldValidator and ShortRangeFieldValidator to @Validations container#1390
Merged
lukaszlenart merged 1 commit intoOct 19, 2025
Conversation
…dator to @validations container This commit addresses a long-standing gap in the Struts validation framework where @DoubleRangeFieldValidator and @ShortRangeFieldValidator annotations could not be used within the @validations container annotation, despite being fully functional as standalone annotations. Changes made: - Added doubleRangeFields() and shortRangeFields() methods to @validations annotation interface - Updated JavaDoc to document the new fields and corrected the parameters table - Added processing loops for both validators in AnnotationValidationConfigurationBuilder - Created comprehensive test coverage in AnnotationValidationConfigurationBuilderTest - Added AnnotationValidationsContainerAction test class demonstrating proper usage The implementation follows the exact same pattern used by IntRangeFieldValidator and LongRangeFieldValidator, ensuring consistency across all range validators in the framework. All existing tests continue to pass, and new tests verify that multiple validators of each type can be properly configured within the @validations container. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
kusalk
approved these changes
Oct 19, 2025
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
This PR fixes WW-5579 by adding support for
@DoubleRangeFieldValidatorand@ShortRangeFieldValidatorannotations within the@Validationscontainer annotation.Problem
Both
@DoubleRangeFieldValidatorand@ShortRangeFieldValidatorannotations exist and work as standalone annotations, but they were completely missing from the@Validationscontainer annotation interface definition. This forced developers to either:The infrastructure to support these validators already existed - the processing methods were implemented, the validators worked standalone - only the container fields and processing loops were missing.
Changes Made
1. Updated
Validations.javaDoubleRangeFieldValidator[] doubleRangeFields() default {};methodShortRangeFieldValidator[] shortRangeFields() default {};methodlongRangeFields,doubleRangeFields, andshortRangeFieldsdoubleRangeFieldsin the JavaDoc code example2. Updated
AnnotationValidationConfigurationBuilder.javadoubleRangeFieldsinprocessValidationAnnotation()methodshortRangeFieldsinprocessValidationAnnotation()methodintRangeFieldsandlongRangeFieldsloops3. Added Test Coverage
AnnotationValidationsContainerAction.javatest class demonstrating proper usagetestValidationsContainerWithRangeValidators()test method to verify the implementationExample Usage (After Fix)
Test Results
✅ All tests pass successfully:
testValidationAnnotation()- Standalone validator annotationstestValidationAnnotationExpParams()- Validators with expression parameterstestValidationsContainerWithRangeValidators()- NEW Container annotation with doubleRangeFields and shortRangeFieldsImpact
Related Issues
🤖 Generated with Claude Code