Skip to content

Commit

Permalink
Handle annotations on qualified type names (#63)
Browse files Browse the repository at this point in the history
Context: #59
  • Loading branch information
cushon committed Jul 16, 2016
1 parent d143f07 commit a27781e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
Expand Up @@ -1573,10 +1573,10 @@ public boolean visit(QualifiedType node) {
sync(node);
builder.open(plusFour);
// Collapse chains of "." operators.
ArrayDeque<SimpleName> stack = new ArrayDeque<>();
ArrayDeque<QualifiedType> stack = new ArrayDeque<>();
Type qualifier;
while (true) {
stack.add(node.getName());
stack.addFirst(node);
qualifier = node.getQualifier();
if (qualifier.getNodeType() != ASTNode.QUALIFIED_TYPE) {
break;
Expand All @@ -1587,7 +1587,9 @@ public boolean visit(QualifiedType node) {
do {
builder.breakOp();
token(".");
visit(stack.removeLast());
QualifiedType name = stack.removeFirst();
visitAnnotations(name.annotations(), BreakOrNot.NO, BreakOrNot.YES);
visit(name.getName());
} while (!stack.isEmpty());
builder.close();
return false;
Expand Down
@@ -0,0 +1,10 @@
import org.checkerframework.checker.tainting.qual.*;
class Outer {
class Nested {
class InnerMost {
@A Outer context(@B Outer.@C Nested.@D InnerMost this) {
return Outer.this;
}
}
}
}
@@ -0,0 +1,12 @@
import org.checkerframework.checker.tainting.qual.*;

class Outer {
class Nested {
class InnerMost {
@A
Outer context(@B Outer.@C Nested.@D InnerMost this) {
return Outer.this;
}
}
}
}

0 comments on commit a27781e

Please sign in to comment.