Fixes JavacJ2ObjCIncompatibleStripper to visit the children of JCFieldAccess nodes.
Change on 2017/01/04 by kstanger
@@ -107,12 +107,6 @@ class JavacJ2ObjCIncompatibleStripper extends TreeScanner {
}
}
- @Override
- public void visitSelect(JCFieldAccess node) {
- unusedImports.remove(getFirstComponent(node));
- unusedStaticImports.remove(getFirstComponent(node));
- }
-
@Override
public void visitVarDef(JCVariableDecl node) {
if (checkAnnotations(node.getModifiers().getAnnotations(), node)) {
@@ -174,17 +168,6 @@ class JavacJ2ObjCIncompatibleStripper extends TreeScanner {
return name.equals("J2ObjCIncompatible");
}
- private String getFirstComponent(JCTree name) {
- switch (name.getKind()) {
- case IDENTIFIER:
- return ((JCIdent) name).getName().toString();
- case MEMBER_SELECT:
- return getFirstComponent(((JCFieldAccess) name).getExpression());
- default:
- return "";
- }
- }
-
private String getLastComponent(JCTree name) {
switch (name.getKind()) {
case IDENTIFIER:
