mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CustomMethodHandlers: skip() fixed
This commit is contained in:
+1
-1
@@ -245,7 +245,7 @@ class CustomMethodHandlers {
|
||||
if (arguments.length != 1) return null;
|
||||
LongRangeSet range = state.getValueFact(arguments[0], DfaFactType.RANGE);
|
||||
if (range == null || range.isEmpty()) return null;
|
||||
return factory.getFactValue(DfaFactType.RANGE, LongRangeSet.range(0, range.max()));
|
||||
return factory.getFactValue(DfaFactType.RANGE, LongRangeSet.range(0, Math.max(0, range.max())));
|
||||
}
|
||||
|
||||
private static Object getConstantValue(DfaMemoryState memoryState, DfaValue value) {
|
||||
|
||||
@@ -319,5 +319,6 @@ public class LongRangeKnownMethods {
|
||||
long skipped = is.skip(amount);
|
||||
if (<warning descr="Condition 'skipped > Integer.MAX_VALUE' is always 'false'">skipped > Integer.MAX_VALUE</warning>) {}
|
||||
if (<warning descr="Condition 'skipped < 0' is always 'false'">skipped < 0</warning>) {}
|
||||
if (<warning descr="Condition 'is.skip(-1) == 0' is always 'true'">is.skip(-1) == 0</warning>) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user