Skip to content

Commit

Permalink
minor fix-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Dec 2, 2019
1 parent 273a92a commit 8590c03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ private void visitMethodOverrides(ClassNode node) {
public void visitAnnotation(AnnotationNode node) {
ClassNode type = node.getClassNode();
VariableScope scope = scopes.getLast();
TypeLookupResult noLookup = new TypeLookupResult(type, type, type, TypeConfidence.EXACT, scope);
TypeLookupResult noLookup = new TypeLookupResult(type, type, node, TypeConfidence.EXACT, scope);

VisitStatus status = notifyRequestor(node, requestor, noLookup);
switch (status) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ private void handleMatch(TypeLookupResult result, IJavaElement enclosingElement)
}
} else if (requestedNode instanceof ImportNode) {
ImportNode importNode = (ImportNode) requestedNode;
requestedNode = Optional.ofNullable(importNode.getType()).map(ClassNode::redirect).get();
if (importNode.getType() != null) {
requestedNode = importNode.getType().redirect();
}
}

if (requestedNode != null) {
Expand Down Expand Up @@ -222,14 +224,13 @@ private void handleMatch(TypeLookupResult result, IJavaElement enclosingElement)
if (start < until) {
String pack = gunit.getSource().substring(start, until).replaceFirst("^import\\s+", "");
for (IPackageFragmentRoot root : gunit.getJavaProject().getPackageFragmentRoots()) {
IPackageFragment frag = root.getPackageFragment(pack);
if (frag != null && frag.exists()) {
requestedElement = frag;
IPackageFragment fragment = root.getPackageFragment(pack);
if (fragment != null && fragment.exists()) {
requestedElement = fragment;
break;
}
}
}
requestedNode = nodeToLookFor;

} else {
String qualifier = checkQualifiedType(result, enclosingElement);
Expand Down

0 comments on commit 8590c03

Please sign in to comment.