class NoValueVariationMeasureImpl implements Measure {
@Nullable
private Double variation;
- private ValueType valueType = ValueType.NO_VALUE;
private NoValueVariationMeasureImpl(@Nullable Double variation) {
this.variation = variation;
@Override
public String toString() {
return com.google.common.base.MoreObjects.toStringHelper(this)
- .add("valueType", valueType)
+ .add("valueType", ValueType.NO_VALUE)
.add("variations", variation)
.toString();
}
@Override
public Changeset getChangesetForLine(int lineNumber) {
- if (lineNumber < 1 || lineNumber > lineChangesets.length) {
+ if (!hasChangesetForLine(lineNumber)) {
throw new IllegalArgumentException("There's no changeset on line " + lineNumber);
-
- }
- Changeset changeset = lineChangesets[lineNumber - 1];
- if (changeset != null) {
- return changeset;
}
- throw new IllegalArgumentException("There's no changeset on line " + lineNumber);
+ return lineChangesets[lineNumber - 1];
}
@Override
*/
package org.sonar.ce.task.projectanalysis.util.cache;
+import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
public class DoubleCache {
// static only
}
+ @CheckForNull
public static Double intern(@Nullable Double num) {
if (ZERO.equals(num)) {
return ZERO;