Skip to content

Commit 53d7539

Browse files
cushonPaul Hohensee
authored andcommitted
8336942: Improve test coverage for class loading elements with annotations of different retentions
Reviewed-by: phh Backport-of: e36ce5f0341e8d0ec06cb12d0b2c0aa084401021
1 parent 96100ad commit 53d7539

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
import java.lang.annotation.Annotation;
4141
import java.lang.annotation.ElementType;
4242
import java.lang.annotation.Repeatable;
43+
import java.lang.annotation.Retention;
44+
import java.lang.annotation.RetentionPolicy;
4345
import java.lang.annotation.Target;
4446
import java.util.ArrayList;
4547

@@ -405,6 +407,12 @@ R scan(Iterable<? extends TypeMirror> iter, P p) {
405407
int value();
406408
}
407409

410+
@Target(ElementType.TYPE_USE)
411+
@Retention(RetentionPolicy.RUNTIME)
412+
public @interface TD {
413+
int value();
414+
}
415+
408416
// Test cases
409417

410418
// TODO: add more cases for arrays
@@ -527,6 +535,10 @@ public class Inner6<T extends Object & Cloneable & @TA(17) Serializable> {}
527535
@Test(posn=1, annoType=TA.class, expect="23")
528536
public Set<@TA(23) ? super Object> f9;
529537

538+
@Test(posn=0, annoType=TA.class, expect="1")
539+
@Test(posn=0, annoType=TD.class, expect="2")
540+
public @TA(1) @TD(2) int f10;
541+
530542
// Test type use annotations on uses of type variables
531543
@Test(posn=5, annoType = TA.class, expect = "25")
532544
@Test(posn=5, annoType = TB.class, expect = "26")

0 commit comments

Comments
 (0)