mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
don't multiply dfa states up to infinity when comparing ints (NameUtil.MinusculeMatcher.matchAfterFragment too complex to analyze)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import java.util.List;
|
||||
|
||||
public class Foo {
|
||||
public void matchAfterFragment(int patternIndex, int matchLen) {
|
||||
int star = patternIndex < matchLen ? matchLen : -1;
|
||||
while (matchLen > 0) {
|
||||
int i = matchLen == star ? matchLen : star;
|
||||
}
|
||||
}
|
||||
|
||||
public void matchAfterFragmentBoxed(Integer patternIndex, Integer matchLen) {
|
||||
Integer star = patternIndex < matchLen ? matchLen : -1;
|
||||
while (matchLen > 0) {
|
||||
Integer i = matchLen == star ? matchLen : star;
|
||||
}
|
||||
}
|
||||
|
||||
public void matchAfterFragmentSemiBoxed(Integer patternIndex, Integer matchLen) {
|
||||
int star = patternIndex < matchLen ? matchLen : -1;
|
||||
while (matchLen > 0) {
|
||||
Integer i = matchLen == star ? matchLen : star;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,4 +53,5 @@ public class DataFlowInspectionFixtureTest extends JavaCodeInsightFixtureTestCas
|
||||
/*public void testAnnReport() throws Throwable { doTest(); }*/
|
||||
|
||||
public void testBigMethodNotComplex() throws Throwable { doTest(); }
|
||||
public void testTernaryInWhileNotComplex() throws Throwable { doTest(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user