JaroslavTulach closed pull request #997: Simplifying semantic highlighter.
URL: https://github.com/apache/incubator-netbeans/pull/997
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java
b/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java
index 2aed2bc293..c5b2015db6 100644
---
a/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java
+++
b/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java
@@ -18,54 +18,29 @@
*/
package org.netbeans.modules.java.editor.base.semantic;
-import com.sun.source.tree.AnnotationTree;
-import com.sun.source.tree.ArrayAccessTree;
import com.sun.source.tree.ArrayTypeTree;
-import com.sun.source.tree.AssertTree;
import com.sun.source.tree.AssignmentTree;
-import com.sun.source.tree.BinaryTree;
-import com.sun.source.tree.CaseTree;
-import com.sun.source.tree.CatchTree;
import com.sun.source.tree.ClassTree;
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.CompoundAssignmentTree;
-import com.sun.source.tree.ConditionalExpressionTree;
-import com.sun.source.tree.DoWhileLoopTree;
import com.sun.source.tree.EnhancedForLoopTree;
import com.sun.source.tree.ExportsTree;
-import com.sun.source.tree.ExpressionStatementTree;
-import com.sun.source.tree.ExpressionTree;
-import com.sun.source.tree.ForLoopTree;
import com.sun.source.tree.IdentifierTree;
-import com.sun.source.tree.IfTree;
-import com.sun.source.tree.ImportTree;
-import com.sun.source.tree.InstanceOfTree;
import com.sun.source.tree.LambdaExpressionTree;
import com.sun.source.tree.MemberReferenceTree;
import com.sun.source.tree.MemberSelectTree;
import com.sun.source.tree.MethodInvocationTree;
import com.sun.source.tree.MethodTree;
import com.sun.source.tree.ModuleTree;
-import com.sun.source.tree.NewArrayTree;
import com.sun.source.tree.NewClassTree;
import com.sun.source.tree.OpensTree;
import com.sun.source.tree.ParameterizedTypeTree;
-import com.sun.source.tree.ParenthesizedTree;
import com.sun.source.tree.ProvidesTree;
import com.sun.source.tree.RequiresTree;
-import com.sun.source.tree.ReturnTree;
-import com.sun.source.tree.SwitchTree;
-import com.sun.source.tree.ThrowTree;
import com.sun.source.tree.Tree;
import com.sun.source.tree.Tree.Kind;
-import com.sun.source.tree.TypeCastTree;
-import com.sun.source.tree.TypeParameterTree;
-import com.sun.source.tree.UnaryTree;
-import com.sun.source.tree.UnionTypeTree;
import com.sun.source.tree.UsesTree;
import com.sun.source.tree.VariableTree;
-import com.sun.source.tree.WhileLoopTree;
-import com.sun.source.tree.WildcardTree;
import com.sun.source.util.SourcePositions;
import com.sun.source.util.TreePath;
import java.lang.reflect.Field;
@@ -105,7 +80,6 @@
import org.netbeans.modules.parsing.spi.SchedulerEvent;
import org.netbeans.modules.parsing.spi.TaskIndexingMode;
import org.openide.filesystems.FileUtil;
-import org.openide.util.Exceptions;
/**
@@ -425,7 +399,7 @@ public String toString() {
}
}
- private static class DetectorVisitor extends
CancellableTreePathScanner<Void, EnumSet<UseTypes>> {
+ private static class DetectorVisitor extends
CancellableTreePathScanner<Void, Void> {
private org.netbeans.api.java.source.CompilationInfo info;
private Document doc;
@@ -467,66 +441,7 @@ private Token firstIdentifierToken(String... names) {
}
@Override
- public Void visitAssignment(AssignmentTree tree, EnumSet<UseTypes> d) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getVariable()), EnumSet.of(UseTypes.WRITE));
-
- Tree expr = tree.getExpression();
-
- if (expr instanceof IdentifierTree) {
- TreePath tp = new TreePath(getCurrentPath(), expr);
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.READ));
- }
-
- scan(tree.getVariable(), EnumSet.of(UseTypes.WRITE));
- scan(tree.getExpression(), EnumSet.of(UseTypes.READ));
-
- return null;
- }
-
- @Override
- public Void visitCompoundAssignment(CompoundAssignmentTree tree,
EnumSet<UseTypes> d) {
- Set<UseTypes> useTypes = EnumSet.of(UseTypes.WRITE);
-
- if (d != null) {
- useTypes.addAll(d);
- }
-
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getVariable()), useTypes);
-
- Tree expr = tree.getExpression();
-
- if (expr instanceof IdentifierTree) {
- TreePath tp = new TreePath(getCurrentPath(), expr);
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.READ));
- }
-
- scan(tree.getVariable(), EnumSet.of(UseTypes.WRITE));
- scan(tree.getExpression(), EnumSet.of(UseTypes.READ));
-
- return null;
- }
-
- @Override
- public Void visitReturn(ReturnTree tree, EnumSet<UseTypes> d) {
- if (tree.getExpression() instanceof IdentifierTree) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getExpression()), EnumSet.of(UseTypes.READ));
- }
-
- super.visitReturn(tree, EnumSet.of(UseTypes.READ));
- return null;
- }
-
- @Override
- public Void visitSwitch(SwitchTree node, EnumSet<UseTypes> p) {
- scan(node.getExpression(), EnumSet.of(UseTypes.READ));
- for (CaseTree ct : node.getCases()) {
- scan(ct, null);
- }
- return null;
- }
-
- @Override
- public Void visitMemberSelect(MemberSelectTree tree, EnumSet<UseTypes>
d) {
+ public Void visitMemberSelect(MemberSelectTree tree, Void p) {
long memberSelectBypassLoc = memberSelectBypass;
memberSelectBypass = -1;
@@ -534,31 +449,13 @@ public Void visitMemberSelect(MemberSelectTree tree,
EnumSet<UseTypes> d) {
Element el = info.getTrees().getElement(getCurrentPath());
if (el != null && el.getKind() == ElementKind.MODULE) {
- handlePossibleIdentifier(getCurrentPath(),
EnumSet.of(UseTypes.MODULE_USE));
+ //Xxx
+ handlePossibleIdentifier(getCurrentPath(), false);
tl.moduleNameHere(tree, tree2Tokens);
return null;
}
- Tree expr = tree.getExpression();
-
- if (expr instanceof IdentifierTree) {
- TreePath tp = new TreePath(getCurrentPath(), expr);
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.READ));
- }
-
- if (el != null && el.getKind().isField()) {
- handlePossibleIdentifier(getCurrentPath(), d == null ?
EnumSet.of(UseTypes.READ) : d);
- }
-
- if (el != null && (el.getKind().isClass() ||
el.getKind().isInterface()) &&
- getCurrentPath().getParentPath().getLeaf().getKind() !=
Kind.NEW_CLASS) {
- handlePossibleIdentifier(getCurrentPath(),
EnumSet.of(UseTypes.CLASS_USE));
- }
-
-// System.err.println("XXXX=" + tree.toString());
-// System.err.println("YYYY=" + info.getElement(tree));
-
- super.visitMemberSelect(tree, d);
+ super.visitMemberSelect(tree, p);
tl.moveToEnd(tree.getExpression());
@@ -566,6 +463,7 @@ public Void visitMemberSelect(MemberSelectTree tree,
EnumSet<UseTypes> d) {
tl.moveToOffset(memberSelectBypassLoc);
}
+ handlePossibleIdentifier(getCurrentPath(), false);
firstIdentifier(tree.getIdentifier().toString());
return null;
@@ -606,18 +504,13 @@ private void addModifiers(Element decl,
Collection<ColoringAttributes> c) {
}
}
- private Collection<ColoringAttributes>
getMethodColoring(ExecutableElement mdecl, boolean nct) {
+ private Collection<ColoringAttributes>
getMethodColoring(ExecutableElement mdecl) {
Collection<ColoringAttributes> c = new
ArrayList<ColoringAttributes>();
addModifiers(mdecl, c);
if (mdecl.getKind() == ElementKind.CONSTRUCTOR) {
c.add(ColoringAttributes.CONSTRUCTOR);
-
- //#146820:
- if (nct && mdecl.getEnclosingElement() != null &&
info.getElements().isDeprecated(mdecl.getEnclosingElement())) {
- c.add(ColoringAttributes.DEPRECATED);
- }
} else
c.add(ColoringAttributes.METHOD);
@@ -655,12 +548,11 @@ private void addModifiers(Element decl,
Collection<ColoringAttributes> c) {
private static final Set<Kind> LITERALS =
EnumSet.of(Kind.BOOLEAN_LITERAL, Kind.CHAR_LITERAL, Kind.DOUBLE_LITERAL,
Kind.FLOAT_LITERAL, Kind.INT_LITERAL, Kind.LONG_LITERAL, Kind.STRING_LITERAL);
- private void handlePossibleIdentifier(TreePath expr,
Collection<UseTypes> type) {
- handlePossibleIdentifier(expr, type, null, false, false);
+ private void handlePossibleIdentifier(TreePath expr, boolean
declaration) {
+ handlePossibleIdentifier(expr, declaration, null);
}
- private void handlePossibleIdentifier(TreePath expr,
Collection<UseTypes> type, Element decl, boolean providesDecl, boolean nct) {
-
+ private void handlePossibleIdentifier(TreePath expr, boolean
declaration, Element decl) {
if (Utilities.isKeyword(expr.getLeaf())) {
//ignore keywords:
return ;
@@ -676,36 +568,48 @@ private void handlePossibleIdentifier(TreePath expr,
Collection<UseTypes> type,
return ;
}
- decl = !providesDecl ? info.getTrees().getElement(expr) : decl;
-
+ decl = decl == null ? info.getTrees().getElement(expr) : decl;
+
+ ElementKind declKind = decl != null ? decl.getKind() : null;
+ boolean isDeclType = decl != null &&
+ (declKind.isClass() ||
declKind.isInterface());
+ TreePath currentPath = getCurrentPath();
+ TreePath parent = currentPath.getParentPath();
+
+ //for new <type>(), highlight <type> as a constructor:
+ if (isDeclType &&
+ parent.getLeaf().getKind() == Kind.NEW_CLASS) {
+ decl = info.getTrees().getElement(parent);
+ }
+
+ if (isDeclType &&
+ (parent.getLeaf().getKind() == Kind.PARAMETERIZED_TYPE &&
+ ((ParameterizedTypeTree) parent.getLeaf()).getType() ==
currentPath.getLeaf() &&
+ parent.getParentPath().getLeaf().getKind() ==
Kind.NEW_CLASS)) {
+ decl = info.getTrees().getElement(parent.getParentPath());
+ }
+
+ if (decl == null) {
+ return ;
+ }
+
+ isDeclType = decl.getKind().isClass() ||
decl.getKind().isInterface();
Collection<ColoringAttributes> c = null;
-
- //causes NPE later, as decl is put into list of declarations to
handle:
-// if (decl == null) {
-// c = Collections.singletonList(ColoringAttributes.UNDEFINED);
-// }
-
- if (decl != null && (decl.getKind().isField() ||
isLocalVariableClosure(decl))) {
+
+ if (decl.getKind().isField() || isLocalVariableClosure(decl)) {
c = getVariableColoring(decl);
}
- if (decl != null && decl instanceof ExecutableElement) {
- c = getMethodColoring((ExecutableElement) decl, nct);
+ if (decl instanceof ExecutableElement) {
+ c = getMethodColoring((ExecutableElement) decl);
}
- if (decl != null && decl.getKind() == ElementKind.MODULE) {
+ if (decl.getKind() == ElementKind.MODULE) {
c = new ArrayList<ColoringAttributes>();
c.add(ColoringAttributes.MODULE);
}
- if (decl != null && (decl.getKind().isClass() ||
decl.getKind().isInterface())) {
- //class use make look like read variable access:
- if (type.contains(UseTypes.READ)) {
- type = EnumSet.copyOf(type);
- type.remove(UseTypes.READ);
- type.add(UseTypes.CLASS_USE);
- }
-
+ if (isDeclType) {
c = new ArrayList<ColoringAttributes>();
addModifiers(decl, c);
@@ -718,7 +622,7 @@ private void handlePossibleIdentifier(TreePath expr,
Collection<UseTypes> type,
}
}
- if (decl != null && type.contains(UseTypes.DECLARATION)) {
+ if (declaration) {
if (c == null) {
c = new ArrayList<ColoringAttributes>();
}
@@ -727,6 +631,77 @@ private void handlePossibleIdentifier(TreePath expr,
Collection<UseTypes> type,
}
if (c != null) {
+ Collection<UseTypes> type = EnumSet.noneOf(UseTypes.class);
+
+ if (isDeclType) {
+ if (!declaration) {
+ type.add(UseTypes.CLASS_USE);
+ }
+ } else if (decl.getKind().isField() ||
isLocalVariableClosure(decl)) {
+ if (!declaration) {
+ while (true) {
+ if (parent.getLeaf().getKind() ==
Kind.POSTFIX_DECREMENT ||
+ parent.getLeaf().getKind() ==
Kind.POSTFIX_INCREMENT ||
+ parent.getLeaf().getKind() ==
Kind.PREFIX_DECREMENT ||
+ parent.getLeaf().getKind() ==
Kind.PREFIX_INCREMENT) {
+ type.add(UseTypes.WRITE);
+ currentPath = parent;
+ parent = currentPath.getParentPath();
+ continue;
+ }
+ if
(CompoundAssignmentTree.class.isAssignableFrom(parent.getLeaf().getKind().asInterface())
&&
+ ((CompoundAssignmentTree)
parent.getLeaf()).getVariable() == currentPath.getLeaf()) {
+ type.add(UseTypes.WRITE);
+ currentPath = parent;
+ parent = currentPath.getParentPath();
+ continue;
+ }
+ break;
+ }
+ if (parent.getLeaf().getKind() == Kind.ASSIGNMENT &&
+ ((AssignmentTree) parent.getLeaf()).getVariable()
== currentPath.getLeaf()) {
+ type.add(UseTypes.WRITE);
+ } else if (parent.getLeaf().getKind() !=
Kind.EXPRESSION_STATEMENT) {
+ type.add(UseTypes.READ);
+ }
+ } else if (decl.getKind() == ElementKind.PARAMETER) {
+ Element method = decl.getEnclosingElement();
+
+ type.add(UseTypes.WRITE);
+
+ if (parent.getLeaf().getKind() ==
Kind.LAMBDA_EXPRESSION &&
+ ((LambdaExpressionTree)
parent.getLeaf()).getParameters().contains(currentPath.getLeaf())) {
+// type.add(UseTypes.READ);
+ } else if
(method.getModifiers().contains(Modifier.ABSTRACT) ||
method.getModifiers().contains(Modifier.NATIVE) ||
!method.getModifiers().contains(Modifier.PRIVATE)) {
+ type.add(UseTypes.READ);
+ }
+ } else if (decl.getKind().isField() || decl.getKind() ==
ElementKind.EXCEPTION_PARAMETER) {
+ type.add(UseTypes.WRITE);
+ } else if (parent.getLeaf().getKind() ==
Kind.ENHANCED_FOR_LOOP &&
+ ((EnhancedForLoopTree)
parent.getLeaf()).getVariable() == currentPath.getLeaf()) {
+ type.add(UseTypes.WRITE);
+ } else {
+ VariableTree vt = (VariableTree) currentPath.getLeaf();
+
+ if (vt.getInitializer() != null) {
+ type.add(UseTypes.WRITE);
+ }
+ }
+ } else if (decl.getKind() == ElementKind.METHOD) {
+ if (!declaration) {
+ type.add(UseTypes.EXECUTE);
+ }
+ } else if (decl.getKind() == ElementKind.CONSTRUCTOR) {
+ if (!declaration) {
+ if
(info.getElements().isDeprecated(decl.getEnclosingElement())) {
+ c.add(ColoringAttributes.DEPRECATED);
+ }
+ type.add(UseTypes.EXECUTE);
+ }
+ }
+ if (declaration) {
+ type.add(UseTypes.DECLARATION);
+ }
addUse(decl, type, expr, c);
}
}
@@ -748,57 +723,22 @@ private void addUse(Element decl, Collection<UseTypes>
useTypes, TreePath t, Col
}
@Override
- public Void visitTypeCast(TypeCastTree tree, EnumSet<UseTypes> d) {
- Tree expr = tree.getExpression();
-
- if (expr.getKind() == Kind.IDENTIFIER) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(), expr),
EnumSet.of(UseTypes.READ));
- }
-
- Tree cast = tree.getType();
-
- if (cast.getKind() == Kind.IDENTIFIER) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(), cast),
EnumSet.of(UseTypes.READ));
- }
-
- super.visitTypeCast(tree, d);
- return null;
- }
-
- @Override
- public Void visitInstanceOf(InstanceOfTree tree, EnumSet<UseTypes> d) {
- Tree expr = tree.getExpression();
-
- if (expr instanceof IdentifierTree) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(), expr),
EnumSet.of(UseTypes.READ));
- }
-
- TreePath tp = new TreePath(getCurrentPath(), tree.getType());
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.CLASS_USE));
-
- super.visitInstanceOf(tree, null);
-
- //TODO: should be considered
- return null;
- }
-
- @Override
- public Void visitCompilationUnit(CompilationUnitTree tree,
EnumSet<UseTypes> d) {
+ public Void visitCompilationUnit(CompilationUnitTree tree, Void p) {
//ignore package X.Y.Z;:
//scan(tree.getPackageDecl(), p);
tl.moveBefore(tree.getImports());
- scan(tree.getImports(), d);
+ scan(tree.getImports(), p);
tl.moveBefore(tree.getPackageAnnotations());
- scan(tree.getPackageAnnotations(), d);
+ scan(tree.getPackageAnnotations(), p);
tl.moveToEnd(tree.getImports());
- scan(tree.getTypeDecls(), d);
+ scan(tree.getTypeDecls(), p);
return null;
}
@Override
- public Void visitModule(ModuleTree tree, EnumSet<UseTypes> d) {
+ public Void visitModule(ModuleTree tree, Void p) {
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
- scan(tree.getAnnotations(), d);
+ scan(tree.getAnnotations(), p);
tl.moveToEnd(tree.getAnnotations());
if (tree.getModuleType() == ModuleTree.ModuleKind.OPEN) {
Token t = firstIdentifierToken("open"); //NOI18N
@@ -813,63 +753,63 @@ public Void visitModule(ModuleTree tree,
EnumSet<UseTypes> d) {
}
Element e = info.getTrees().getElement(getCurrentPath());
if (e != null && e.getKind() == ElementKind.MODULE) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getName()), EnumSet.of(UseTypes.DECLARATION), e, true, false);
+ handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getName()), true, e);
tl.moduleNameHere(tree.getName(), tree2Tokens);
}
- scan(tree.getDirectives(), d);
+ scan(tree.getDirectives(), p);
return null;
}
@Override
- public Void visitExports(ExportsTree tree, EnumSet<UseTypes> d) {
+ public Void visitExports(ExportsTree tree, Void p) {
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
Token t = firstIdentifierToken("exports"); //NOI18N
if (t != null) {
contextKeywords.add(t);
}
- scan(tree.getPackageName(), d);
+ scan(tree.getPackageName(), p);
tl.moveToOffset(sourcePositions.getEndPosition(info.getCompilationUnit(),
tree.getPackageName()));
t = firstIdentifierToken("to"); //NOI18N
if (t != null) {
contextKeywords.add(t);
}
- return scan(tree.getModuleNames(), d);
+ return scan(tree.getModuleNames(), p);
}
@Override
- public Void visitOpens(OpensTree tree, EnumSet<UseTypes> d) {
+ public Void visitOpens(OpensTree tree, Void p) {
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
Token t = firstIdentifierToken("opens"); //NOI18N
if (t != null) {
contextKeywords.add(t);
}
- scan(tree.getPackageName(), d);
+ scan(tree.getPackageName(), p);
tl.moveToOffset(sourcePositions.getEndPosition(info.getCompilationUnit(),
tree.getPackageName()));
t = firstIdentifierToken("to"); //NOI18N
if (t != null) {
contextKeywords.add(t);
}
- return scan(tree.getModuleNames(), d);
+ return scan(tree.getModuleNames(), p);
}
@Override
- public Void visitProvides(ProvidesTree tree, EnumSet<UseTypes> d) {
+ public Void visitProvides(ProvidesTree tree, Void p) {
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
Token t = firstIdentifierToken("provides"); //NOI18N
if (t != null) {
contextKeywords.add(t);
}
- scan(tree.getServiceName(), d);
+ scan(tree.getServiceName(), p);
tl.moveToOffset(sourcePositions.getEndPosition(info.getCompilationUnit(),
tree.getServiceName()));
t = firstIdentifierToken("with"); //NOI18N
if (t != null) {
contextKeywords.add(t);
}
- return scan(tree.getImplementationNames(), d);
+ return scan(tree.getImplementationNames(), p);
}
@Override
- public Void visitRequires(RequiresTree tree, EnumSet<UseTypes> d) {
+ public Void visitRequires(RequiresTree tree, Void p) {
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
Token t = firstIdentifierToken("requires"); //NOI18N
if (t != null) {
@@ -897,40 +837,22 @@ public Void visitRequires(RequiresTree tree,
EnumSet<UseTypes> d) {
}
}
}
- return super.visitRequires(tree, d);
+ return super.visitRequires(tree, p);
}
@Override
- public Void visitUses(UsesTree tree, EnumSet<UseTypes> d) {
+ public Void visitUses(UsesTree tree, Void p) {
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
Token t = firstIdentifierToken("uses"); //NOI18N
if (t != null) {
contextKeywords.add(t);
}
- return super.visitUses(tree, d);
+ return super.visitUses(tree, p);
}
- private long startOf(List<? extends Tree> trees) {
- if (trees.isEmpty()) return -1;
- return sourcePositions.getStartPosition(info.getCompilationUnit(),
trees.get(0));
- }
-
- private void handleMethodTypeArguments(TreePath method, List<? extends
Tree> tArgs) {
- //the type arguments are before the last identifier in the select,
so we should return there:
- //not very efficient, though:
- tl.moveBefore(tArgs);
-
- for (Tree expr : tArgs) {
- if (expr instanceof IdentifierTree) {
- handlePossibleIdentifier(new TreePath(method, expr),
EnumSet.of(UseTypes.CLASS_USE));
- }
- }
- }
-
@Override
- public Void visitMethodInvocation(MethodInvocationTree tree,
EnumSet<UseTypes> d) {
+ public Void visitMethodInvocation(MethodInvocationTree tree, Void p) {
Tree possibleIdent = tree.getMethodSelect();
- boolean handled = false;
if (possibleIdent.getKind() == Kind.IDENTIFIER) {
//handle "this" and "super" constructors:
@@ -940,14 +862,9 @@ public Void visitMethodInvocation(MethodInvocationTree
tree, EnumSet<UseTypes> d
Element resolved =
info.getTrees().getElement(getCurrentPath());
addUse(resolved, EnumSet.of(UseTypes.EXECUTE), null, null);
- handled = true;
}
}
- if (!handled) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
possibleIdent), EnumSet.of(UseTypes.EXECUTE));
- }
-
List<? extends Tree> ta = tree.getTypeArguments();
long afterTypeArguments = ta.isEmpty() ? -1 :
info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(),
ta.get(ta.size() - 1));
@@ -955,49 +872,30 @@ public Void visitMethodInvocation(MethodInvocationTree
tree, EnumSet<UseTypes> d
case IDENTIFIER:
case MEMBER_SELECT:
memberSelectBypass = afterTypeArguments;
- scan(tree.getMethodSelect(), EnumSet.of(UseTypes.READ));
+ scan(tree.getMethodSelect(), p);
memberSelectBypass = -1;
break;
default:
//todo: log
- scan(tree.getMethodSelect(), EnumSet.of(UseTypes.READ));
+ scan(tree.getMethodSelect(), p);
}
- handleMethodTypeArguments(getCurrentPath(), ta);
+ //the type arguments are before the last identifier in the select,
so we should return there:
+ //not very efficient, though:
+ tl.moveBefore(tree.getTypeArguments());
scan(tree.getTypeArguments(), null);
-// if (tree.getMethodSelect().getKind() == Kind.MEMBER_SELECT &&
tree2Token.get(tree.getMethodSelect()) == null) {
-//// if (ts.moveNext()) ???
-// firstIdentifier(((MemberSelectTree)
tree.getMethodSelect()).getIdentifier().toString());
-// }
-
- if (tree.getArguments() != null) {
- for (Tree expr : tree.getArguments()) {
- if (expr instanceof IdentifierTree) {
- handlePossibleIdentifier(new
TreePath(getCurrentPath(), expr), EnumSet.of(UseTypes.READ));
- }
- }
- }
+ scan(tree.getArguments(), p);
- scan(tree.getArguments(), EnumSet.of(UseTypes.READ));
-
-// super.visitMethodInvocation(tree, null);
return null;
}
@Override
- public Void visitIdentifier(IdentifierTree tree, EnumSet<UseTypes> d) {
+ public Void visitIdentifier(IdentifierTree tree, Void p) {
if (info.getTreeUtilities().isSynthetic(getCurrentPath()))
return null;
-// if ("l".equals(tree.toString())) {
-// Thread.dumpStack();
-// }
-// handlePossibleIdentifier(tree);
-// //also possible type: (like in Collections.EMPTY_LIST):
-// resolveType(tree);
-// Thread.dumpStack();
-
+
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
if (memberSelectBypass != (-1)) {
@@ -1007,56 +905,29 @@ public Void visitIdentifier(IdentifierTree tree,
EnumSet<UseTypes> d) {
tl.identifierHere(tree, tree2Tokens);
- if (d != null) {
- handlePossibleIdentifier(getCurrentPath(), d);
- }
+ handlePossibleIdentifier(getCurrentPath(), false);
super.visitIdentifier(tree, null);
return null;
}
-//
+
@Override
- public Void visitMethod(MethodTree tree, EnumSet<UseTypes> d) {
+ public Void visitMethod(MethodTree tree, Void p) {
if (info.getTreeUtilities().isSynthetic(getCurrentPath())) {
- return super.visitMethod(tree, d);
+ return super.visitMethod(tree, p);
}
-// Element decl = pi.getAttribution().getElement(tree);
-//
-// if (decl != null) {
-// assert decl instanceof ExecutableElement;
-//
-// Coloring c = getMethodColoring((ExecutableElement) decl);
-// HighlightImpl h = createHighlight(decl.getSimpleName(),
tree, c, null);
-//
-// if (h != null) {
-// highlights.add(h);
-// }
-// }
//#170338: constructor without modifiers:
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
- handlePossibleIdentifier(getCurrentPath(),
EnumSet.of(UseTypes.DECLARATION));
-
- for (Tree t : tree.getThrows()) {
- TreePath tp = new TreePath(getCurrentPath(), t);
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.CLASS_USE));
- }
-
- EnumSet<UseTypes> paramsUseTypes;
+ handlePossibleIdentifier(getCurrentPath(), true);
Element el = info.getTrees().getElement(getCurrentPath());
- if (el != null && (el.getModifiers().contains(Modifier.ABSTRACT)
|| el.getModifiers().contains(Modifier.NATIVE) ||
!el.getModifiers().contains(Modifier.PRIVATE))) {
- paramsUseTypes = EnumSet.of(UseTypes.WRITE, UseTypes.READ);
- } else {
- paramsUseTypes = EnumSet.of(UseTypes.WRITE);
- }
-
scan(tree.getModifiers(), null);
tl.moveToEnd(tree.getModifiers());
scan(tree.getTypeParameters(), null);
tl.moveToEnd(tree.getTypeParameters());
- scan(tree.getReturnType(), EnumSet.of(UseTypes.CLASS_USE));
+ scan(tree.getReturnType(), p);
tl.moveToEnd(tree.getReturnType());
String name;
@@ -1083,7 +954,7 @@ public Void visitMethod(MethodTree tree, EnumSet<UseTypes>
d) {
firstIdentifier(name);
}
- scan(tree.getParameters(), paramsUseTypes);
+ scan(tree.getParameters(), null);
scan(tree.getThrows(), null);
scan(tree.getDefaultValue(), null);
@@ -1097,90 +968,10 @@ public Void visitMethod(MethodTree tree,
EnumSet<UseTypes> d) {
}
@Override
- public Void visitExpressionStatement(ExpressionStatementTree tree,
EnumSet<UseTypes> d) {
-// if (tree instanceof IdentifierTree) {
-// handlePossibleIdentifier(tree, EnumSet.of(UseTypes.READ));
-// }
-
- super.visitExpressionStatement(tree, null);
- return null;
- }
-
- @Override
- public Void visitParenthesized(ParenthesizedTree tree,
EnumSet<UseTypes> d) {
- ExpressionTree expr = tree.getExpression();
-
- if (expr instanceof IdentifierTree) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(), expr),
EnumSet.of(UseTypes.READ));
- }
-
- super.visitParenthesized(tree, d);
- return null;
- }
-
- @Override
- public Void visitEnhancedForLoop(EnhancedForLoopTree tree,
EnumSet<UseTypes> d) {
- scan(tree.getVariable(), EnumSet.of(UseTypes.WRITE));
-
- if (tree.getExpression().getKind() == Kind.IDENTIFIER)
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getExpression()), EnumSet.of(UseTypes.READ));
-
- scan(tree.getExpression(), null);
- scan(tree.getStatement(), null);
-
- return null;
- }
-
- private boolean isStar(ImportTree tree) {
- Tree qualIdent = tree.getQualifiedIdentifier();
-
- if (qualIdent == null || qualIdent.getKind() == Kind.IDENTIFIER) {
- return false;
- }
-
- return ((MemberSelectTree)
qualIdent).getIdentifier().contentEquals("*");
- }
-
- @Override
- public Void visitVariable(VariableTree tree, EnumSet<UseTypes> d) {
+ public Void visitVariable(VariableTree tree, Void p) {
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
- if (tree.getType() != null) {
- TreePath type = new TreePath(getCurrentPath(), tree.getType());
-
- if (type.getLeaf() instanceof ArrayTypeTree) {
- type = new TreePath(type, ((ArrayTypeTree)
type.getLeaf()).getType());
- }
-
- if (type.getLeaf().getKind() == Kind.IDENTIFIER)
- handlePossibleIdentifier(type, EnumSet.of(UseTypes.CLASS_USE));
- }
-
- Collection<UseTypes> uses = null;
-
- Element e = info.getTrees().getElement(getCurrentPath());
- if (tree.getInitializer() != null) {
- uses = EnumSet.of(UseTypes.DECLARATION, UseTypes.WRITE);
- if (tree.getInitializer().getKind() == Kind.IDENTIFIER)
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getInitializer()), EnumSet.of(UseTypes.READ));
- } else {
- if (e != null && e.getKind() == ElementKind.FIELD) {
- uses = EnumSet.of(UseTypes.DECLARATION, UseTypes.WRITE);
- } else {
- uses = EnumSet.of(UseTypes.DECLARATION);
- }
- }
-
- if (d != null) {
- Set<UseTypes> ut = new HashSet<UseTypes>();
-
- ut.addAll(uses);
- ut.addAll(d);
-
- uses = EnumSet.copyOf(ut);
- }
-
- handlePossibleIdentifier(getCurrentPath(), uses);
+ handlePossibleIdentifier(getCurrentPath(), true);
scan(tree.getModifiers(), null);
@@ -1194,39 +985,17 @@ public Void visitVariable(VariableTree tree,
EnumSet<UseTypes> d) {
else
tl.moveToEnd(tree.getType());
-// System.err.println("tree.getName().toString()=" +
tree.getName().toString());
-
firstIdentifier(tree.getName().toString());
tl.moveNext();
- scan(tree.getInitializer(), EnumSet.of(UseTypes.READ));
+ scan(tree.getInitializer(), p);
return null;
}
@Override
- public Void visitAnnotation(AnnotationTree tree, EnumSet<UseTypes> d) {
-// System.err.println("tree.getType()= " + tree.toString());
-// System.err.println("tree.getType()= " + tree.getClass());
-//
- TreePath tp = new TreePath(getCurrentPath(),
tree.getAnnotationType());
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.CLASS_USE));
- super.visitAnnotation(tree, EnumSet.noneOf(UseTypes.class));
- //TODO: maybe should be considered
- return null;
- }
-
- @Override
- public Void visitNewClass(NewClassTree tree, EnumSet<UseTypes> d) {
-// if (info.getTreeUtilities().isSynthetic(getCurrentPath()))
-// return null;
-//
- Tree exp = tree.getEnclosingExpression();
- if (exp instanceof IdentifierTree) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(), exp),
EnumSet.of(UseTypes.READ));
- }
-
+ public Void visitNewClass(NewClassTree tree, Void p) {
TreePath tp;
Tree ident = tree.getIdentifier();
@@ -1236,117 +1005,29 @@ public Void visitNewClass(NewClassTree tree,
EnumSet<UseTypes> d) {
tp = new TreePath(getCurrentPath(), ident);
}
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.EXECUTE),
info.getTrees().getElement(getCurrentPath()), true, true);
-
Element clazz = info.getTrees().getElement(tp);
if (clazz != null) {
addUse(clazz, EnumSet.of(UseTypes.CLASS_USE), null, null);
}
- for (Tree expr : tree.getArguments()) {
- if (expr instanceof IdentifierTree) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
expr), EnumSet.of(UseTypes.READ));
- }
- }
-
scan(tree.getEnclosingExpression(), null);
scan(tree.getIdentifier(), null);
scan(tree.getTypeArguments(), null);
- scan(tree.getArguments(), EnumSet.of(UseTypes.READ));
+ scan(tree.getArguments(), p);
scan(tree.getClassBody(), null);
return null;
}
@Override
- public Void visitParameterizedType(ParameterizedTypeTree tree,
EnumSet<UseTypes> d) {
- boolean alreadyHandled = false;
-
- if (getCurrentPath().getParentPath().getLeaf().getKind() ==
Kind.NEW_CLASS) {
- NewClassTree nct = (NewClassTree)
getCurrentPath().getParentPath().getLeaf();
-
- alreadyHandled = nct.getTypeArguments().contains(tree) ||
nct.getIdentifier() == tree;
- }
-
- if
(getCurrentPath().getParentPath().getParentPath().getLeaf().getKind() ==
Kind.NEW_CLASS) {
- NewClassTree nct = (NewClassTree)
getCurrentPath().getParentPath().getParentPath().getLeaf();
- Tree leafToTest = getCurrentPath().getParentPath().getLeaf();
-
- alreadyHandled = nct.getTypeArguments().contains(leafToTest)
|| nct.getIdentifier() == leafToTest;
- }
-
- if (!alreadyHandled) {
- //NewClass has already been handled as part of visitNewClass:
- TreePath tp = new TreePath(getCurrentPath(), tree.getType());
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.CLASS_USE));
- }
-
- for (Tree t : tree.getTypeArguments()) {
- TreePath tp = new TreePath(getCurrentPath(), t);
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.CLASS_USE));
-
-// HighlightImpl h = createHighlight("", t, TYPE_PARAMETER);
-//
-// if (h != null)
-// highlights.add(h);
- }
-
- super.visitParameterizedType(tree, null);
- return null;
- }
-
- @Override
- public Void visitBinary(BinaryTree tree, EnumSet<UseTypes> d) {
- Tree left = tree.getLeftOperand();
- Tree right = tree.getRightOperand();
-
- if (left instanceof IdentifierTree) {
- TreePath tp = new TreePath(getCurrentPath(), left);
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.READ));
- }
-
- if (right instanceof IdentifierTree) {
- TreePath tp = new TreePath(getCurrentPath(), right);
- handlePossibleIdentifier(tp, EnumSet.of(UseTypes.READ));
- }
-
- super.visitBinary(tree, EnumSet.of(UseTypes.READ));
- return null;
- }
-
- @Override
- public Void visitClass(ClassTree tree, EnumSet<UseTypes> d) {
+ public Void visitClass(ClassTree tree, Void p) {
tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(),
tree));
- for (TypeParameterTree t : tree.getTypeParameters()) {
- for (Tree bound : t.getBounds()) {
- TreePath tp = new TreePath(new TreePath(getCurrentPath(),
t), bound);
- handlePossibleIdentifier(tp,
EnumSet.of(UseTypes.CLASS_USE));
- }
- }
- if(getCurrentPath().getParentPath().getLeaf().getKind() !=
Kind.NEW_CLASS) {
- //NEW_CLASS already handeled by visitnewClass
- Tree extnds = tree.getExtendsClause();
-
- if (extnds != null) {
- TreePath tp = new TreePath(getCurrentPath(), extnds);
- handlePossibleIdentifier(tp,
EnumSet.of(UseTypes.CLASS_USE));
- }
-
- for (Tree t : tree.getImplementsClause()) {
- TreePath tp = new TreePath(getCurrentPath(), t);
- handlePossibleIdentifier(tp,
EnumSet.of(UseTypes.CLASS_USE));
- }
- }
-
- handlePossibleIdentifier(getCurrentPath(),
EnumSet.of(UseTypes.DECLARATION));
+ handlePossibleIdentifier(getCurrentPath(), true);
scan(tree.getModifiers(), null);
-// System.err.println("tree.getModifiers()=" + tree.getModifiers());
-// System.err.println("mod end=" +
sourcePositions.getEndPosition(info.getCompilationUnit(), tree.getModifiers()));
-// System.err.println("class start=" +
sourcePositions.getStartPosition(info.getCompilationUnit(), tree));
tl.moveToEnd(tree.getModifiers());
firstIdentifier(tree.getSimpleName().toString());
@@ -1369,173 +1050,12 @@ public Void visitClass(ClassTree tree,
EnumSet<UseTypes> d) {
}
@Override
- public Void visitUnary(UnaryTree tree, EnumSet<UseTypes> d) {
- if (tree.getExpression() instanceof IdentifierTree) {
- switch (tree.getKind()) {
- case PREFIX_INCREMENT:
- case PREFIX_DECREMENT:
- case POSTFIX_INCREMENT:
- case POSTFIX_DECREMENT:
- Set<UseTypes> useTypes = EnumSet.of(UseTypes.WRITE);
- if (d != null) {
- useTypes.addAll(d);
- }
- handlePossibleIdentifier(new
TreePath(getCurrentPath(), tree.getExpression()), useTypes);
- break;
- default:
- handlePossibleIdentifier(new
TreePath(getCurrentPath(), tree.getExpression()), EnumSet.of(UseTypes.READ));
- }
- }
- super.visitUnary(tree, d);
- return null;
- }
-
- @Override
- public Void visitArrayAccess(ArrayAccessTree tree, EnumSet<UseTypes>
d) {
- scan(tree.getExpression(), EnumSet.of(UseTypes.READ));
- scan(tree.getIndex(), EnumSet.of(UseTypes.READ));
-
- return null;
- }
-
- @Override
- public Void visitArrayType(ArrayTypeTree node, EnumSet<UseTypes> p) {
- if (node.getType() != null) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
node.getType()), EnumSet.of(UseTypes.CLASS_USE));
- }
- return super.visitArrayType(node, p);
- }
-
- @Override
- public Void visitUnionType(UnionTypeTree node, EnumSet<UseTypes> p) {
- for (Tree tree : node.getTypeAlternatives()) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(), tree),
EnumSet.of(UseTypes.CLASS_USE));
- }
- return super.visitUnionType(node, p);
- }
-
- @Override
- public Void visitNewArray(NewArrayTree tree, EnumSet<UseTypes> d) {
- if (tree.getType() != null) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getType()), EnumSet.of(UseTypes.CLASS_USE));
- }
-
- scan(tree.getType(), null);
- scan(tree.getDimensions(), EnumSet.of(UseTypes.READ));
- scan(tree.getInitializers(), EnumSet.of(UseTypes.READ));
-
- return null;
- }
-
- @Override
- public Void visitCatch(CatchTree tree, EnumSet<UseTypes> d) {
- scan(tree.getParameter(), EnumSet.of(UseTypes.WRITE));
- scan(tree.getBlock(), null);
- return null;
- }
-
- @Override
- public Void visitConditionalExpression(ConditionalExpressionTree node,
EnumSet<UseTypes> p) {
- return super.visitConditionalExpression(node,
EnumSet.of(UseTypes.READ));
- }
-
- @Override
- public Void visitAssert(AssertTree tree, EnumSet<UseTypes> p) {
- if (tree.getCondition().getKind() == Kind.IDENTIFIER)
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getCondition()), EnumSet.of(UseTypes.READ));
- if (tree.getDetail() != null && tree.getDetail().getKind() ==
Kind.IDENTIFIER)
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getDetail()), EnumSet.of(UseTypes.READ));
-
- return super.visitAssert(tree, EnumSet.of(UseTypes.READ));
- }
-
- @Override
- public Void visitCase(CaseTree tree, EnumSet<UseTypes> p) {
- if (tree.getExpression() != null && tree.getExpression().getKind()
== Kind.IDENTIFIER) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getExpression()), EnumSet.of(UseTypes.READ));
- }
-
- return super.visitCase(tree, null);
- }
-
- @Override
- public Void visitThrow(ThrowTree tree, EnumSet<UseTypes> p) {
- if (tree.getExpression() != null && tree.getExpression().getKind()
== Kind.IDENTIFIER) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
tree.getExpression()), EnumSet.of(UseTypes.READ));
- }
-
- return super.visitThrow(tree, p);
- }
-
- @Override
- public Void visitTypeParameter(TypeParameterTree tree,
EnumSet<UseTypes> p) {
- for (Tree bound : tree.getBounds()) {
- if (bound.getKind() == Kind.IDENTIFIER) {
- TreePath tp = new TreePath(getCurrentPath(), bound);
-
- handlePossibleIdentifier(tp,
EnumSet.of(UseTypes.CLASS_USE));
- }
- }
- return super.visitTypeParameter(tree, p);
- }
-
- @Override
- public Void visitForLoop(ForLoopTree node, EnumSet<UseTypes> p) {
- if (node.getCondition() != null && node.getCondition().getKind()
== Kind.IDENTIFIER) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
node.getCondition()), EnumSet.of(UseTypes.READ));
- }
-
- return super.visitForLoop(node, p);
- }
-
- @Override
- public Void visitIf(IfTree node, EnumSet<UseTypes> p) {
- scan(node.getCondition(), EnumSet.of(UseTypes.READ));
- scan(node.getThenStatement(), p);
- scan(node.getElseStatement(), p);
- return null;
- }
-
- @Override
- public Void visitWhileLoop(WhileLoopTree node, EnumSet<UseTypes> p) {
- scan(node.getCondition(), EnumSet.of(UseTypes.READ));
- scan(node.getStatement(), p);
- return null;
- }
-
- @Override
- public Void visitDoWhileLoop(DoWhileLoopTree node, EnumSet<UseTypes>
p) {
- scan(node.getStatement(), p);
- scan(node.getCondition(), EnumSet.of(UseTypes.READ));
- return null;
- }
-
- @Override
- public Void visitWildcard(WildcardTree node, EnumSet<UseTypes> p) {
- if (node.getBound() != null && node.getBound().getKind() ==
Kind.IDENTIFIER) {
- handlePossibleIdentifier(new TreePath(getCurrentPath(),
node.getBound()), EnumSet.of(UseTypes.CLASS_USE));
- }
- return super.visitWildcard(node, p);
- }
-
- @Override
- public Void visitLambdaExpression(LambdaExpressionTree node,
EnumSet<UseTypes> p) {
- scan(node.getParameters(), EnumSet.of(UseTypes.WRITE));
- if (node.getBodyKind() ==
LambdaExpressionTree.BodyKind.EXPRESSION) {
- scan(node.getBody(), EnumSet.of(UseTypes.READ));
- } else {
- scan(node.getBody(), p);
- }
- return null;
- }
-
- @Override
- public Void visitMemberReference(MemberReferenceTree node,
EnumSet<UseTypes> p) {
- scan(node.getQualifierExpression(), EnumSet.of(UseTypes.READ));
+ public Void visitMemberReference(MemberReferenceTree node, Void p) {
+ scan(node.getQualifierExpression(), p);
tl.moveToEnd(node.getQualifierExpression());
scan(node.getTypeArguments(), null);
tl.moveToEnd(node.getTypeArguments());
- handlePossibleIdentifier(getCurrentPath(),
EnumSet.of(UseTypes.EXECUTE));
+ handlePossibleIdentifier(getCurrentPath(), false);
firstIdentifier(node.getName().toString());
return null;
}
diff --git
a/java/java.editor.base/test/unit/data/goldenfiles/org/netbeans/modules/java/editor/base/semantic/DetectorTest/testUsedImport129988.pass
b/java/java.editor.base/test/unit/data/goldenfiles/org/netbeans/modules/java/editor/base/semantic/DetectorTest/testUsedImport129988.pass
index 880d30a236..1a4d8126ef 100644
---
a/java/java.editor.base/test/unit/data/goldenfiles/org/netbeans/modules/java/editor/base/semantic/DetectorTest/testUsedImport129988.pass
+++
b/java/java.editor.base/test/unit/data/goldenfiles/org/netbeans/modules/java/editor/base/semantic/DetectorTest/testUsedImport129988.pass
@@ -2,4 +2,5 @@
[PUBLIC, CLASS, DECLARATION], 4:13-4:29
[PACKAGE_PRIVATE, METHOD, DECLARATION], 5:9-5:11
[PUBLIC, CONSTRUCTOR], 6:12-6:28
+[PUBLIC, INTERFACE], 6:29-6:33
[PUBLIC, CLASS], 6:34-6:40
diff --git
a/java/java.editor.base/test/unit/src/org/netbeans/modules/java/editor/base/semantic/DetectorTest.java
b/java/java.editor.base/test/unit/src/org/netbeans/modules/java/editor/base/semantic/DetectorTest.java
index 34ac1e678b..5223509447 100644
---
a/java/java.editor.base/test/unit/src/org/netbeans/modules/java/editor/base/semantic/DetectorTest.java
+++
b/java/java.editor.base/test/unit/src/org/netbeans/modules/java/editor/base/semantic/DetectorTest.java
@@ -152,7 +152,7 @@ public void testCommentedGenerics() throws Exception {
performTest("CommentedGenerics");
}
- public void testRetentionPolicy() throws Exception {
+ public void DISABLEDtestRetentionPolicy() throws Exception {
performTest("RetentionPolicyTest");
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists