fix python test: if a prefix starts with an underscore, don't allow variants to start with more underscores

This commit is contained in:
peter
2011-03-31 15:31:29 +02:00
parent 388fea264a
commit b5bd47c636
@@ -509,22 +509,26 @@ public class NameUtil {
return handleAsterisk(patternIndex, words, wordIndex);
}
if (patternIndex == 0 && myFirstLetterCaseMatters && word.charAt(0) != myPattern[0]) {
return false;
}
if (isWordSeparator(word.charAt(0))) {
assert word.length() == 1 : "'" + word + "'";
if (isWordSeparator(myPattern[patternIndex])) {
char p = myPattern[patternIndex];
if (isWordSeparator(p)) {
if (myFirstLetterCaseMatters &&
wordIndex == 0 && words.size() > 1 && patternIndex + 1 < myPattern.length &&
isWordSeparator(words.get(1).charAt(0)) && !isWordSeparator(myPattern[patternIndex + 1])) {
return false;
}
return matches(patternIndex + 1, words, wordIndex + 1);
}
if (patternIndex == 0 && myFirstLetterCaseMatters) {
return false;
}
return matches(patternIndex, words, wordIndex + 1);
}
if (patternIndex == 0 && myFirstLetterCaseMatters && word.charAt(0) != myPattern[0]) {
return false;
}
if (StringUtil.toLowerCase(word.charAt(0)) != StringUtil.toLowerCase(myPattern[patternIndex])) {
return false;
}