fix formatting

This commit is contained in:
Xavier Léauté 2014-04-25 15:09:47 -07:00
parent 52f575025b
commit 5ae848ab14
1 changed files with 25 additions and 17 deletions

View File

@ -281,7 +281,6 @@ public class IncrementalIndex implements Iterable<Row>
); );
} }
} }
); );
} }
@ -562,10 +561,15 @@ public class IncrementalIndex implements Iterable<Row>
while (retVal == 0 && valsIndex < lhsVals.length) { while (retVal == 0 && valsIndex < lhsVals.length) {
final String lhsVal = lhsVals[valsIndex]; final String lhsVal = lhsVals[valsIndex];
final String rhsVal = rhsVals[valsIndex]; final String rhsVal = rhsVals[valsIndex];
if(lhsVal == null && rhsVal == null) return 0; if (lhsVal == null && rhsVal == null) {
else if(lhsVal == null) return -1; return 0;
else if(rhsVal == null) return 1; } else if (lhsVal == null) {
else retVal = lhsVal.compareTo(rhsVal); return -1;
} else if (rhsVal == null) {
return 1;
} else {
retVal = lhsVal.compareTo(rhsVal);
}
++valsIndex; ++valsIndex;
} }
++index; ++index;
@ -581,16 +585,16 @@ public class IncrementalIndex implements Iterable<Row>
"timestamp=" + new DateTime(timestamp) + "timestamp=" + new DateTime(timestamp) +
", dims=" + Lists.transform( ", dims=" + Lists.transform(
Arrays.asList(dims), new Function<String[], Object>() Arrays.asList(dims), new Function<String[], Object>()
{ {
@Override @Override
public Object apply(@Nullable String[] input) public Object apply(@Nullable String[] input)
{ {
if (input == null || input.length == 0) { if (input == null || input.length == 0) {
return Arrays.asList("null"); return Arrays.asList("null");
}
return Arrays.asList(input);
}
} }
return Arrays.asList(input);
}
}
) + ) +
'}'; '}';
} }
@ -619,7 +623,7 @@ public class IncrementalIndex implements Iterable<Row>
public String get(@Nullable String value) public String get(@Nullable String value)
{ {
final String retVal; final String retVal;
if(value == null) { if (value == null) {
retVal = poorMansInterning.get(NULL_STRING); retVal = poorMansInterning.get(NULL_STRING);
} else { } else {
retVal = poorMansInterning.get(value); retVal = poorMansInterning.get(value);
@ -646,7 +650,9 @@ public class IncrementalIndex implements Iterable<Row>
public synchronized void add(@Nullable String value) public synchronized void add(@Nullable String value)
{ {
if(value == null) value = NULL_STRING; if (value == null) {
value = NULL_STRING;
}
poorMansInterning.put(value, value); poorMansInterning.put(value, value);
falseIds.put(value, falseIds.size()); falseIds.put(value, falseIds.size());
} }
@ -654,7 +660,9 @@ public class IncrementalIndex implements Iterable<Row>
public int getSortedId(@Nullable String value) public int getSortedId(@Nullable String value)
{ {
assertSorted(); assertSorted();
if(value == null) value = NULL_STRING; if (value == null) {
value = NULL_STRING;
}
return Arrays.binarySearch(sortedVals, value); return Arrays.binarySearch(sortedVals, value);
} }