Skip to content

Commit 49eaec9

Browse files
authored
Merge pull request #735 from OpenAPITools/fix-sonar-issues
Fix sonar issues to pass quality gate
2 parents ebab734 + d2e50d6 commit 49eaec9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

core/src/main/java/org/openapitools/openapidiff/core/compare/ParametersDiff.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ public boolean pathUnchangedParametersChanged(
114114
boolean samePathDifferentParameter = !newParameterRealized.equals(parameter);
115115
newParameterRealized.setName(
116116
newParameterName); // Important:: MUST Reset the name as this is not a copy
117-
return samePathDifferentParameter;
117+
if (samePathDifferentParameter) {
118+
return true;
119+
}
118120
}
119121
return false;
120122
}

core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedNumericRange.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.openapitools.openapidiff.core.model.schema;
22

3+
import static org.apache.commons.lang3.BooleanUtils.isTrue;
34
import static org.openapitools.openapidiff.core.model.BackwardIncompatibleProp.REQUEST_NUMERIC_RANGE_DECREASED;
45
import static org.openapitools.openapidiff.core.model.BackwardIncompatibleProp.RESPONSE_NUMERIC_RANGE_INCREASED;
56

@@ -34,10 +35,10 @@ public DiffResult isChanged() {
3435
return DiffResult.COMPATIBLE;
3536
}
3637

37-
boolean exclusiveMaxOld = oldMaximumExclusiveValue != null && oldMaximumExclusiveValue;
38-
boolean exclusiveMinOld = oldMinimumExclusiveValue != null && oldMinimumExclusiveValue;
39-
boolean exclusiveMaxNew = newMaximumExclusiveValue != null && newMaximumExclusiveValue;
40-
boolean exclusiveMinNew = newMinimumExclusiveValue != null && newMinimumExclusiveValue;
38+
boolean exclusiveMaxOld = isTrue(oldMaximumExclusiveValue);
39+
boolean exclusiveMinOld = isTrue(oldMinimumExclusiveValue);
40+
boolean exclusiveMaxNew = isTrue(newMaximumExclusiveValue);
41+
boolean exclusiveMinNew = isTrue(newMinimumExclusiveValue);
4142
int diffMax = compare(oldMaximumValue, newMaximumValue, false);
4243
int diffMin = compare(oldMinimumValue, newMinimumValue, true);
4344

0 commit comments

Comments
 (0)