File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
core/src/main/java/org/everit/json/schema Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,10 @@ void visitMinimum(Number minimum) {
42
42
if (minimum == null ) {
43
43
return ;
44
44
}
45
- if (exclusiveMinimum && compare (numberSubject , minimum ) <= 0 ) {
45
+ int comparison = compare (numberSubject , minimum );
46
+ if (exclusiveMinimum && comparison <= 0 ) {
46
47
owner .failure (subject + " is not greater than " + minimum , "exclusiveMinimum" );
47
- } else if (compare ( numberSubject , minimum ) < 0 ) {
48
+ } else if (comparison < 0 ) {
48
49
owner .failure (subject + " is not greater or equal to " + minimum , "minimum" );
49
50
}
50
51
}
@@ -63,9 +64,10 @@ void visitMaximum(Number maximum) {
63
64
if (maximum == null ) {
64
65
return ;
65
66
}
66
- if (exclusiveMaximum && compare (maximum , numberSubject ) <= 0 ) {
67
+ int comparison = compare (maximum , numberSubject );
68
+ if (exclusiveMaximum && comparison <= 0 ) {
67
69
owner .failure (subject + " is not less than " + maximum , "exclusiveMaximum" );
68
- } else if (compare ( maximum , numberSubject ) < 0 ) {
70
+ } else if (comparison < 0 ) {
69
71
owner .failure (subject + " is not less or equal to " + maximum , "maximum" );
70
72
}
71
73
}
You can’t perform that action at this time.
0 commit comments