mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
23 lines
591 B
Java
23 lines
591 B
Java
/*
|
|
* @test /nodynamiccopyright/
|
|
* @bug 8138822
|
|
* @summary test that only Java 8+ allows repeating annotations
|
|
* @compile WrongVersion.java
|
|
* @compile -Xlint:-options -source 8 WrongVersion.java
|
|
* @compile/fail/ref=WrongVersion7.out -XDrawDiagnostics -Xlint:-options -source 7 WrongVersion.java
|
|
* @compile/fail/ref=WrongVersion6.out -XDrawDiagnostics -Xlint:-options -source 6 WrongVersion.java
|
|
*/
|
|
import java.lang.annotation.Repeatable;
|
|
|
|
@Ann(1) @Ann(2)
|
|
class C {
|
|
}
|
|
|
|
@Repeatable(AnnContainer.class)
|
|
@interface Ann {
|
|
int value();
|
|
}
|
|
|
|
@interface AnnContainer {
|
|
Ann[] value();
|
|
}
|