Remove Java 7 only API

We still run on Java 6 as minimum requirement. Integer.compare(int,int)
was added in Java 7. This caused compile errors on CI.
This commit is contained in:
Simon Willnauer 2013-05-07 18:40:56 +02:00
parent 74317fec8b
commit 130f0f6afd
1 changed files with 5 additions and 1 deletions

View File

@ -69,7 +69,7 @@ public final class FragmentBuilderHelper {
public int compare(SubInfo o1, SubInfo o2) {
int startOffset = o1.getTermsOffsets().get(0).getStartOffset();
int startOffset2 = o2.getTermsOffsets().get(0).getStartOffset();
return Integer.compare(startOffset, startOffset2);
return FragmentBuilderHelper.compare(startOffset, startOffset2);
}
});
return new WeightedFragInfo(Math.min(fragInfo.getSubInfos().get(0).getTermsOffsets().get(0).getStartOffset(),
@ -78,6 +78,10 @@ public final class FragmentBuilderHelper {
return fragInfo;
}
}
private static int compare(int x, int y) {
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
private static boolean containsBrokenAnalysis(Analyzer analyzer) {
// TODO maybe we need a getter on Namedanalyzer that tells if this uses broken Analysis