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:
parent
74317fec8b
commit
130f0f6afd
|
@ -69,7 +69,7 @@ public final class FragmentBuilderHelper {
|
||||||
public int compare(SubInfo o1, SubInfo o2) {
|
public int compare(SubInfo o1, SubInfo o2) {
|
||||||
int startOffset = o1.getTermsOffsets().get(0).getStartOffset();
|
int startOffset = o1.getTermsOffsets().get(0).getStartOffset();
|
||||||
int startOffset2 = o2.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(),
|
return new WeightedFragInfo(Math.min(fragInfo.getSubInfos().get(0).getTermsOffsets().get(0).getStartOffset(),
|
||||||
|
@ -78,6 +78,10 @@ public final class FragmentBuilderHelper {
|
||||||
return fragInfo;
|
return fragInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int compare(int x, int y) {
|
||||||
|
return (x < y) ? -1 : ((x == y) ? 0 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
private static boolean containsBrokenAnalysis(Analyzer analyzer) {
|
private static boolean containsBrokenAnalysis(Analyzer analyzer) {
|
||||||
// TODO maybe we need a getter on Namedanalyzer that tells if this uses broken Analysis
|
// TODO maybe we need a getter on Namedanalyzer that tells if this uses broken Analysis
|
||||||
|
|
Loading…
Reference in New Issue