Even thought it is the expected behaviour Coverity/Sonar flags the two
"if"s as a potential code duplication and infers an error.
Let's comply to Coverity/Sonar.
Note: Patrick Tassé did mention to merge the two "if"s during initial
review [1] and it was simply forgotten.
Coverity ID: 115874
[1] https://git.eclipse.org/r/#/c/73239/7/analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/format/LamiTimeStampFormat.java
Change-Id: I22cf9499eb53fd547ae3ebfc73161f21db5cac47
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Reviewed-on: https://git.eclipse.org/r/74314
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Hudson CI
return checkNotNull(toAppendTo.append(fFormat.format(time)));
}
- if (internalRange.getDelta().compareTo(BigDecimal.ZERO) == 0) {
- return checkNotNull(toAppendTo.append(fFormat.format(externalRange.getMinimum().doubleValue())));
- }
-
- if (externalRange.getDelta().compareTo(BigDecimal.ZERO) == 0) {
+ if (internalRange.getDelta().compareTo(BigDecimal.ZERO) == 0 ||
+ externalRange.getDelta().compareTo(BigDecimal.ZERO) == 0) {
return checkNotNull(toAppendTo.append(fFormat.format(externalRange.getMinimum().doubleValue())));
}