Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5270,11 +5270,15 @@ public void visitModifiers(JCModifiers tree) {

public void visitAnnotatedType(JCAnnotatedType tree) {
attribAnnotationTypes(tree.annotations, env);
Type underlyingType = attribType(tree.underlyingType, env);
Type annotatedType = underlyingType.preannotatedType();
Type underlyingType = attribTree(tree.underlyingType, env, resultInfo);
if (underlyingType.getTag() == PACKAGE) {
result = tree.type = underlyingType;
} else {
Type annotatedType = underlyingType.preannotatedType();

annotate.annotateTypeSecondStage(tree, tree.annotations, annotatedType);
result = tree.type = annotatedType;
annotate.annotateTypeSecondStage(tree, tree.annotations, annotatedType);
result = tree.type = annotatedType;
}
}

public void visitErroneous(JCErroneous tree) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* @test /nodynamiccopyright/
* @bug 8026564 8043226 8334055
* @bug 8026564 8043226 8334055 8179187
* @summary The parts of a fully-qualified type can't be annotated.
* @author Werner Dietl
* @compile/fail/ref=CantAnnotatePackages.out -XDrawDiagnostics CantAnnotatePackages.java
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CantAnnotatePackages.java:16:14: compiler.err.cant.resolve.location: kindname.class, java, , , (compiler.misc.location: kindname.class, CantAnnotatePackages, null)
CantAnnotatePackages.java:17:9: compiler.err.cant.resolve.location: kindname.class, lang, , , (compiler.misc.location: kindname.package, java, null)
CantAnnotatePackages.java:18:14: compiler.err.cant.resolve.location: kindname.class, lang, , , (compiler.misc.location: kindname.package, java, null)
CantAnnotatePackages.java:14:18: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), java.lang, @TA java.lang.Object
CantAnnotatePackages.java:16:14: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), java.lang, @TA java.lang.Object
CantAnnotatePackages.java:17:9: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), java.lang, @TA java.lang.Object
CantAnnotatePackages.java:18:14: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), java.lang, @TA java.lang.Object
4 errors
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* @test /nodynamiccopyright/
* @bug 8006733 8006775 8043226 8334055
* @bug 8006733 8006775 8043226 8334055 8179187
* @summary Ensure behavior for nested types is correct.
* @author Werner Dietl
* @compile/fail/ref=CantAnnotateScoping.out -XDrawDiagnostics CantAnnotateScoping.java
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
CantAnnotateScoping.java:63:9: compiler.err.cant.resolve.location: kindname.class, lang, , , (compiler.misc.location: kindname.package, java, null)
CantAnnotateScoping.java:68:9: compiler.err.cant.resolve.location: kindname.class, XXX, , , (compiler.misc.location: kindname.package, java, null)
CantAnnotateScoping.java:71:9: compiler.err.cant.resolve.location: kindname.class, lang, , , (compiler.misc.location: kindname.package, java, null)
CantAnnotateScoping.java:68:18: compiler.err.doesnt.exist: java.XXX
CantAnnotateScoping.java:38:14: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), Test.Outer, @TA Test.Outer.SInner
CantAnnotateScoping.java:51:18: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), java.lang, @TA java.lang.Object
CantAnnotateScoping.java:60:37: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation: @TA,@TA2), java.lang, @DTA @TA @TA2 java.lang.Object
CantAnnotateScoping.java:40:14: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), Test.Outer, @TA Test.Outer.SInner
CantAnnotateScoping.java:63:11: compiler.err.annotation.type.not.applicable.to.type: DA
CantAnnotateScoping.java:68:11: compiler.err.annotation.type.not.applicable.to.type: DA
CantAnnotateScoping.java:71:9: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), java.lang, @TA java.lang.Object
CantAnnotateScoping.java:44:34: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation: @TA,@TA2), Test.Outer, @TA @TA2 Test.Outer.SInner
CantAnnotateScoping.java:44:25: compiler.err.annotation.type.not.applicable.to.type: DA
CantAnnotateScoping.java:48:38: compiler.err.type.annotation.inadmissible: (compiler.misc.type.annotation.1: @TA), Test.Outer, @TA Test.Outer.SInner
CantAnnotateScoping.java:48:34: compiler.err.annotation.type.not.applicable.to.type: DA
11 errors
12 errors