xxxConfig should match config if first letter matching == true

This commit is contained in:
peter
2012-07-19 16:38:29 +02:00
parent 7f141e8781
commit cbd89e8f14
2 changed files with 3 additions and 1 deletions
@@ -256,6 +256,7 @@ public class NameUtilTest extends UsefulTestCase {
assertFalse(firstLetterMatcher(" a").matches("Aaa"));
assertFalse(firstLetterMatcher(" _bl").matches("_top"));
assertFalse(firstLetterMatcher("*Ch").matches("char"));
assertTrue(firstLetterMatcher("*codes").matches("CFLocaleCopyISOCountryCodes"));
}
private static Matcher firstLetterMatcher(String pattern) {
@@ -196,7 +196,8 @@ public class MinusculeMatcher implements Matcher {
break;
}
if (next == 0 && myOptions != NameUtil.MatchingCaseSensitivity.NONE && name.charAt(next) != nextChar) {
return null;
fromIndex = next + 1;
continue;
}
if (upper && next > 0 && !Character.isUpperCase(name.charAt(next))) {
fromIndex = next + 1;