| Chunk |
|---|
| Conflicting content |
|---|
final double firstNumber = ((NumberValue) childValues[0]).doubleValue();
final double secondNumber = ((NumberValue) childValues[1]).doubleValue();
<<<<<<< HEAD
final Value computedFigures = getFigures().evaluate(this, context);
if (computedFigures.isNull()) {
context.fireRuntimeWarning(this, "Computed value of figures was NULL. Returning NULL");
return NullValue.INSTANCE;
}
final RoundingMode roundingMode = getRoundingMode();
final int figures = ((IntegerValue) computedFigures).intValue();
if (!roundingMode.isFiguresValid(figures)) {
context.fireRuntimeWarning(this, "The computed value of figures (" + figures + ") was not compatible with the constraints of the rounding mode. Returning NULL");
return NullValue.INSTANCE;
}
return BooleanValue.valueOf(roundingMode.isEqual(firstNumber, secondNumber, figures));
=======
/* Handle NaN or infinite cases by just doing normal double comparison */
if (RoundingMode.isNaNOrInfinite(firstNumber) || RoundingMode.isNaNOrInfinite(secondNumber)) {
return BooleanValue.valueOf(firstNumber==secondNumber);
}
final int computedFigures = getFigures().evaluate(context);
if (computedFigures<1) {
return NullValue.INSTANCE;
}
return BooleanValue.valueOf(getRoundingMode().isEqual(firstNumber, secondNumber, computedFigures));
>>>>>>> 949ef828d6ae4fdb4829ef567479c98ab1e1c55b
}
} |
| Solution content |
|---|
final double firstNumber = ((NumberValue) childValues[0]).doubleValue();
final double secondNumber = ((NumberValue) childValues[1]).doubleValue();
/* Handle NaN or infinite cases by just doing normal double comparison */
if (RoundingMode.isNaNOrInfinite(firstNumber) || RoundingMode.isNaNOrInfinite(secondNumber)) {
return BooleanValue.valueOf(firstNumber==secondNumber);
}
final Value computedFigures = getFigures().evaluate(this, context);
if (computedFigures.isNull()) {
context.fireRuntimeWarning(this, "Computed value of figures was NULL. Returning NULL");
return NullValue.INSTANCE;
}
final RoundingMode roundingMode = getRoundingMode();
final int figures = ((IntegerValue) computedFigures).intValue();
if (!roundingMode.isFiguresValid(figures)) {
context.fireRuntimeWarning(this, "The computed value of figures (" + figures + ") was not compatible with the constraints of the rounding mode. Returning NULL");
return NullValue.INSTANCE;
}
return BooleanValue.valueOf(roundingMode.isEqual(firstNumber, secondNumber, figures));
}
} |
| File |
|---|
| EqualRounded.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method invocation |
| Return statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
}
return NullValue.INSTANCE;
final double childNumber = ((NumberValue) childValue).doubleValue();
<<<<<<< HEAD
final Value computedFigures = getFigures().evaluate(this, context);
if (computedFigures.isNull()) {
context.fireRuntimeWarning(this, "Computed value of figures is NULL. Returning NULL");
return NullValue.INSTANCE;
}
final RoundingMode roundingMode = getRoundingMode();
final int figures = ((IntegerValue) computedFigures).intValue();
if (!roundingMode.isFiguresValid(figures)) {
context.fireRuntimeWarning(this, "The computed value of figures (" + figures + ") was not compatible with the constraints of the rounding mode. Returning NULL");
return NullValue.INSTANCE;
}
final BigDecimal rounded = getRoundingMode().round(childNumber, figures);
=======
if (Double.isInfinite(childNumber) || Double.isNaN(childNumber)) {
return childValue;
}
final int computedFigures = getFigures().evaluate(context);
if (computedFigures < 1) {
return NullValue.INSTANCE;
}
final BigDecimal rounded = getRoundingMode().round(childNumber, computedFigures);
>>>>>>> 949ef828d6ae4fdb4829ef567479c98ab1e1c55b
return new FloatValue(rounded.doubleValue());
}
} |
| Solution content |
|---|
return NullValue.INSTANCE;
}
final double childNumber = ((NumberValue) childValue).doubleValue();
if (Double.isInfinite(childNumber) || Double.isNaN(childNumber)) {
return childValue;
}
final Value computedFigures = getFigures().evaluate(this, context);
if (computedFigures.isNull()) {
context.fireRuntimeWarning(this, "Computed value of figures is NULL. Returning NULL");
return NullValue.INSTANCE;
}
final RoundingMode roundingMode = getRoundingMode();
final int figures = ((IntegerValue) computedFigures).intValue();
if (!roundingMode.isFiguresValid(figures)) {
context.fireRuntimeWarning(this, "The computed value of figures (" + figures + ") was not compatible with the constraints of the rounding mode. Returning NULL");
return NullValue.INSTANCE;
}
final BigDecimal rounded = getRoundingMode().round(childNumber, figures);
return new FloatValue(rounded.doubleValue());
}
} |
| File |
|---|
| RoundTo.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| If statement |
| Method invocation |
| Variable |