Fix the bug of identifying UpperCase of the first char of variable names.

This commit is contained in:
Kui LIU
2017-08-04 14:41:17 +02:00
parent 4cdedcc718
commit 7b48a991f9
@@ -137,8 +137,8 @@ public class SimplifyTree {
simpleTree.setLabel(label); simpleTree.setLabel(label);
} else if (label.startsWith("Name:")) { } else if (label.startsWith("Name:")) {
label = label.substring(5); label = label.substring(5);
String firstChar = label.substring(0, 1); char firstChar = label.charAt(0);
if (firstChar.equals(firstChar.toUpperCase())) { if (Character.isUpperCase(firstChar)) {
simpleTree.setNodeType("Name"); simpleTree.setNodeType("Name");
simpleTree.setLabel(label); simpleTree.setLabel(label);
} else {// variableName: <VariableName, canonicalName> } else {// variableName: <VariableName, canonicalName>
@@ -191,8 +191,6 @@ public class SimplifyTree {
matchStr = matchVariableDeclarationExpression(child, label); matchStr = matchVariableDeclarationExpression(child, label);
} else if (childType == 44) { // SingleVariableDeclaration } else if (childType == 44) { // SingleVariableDeclaration
matchStr = matchSingleVariableDeclaration(child, label); matchStr = matchSingleVariableDeclaration(child, label);
} else if (childType ==70 || childType == 24 ||childType == 12 || childType == 54) {
matchStr = matchStatements(childType, child, label);
} }
if (matchStr != null) break; if (matchStr != null) break;
} }