don't multiply dfa states up to infinity when comparing ints (NameUtil.MinusculeMatcher.matchAfterFragment too complex to analyze)

This commit is contained in:
peter
2012-04-18 12:07:41 +02:00
parent 44fbfceeff
commit 304d46bb96
3 changed files with 62 additions and 24 deletions
@@ -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;
}
}
}