if (reportIssue.getSeverity() != Severity.UNSET_SEVERITY) {
issue.setSeverity(reportIssue.getSeverity().name());
}
- if (reportIssue.getGap() != 0) {
+ if (Double.compare(reportIssue.getGap(), 0D) != 0) {
issue.setGap(reportIssue.getGap());
}
DbIssues.Locations.Builder dbLocationsBuilder = DbIssues.Locations.newBuilder();
if (value == null) {
return toNoValueMeasure(measureDto);
}
- return of(setCommonProperties(Measure.newMeasureBuilder(), measureDto).create(value == 1.0d, data));
+ return of(setCommonProperties(Measure.newMeasureBuilder(), measureDto).create(Double.compare(value, 1.0D) == 0, data));
}
private static Optional<Measure> toStringMeasure(LiveMeasureDto measureDto, @Nullable String data) {
private Bounds(double lowerBound, double higherBound) {
this.lowerBound = lowerBound;
this.higherBound = higherBound;
- this.isLowerBoundInclusive = lowerBound == 0;
+ this.isLowerBoundInclusive = Double.compare(lowerBound, 0D) == 0;
}
boolean match(double value) {
switch (metricType) {
case BOOL:
- return doubleValue == 1.0d ? "true" : "false";
+ return Double.compare(doubleValue, 1.0D) == 0 ? "true" : "false";
case INT:
case MILLISEC:
return String.valueOf((int) doubleValue);
@Override
public Double gap() {
- return rawIssue.getGap() != 0 ? rawIssue.getGap() : null;
+ return Double.compare(rawIssue.getGap(), 0D) != 0 ? rawIssue.getGap() : null;
}
@Override