first letter shouldn't oblige to use humps everywhere

This commit is contained in:
peter
2012-07-31 14:44:56 +02:00
parent ce4ba7ecae
commit 871f5e4d9e
2 changed files with 6 additions and 3 deletions
@@ -228,7 +228,8 @@ public class NameUtilTest extends UsefulTestCase {
public void testFileStructure() {
assertDoesntMatch("hint", "height: int");
assertDoesntMatch("Hint", "Height:int");
assertMatches("Hint", "Height:int");
assertDoesntMatch("Hint", "Height: int");
assertMatches("getColor", "getBackground(): Color");
assertMatches("get color", "getBackground(): Color");
@@ -344,6 +345,8 @@ public class NameUtilTest extends UsefulTestCase {
assertMatches("WebLOgic", "WebLogic");
assertMatches("WEbLogic", "WebLogic");
assertDoesntMatch("WebLogic", "Webologic");
assertMatches("Wlo", "WebLogic");
}
public void testFinalSpace() {
@@ -38,9 +38,9 @@ public class MinusculeMatcher implements Matcher {
public MinusculeMatcher(String pattern, NameUtil.MatchingCaseSensitivity options) {
myOptions = options;
myPattern = StringUtil.trimEnd(pattern, "* ").toCharArray();
for (int i = 0; i < myPattern.length; i++) {
for (int i = 1; i < myPattern.length; i++) {
char c = myPattern[i];
if (Character.isUpperCase(c) && (i > 0 || myOptions != FIRST_LETTER)) {
if (Character.isUpperCase(c)) {
myHasHumps = true;
return;
}