From 7b48a991f950e5706e07c224270ae6893a1a12ca Mon Sep 17 00:00:00 2001 From: Kui LIU Date: Fri, 4 Aug 2017 14:41:17 +0200 Subject: [PATCH] Fix the bug of identifying UpperCase of the first char of variable names. --- .../edu/lu/uni/serval/gumtree/regroup/SimplifyTree.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; }