Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8336942: Improve test coverage for class loading elements with annotations of different retentions #1037

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -40,6 +40,8 @@
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;

Expand Down Expand Up @@ -406,6 +408,12 @@ R scan(Iterable<? extends TypeMirror> iter, P p) {
int value();
}

@Target(ElementType.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
public @interface TD {
int value();
}

// Test cases

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

@Test(posn=0, annoType=TA.class, expect="1")
@Test(posn=0, annoType=TD.class, expect="2")
public @TA(1) @TD(2) int f10;

// Test type use annotations on uses of type variables
@Test(posn=6, annoType = TA.class, expect = "25")
@Test(posn=6, annoType = TB.class, expect = "26")
Expand Down