diff --git a/src/main/java/edu/lu/uni/serval/gumtree/regroup/SimplifyTree.java b/src/main/java/edu/lu/uni/serval/gumtree/regroup/SimplifyTree.java index d8047db..bb3ce6c 100644 --- a/src/main/java/edu/lu/uni/serval/gumtree/regroup/SimplifyTree.java +++ b/src/main/java/edu/lu/uni/serval/gumtree/regroup/SimplifyTree.java @@ -137,8 +137,8 @@ public class SimplifyTree { simpleTree.setLabel(label); } else if (label.startsWith("Name:")) { label = label.substring(5); - String firstChar = label.substring(0, 1); - if (firstChar.equals(firstChar.toUpperCase())) { + char firstChar = label.charAt(0); + if (Character.isUpperCase(firstChar)) { simpleTree.setNodeType("Name"); simpleTree.setLabel(label); } else {// variableName: @@ -191,8 +191,6 @@ public class SimplifyTree { matchStr = matchVariableDeclarationExpression(child, label); } else if (childType == 44) { // SingleVariableDeclaration matchStr = matchSingleVariableDeclaration(child, label); - } else if (childType ==70 || childType == 24 ||childType == 12 || childType == 54) { - matchStr = matchStatements(childType, child, label); } if (matchStr != null) break; }