Simplify JavaIntegerConstraint structure to align with decimal constraint improvements#1156
Conversation
There was a problem hiding this comment.
I think this part may be a bit ambiguous. Should we change the variable name?
There was a problem hiding this comment.
I think the fields in SimpleValueJqwikPlugin should be also simplified.
@Nullable
private Long positiveMinNumberValue = null;
@Nullable
private Long positiveMaxNumberValue = null;
@Nullable
private Long negativeMinNumberValue = null;
@Nullable
private Long negativeMaxNumberValue = null;There was a problem hiding this comment.
It is better not to use the abbreviation to avoid confusion.
digitsAnn -> digitsAnnotation
There was a problem hiding this comment.
It is better not to use the abbreviation to avoid confusion as well.
|
@seongahjo This appears to be an intermittent issue. To investigate further, I increased the test execution from the original 10 attempts to 100,000 attempts locally by modifying the annotation to |
👍 It's a known issue, don't worry about it. |
Summary
This PR simplifies the
JavaIntegerConstraintstructure by removing the separate positive and negative range handling, aligning with the recent decimal constraint implementation improvements in #1131. Additionally, it improves the handling of@Digitsannotation for integer types.Related issues:
Fixes #1153
Description
This PR implements a simplification of the integer constraint structure and improves digit validation:
1. Simplified
JavaIntegerConstraintStructurepositive/negativerange handlingmin/maxrange representation:2. Improved
@DigitsAnnotation Processing for Integers@Digitsvalidation behavior with Jakarta Validation's actual implementation@Digits(integer=3), correctly allows any number up to 999 (≤ 3 digits)3. Consolidated Constraint Processing
@Min,@Max,@Positive,@Negative, etc.)4. Reduced Code Complexity
How Has This Been Tested?
Updated
@Digitsannotation tests for integer types to verify correct validation behavior.Is the Document updated?
No documentation update is required as this is an internal implementation improvement that maintains the same behavior from the user's perspective.