8006119: update javac to follow latest spec for repeatable annotations
Reviewed-by: darcy
This commit is contained in:
parent
9e3a121357
commit
a2f594bf74
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -126,12 +126,12 @@ public class Annotations {
|
||||
//
|
||||
// We need to do this in two passes because when creating
|
||||
// a container for a repeating annotation we must
|
||||
// guarantee that the @ContainedBy on the
|
||||
// guarantee that the @Repeatable on the
|
||||
// contained annotation is fully annotated
|
||||
//
|
||||
// The way we force this order is to do all repeating
|
||||
// annotations in a pass after all non-repeating are
|
||||
// finished. This will work because @ContainedBy
|
||||
// finished. This will work because @Repeatable
|
||||
// is non-repeating and therefore will be annotated in the
|
||||
// fist pass.
|
||||
|
||||
@ -261,7 +261,7 @@ public class Annotations {
|
||||
// its contained annotation.
|
||||
ListBuffer<Attribute.Compound> manualContainer = ctx.annotated.get(validRepeated.type.tsym);
|
||||
if (manualContainer != null) {
|
||||
log.error(ctx.pos.get(manualContainer.first()), "invalid.containedby.annotation.repeated.and.container.present",
|
||||
log.error(ctx.pos.get(manualContainer.first()), "invalid.repeatable.annotation.repeated.and.container.present",
|
||||
manualContainer.first().type.tsym);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -161,8 +161,7 @@ public class Symtab {
|
||||
public final Type autoCloseableType;
|
||||
public final Type trustMeType;
|
||||
public final Type lambdaMetafactory;
|
||||
public final Type containedByType;
|
||||
public final Type containerForType;
|
||||
public final Type repeatableType;
|
||||
public final Type documentedType;
|
||||
public final Type elementTypeType;
|
||||
|
||||
@ -494,8 +493,7 @@ public class Symtab {
|
||||
deprecatedType = enterClass("java.lang.Deprecated");
|
||||
suppressWarningsType = enterClass("java.lang.SuppressWarnings");
|
||||
inheritedType = enterClass("java.lang.annotation.Inherited");
|
||||
containedByType = enterClass("java.lang.annotation.ContainedBy");
|
||||
containerForType = enterClass("java.lang.annotation.ContainerFor");
|
||||
repeatableType = enterClass("java.lang.annotation.Repeatable");
|
||||
documentedType = enterClass("java.lang.annotation.Documented");
|
||||
elementTypeType = enterClass("java.lang.annotation.ElementType");
|
||||
systemType = enterClass("java.lang.System");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -392,7 +392,7 @@ public class Annotate {
|
||||
List.of(p)));
|
||||
|
||||
if (!chk.annotationApplicable(annoTree, on))
|
||||
log.error(annoTree.pos(), "invalid.containedby.annotation.incompatible.target", targetContainerType, origAnnoType);
|
||||
log.error(annoTree.pos(), "invalid.repeatable.annotation.incompatible.target", targetContainerType, origAnnoType);
|
||||
|
||||
if (!chk.validateAnnotationDeferErrors(annoTree))
|
||||
log.error(annoTree.pos(), "duplicate.annotation.invalid.repeated", origAnnoType);
|
||||
@ -414,11 +414,11 @@ public class Annotate {
|
||||
Type origAnnoType = currentAnno.type;
|
||||
TypeSymbol origAnnoDecl = origAnnoType.tsym;
|
||||
|
||||
// Fetch the ContainedBy annotation from the current
|
||||
// Fetch the Repeatable annotation from the current
|
||||
// annotation's declaration, or null if it has none
|
||||
Attribute.Compound ca = origAnnoDecl.attribute(syms.containedByType.tsym);
|
||||
if (ca == null) { // has no ContainedBy annotation
|
||||
log.error(pos, "duplicate.annotation.missing.container", origAnnoType, syms.containedByType);
|
||||
Attribute.Compound ca = origAnnoDecl.attribute(syms.repeatableType.tsym);
|
||||
if (ca == null) { // has no Repeatable annotation
|
||||
log.error(pos, "duplicate.annotation.missing.container", origAnnoType, syms.repeatableType);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -440,23 +440,23 @@ public class Annotate {
|
||||
DiagnosticPosition pos,
|
||||
TypeSymbol annoDecl)
|
||||
{
|
||||
// The next three checks check that the ContainedBy annotation
|
||||
// The next three checks check that the Repeatable annotation
|
||||
// on the declaration of the annotation type that is repeating is
|
||||
// valid.
|
||||
|
||||
// ContainedBy must have at least one element
|
||||
// Repeatable must have at least one element
|
||||
if (ca.values.isEmpty()) {
|
||||
log.error(pos, "invalid.containedby.annotation", annoDecl);
|
||||
log.error(pos, "invalid.repeatable.annotation", annoDecl);
|
||||
return null;
|
||||
}
|
||||
Pair<MethodSymbol,Attribute> p = ca.values.head;
|
||||
Name name = p.fst.name;
|
||||
if (name != names.value) { // should contain only one element, named "value"
|
||||
log.error(pos, "invalid.containedby.annotation", annoDecl);
|
||||
log.error(pos, "invalid.repeatable.annotation", annoDecl);
|
||||
return null;
|
||||
}
|
||||
if (!(p.snd instanceof Attribute.Class)) { // check that the value of "value" is an Attribute.Class
|
||||
log.error(pos, "invalid.containedby.annotation", annoDecl);
|
||||
log.error(pos, "invalid.repeatable.annotation", annoDecl);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -491,13 +491,13 @@ public class Annotate {
|
||||
}
|
||||
if (error) {
|
||||
log.error(pos,
|
||||
"invalid.containedby.annotation.multiple.values",
|
||||
"invalid.repeatable.annotation.multiple.values",
|
||||
targetContainerType,
|
||||
nr_value_elems);
|
||||
return null;
|
||||
} else if (nr_value_elems == 0) {
|
||||
log.error(pos,
|
||||
"invalid.containedby.annotation.no.value",
|
||||
"invalid.repeatable.annotation.no.value",
|
||||
targetContainerType);
|
||||
return null;
|
||||
}
|
||||
@ -506,7 +506,7 @@ public class Annotate {
|
||||
// probably "impossible" to fail this
|
||||
if (containerValueSymbol.kind != Kinds.MTH) {
|
||||
log.error(pos,
|
||||
"invalid.containedby.annotation.invalid.value",
|
||||
"invalid.repeatable.annotation.invalid.value",
|
||||
targetContainerType);
|
||||
fatalError = true;
|
||||
}
|
||||
@ -518,7 +518,7 @@ public class Annotate {
|
||||
if (!(types.isArray(valueRetType) &&
|
||||
types.isSameType(expectedType, valueRetType))) {
|
||||
log.error(pos,
|
||||
"invalid.containedby.annotation.value.return",
|
||||
"invalid.repeatable.annotation.value.return",
|
||||
targetContainerType,
|
||||
valueRetType,
|
||||
expectedType);
|
||||
@ -528,10 +528,7 @@ public class Annotate {
|
||||
fatalError = true;
|
||||
}
|
||||
|
||||
// Explicitly no check for/validity of @ContainerFor. That is
|
||||
// done on declaration of the container, and at reflect time.
|
||||
|
||||
// The rest of the conditions for a valid containing annotation are made
|
||||
// The conditions for a valid containing annotation are made
|
||||
// in Check.validateRepeatedAnnotaton();
|
||||
|
||||
return fatalError ? null : containerValueSymbol;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -3844,24 +3844,14 @@ public class Attr extends JCTree.Visitor {
|
||||
log.error(tree.typarams.head.pos(),
|
||||
"intf.annotation.cant.have.type.params");
|
||||
|
||||
// If this annotation has a @ContainedBy, validate
|
||||
Attribute.Compound containedBy = c.attribute(syms.containedByType.tsym);
|
||||
if (containedBy != null) {
|
||||
// get diagnositc position for error reporting
|
||||
DiagnosticPosition cbPos = getDiagnosticPosition(tree, containedBy.type);
|
||||
// If this annotation has a @Repeatable, validate
|
||||
Attribute.Compound repeatable = c.attribute(syms.repeatableType.tsym);
|
||||
if (repeatable != null) {
|
||||
// get diagnostic position for error reporting
|
||||
DiagnosticPosition cbPos = getDiagnosticPosition(tree, repeatable.type);
|
||||
Assert.checkNonNull(cbPos);
|
||||
|
||||
chk.validateContainedBy(c, containedBy, cbPos);
|
||||
}
|
||||
|
||||
// If this annotation has a @ContainerFor, validate
|
||||
Attribute.Compound containerFor = c.attribute(syms.containerForType.tsym);
|
||||
if (containerFor != null) {
|
||||
// get diagnositc position for error reporting
|
||||
DiagnosticPosition cfPos = getDiagnosticPosition(tree, containerFor.type);
|
||||
Assert.checkNonNull(cfPos);
|
||||
|
||||
chk.validateContainerFor(c, containerFor, cfPos);
|
||||
chk.validateRepeatable(c, repeatable, cbPos);
|
||||
}
|
||||
} else {
|
||||
// Check that all extended classes and interfaces
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -2592,30 +2592,30 @@ public class Check {
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the proposed container 'containedBy' on the
|
||||
* Validate the proposed container 'repeatable' on the
|
||||
* annotation type symbol 's'. Report errors at position
|
||||
* 'pos'.
|
||||
*
|
||||
* @param s The (annotation)type declaration annotated with a @ContainedBy
|
||||
* @param containedBy the @ContainedBy on 's'
|
||||
* @param s The (annotation)type declaration annotated with a @Repeatable
|
||||
* @param repeatable the @Repeatable on 's'
|
||||
* @param pos where to report errors
|
||||
*/
|
||||
public void validateContainedBy(TypeSymbol s, Attribute.Compound containedBy, DiagnosticPosition pos) {
|
||||
Assert.check(types.isSameType(containedBy.type, syms.containedByType));
|
||||
public void validateRepeatable(TypeSymbol s, Attribute.Compound repeatable, DiagnosticPosition pos) {
|
||||
Assert.check(types.isSameType(repeatable.type, syms.repeatableType));
|
||||
|
||||
Type t = null;
|
||||
List<Pair<MethodSymbol,Attribute>> l = containedBy.values;
|
||||
List<Pair<MethodSymbol,Attribute>> l = repeatable.values;
|
||||
if (!l.isEmpty()) {
|
||||
Assert.check(l.head.fst.name == names.value);
|
||||
t = ((Attribute.Class)l.head.snd).getValue();
|
||||
}
|
||||
|
||||
if (t == null) {
|
||||
log.error(pos, "invalid.container.wrong.containedby", s, containedBy);
|
||||
// errors should already have been reported during Annotate
|
||||
return;
|
||||
}
|
||||
|
||||
validateHasContainerFor(t.tsym, s, pos);
|
||||
validateValue(t.tsym, s, pos);
|
||||
validateRetention(t.tsym, s, pos);
|
||||
validateDocumented(t.tsym, s, pos);
|
||||
validateInherited(t.tsym, s, pos);
|
||||
@ -2623,79 +2623,18 @@ public class Check {
|
||||
validateDefault(t.tsym, s, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the proposed container 'containerFor' on the
|
||||
* annotation type symbol 's'. Report errors at position
|
||||
* 'pos'.
|
||||
*
|
||||
* @param s The (annotation)type declaration annotated with a @ContainerFor
|
||||
* @param containerFor the @ContainedFor on 's'
|
||||
* @param pos where to report errors
|
||||
*/
|
||||
public void validateContainerFor(TypeSymbol s, Attribute.Compound containerFor, DiagnosticPosition pos) {
|
||||
Assert.check(types.isSameType(containerFor.type, syms.containerForType));
|
||||
|
||||
Type t = null;
|
||||
List<Pair<MethodSymbol,Attribute>> l = containerFor.values;
|
||||
if (!l.isEmpty()) {
|
||||
Assert.check(l.head.fst.name == names.value);
|
||||
t = ((Attribute.Class)l.head.snd).getValue();
|
||||
private void validateValue(TypeSymbol container, TypeSymbol contained, DiagnosticPosition pos) {
|
||||
Scope.Entry e = container.members().lookup(names.value);
|
||||
if (e.scope != null && e.sym.kind == MTH) {
|
||||
MethodSymbol m = (MethodSymbol) e.sym;
|
||||
Type ret = m.getReturnType();
|
||||
if (!(ret.hasTag(ARRAY) && types.isSameType(((ArrayType)ret).elemtype, contained.type))) {
|
||||
log.error(pos, "invalid.repeatable.annotation.value.return",
|
||||
container, ret, types.makeArrayType(contained.type));
|
||||
}
|
||||
} else {
|
||||
log.error(pos, "invalid.repeatable.annotation.no.value", container);
|
||||
}
|
||||
|
||||
if (t == null) {
|
||||
log.error(pos, "invalid.container.wrong.containerfor", s, containerFor);
|
||||
return;
|
||||
}
|
||||
|
||||
validateHasContainedBy(t.tsym, s, pos);
|
||||
}
|
||||
|
||||
private void validateHasContainedBy(TypeSymbol container, TypeSymbol contained, DiagnosticPosition pos) {
|
||||
Attribute.Compound containedBy = container.attribute(syms.containedByType.tsym);
|
||||
|
||||
if (containedBy == null) {
|
||||
log.error(pos, "invalid.container.no.containedby", container, syms.containedByType.tsym);
|
||||
return;
|
||||
}
|
||||
|
||||
Type t = null;
|
||||
List<Pair<MethodSymbol,Attribute>> l = containedBy.values;
|
||||
if (!l.isEmpty()) {
|
||||
Assert.check(l.head.fst.name == names.value);
|
||||
t = ((Attribute.Class)l.head.snd).getValue();
|
||||
}
|
||||
|
||||
if (t == null) {
|
||||
log.error(pos, "invalid.container.wrong.containedby", container, contained);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!types.isSameType(t, contained.type))
|
||||
log.error(pos, "invalid.container.wrong.containedby", t.tsym, contained);
|
||||
}
|
||||
|
||||
private void validateHasContainerFor(TypeSymbol container, TypeSymbol contained, DiagnosticPosition pos) {
|
||||
Attribute.Compound containerFor = container.attribute(syms.containerForType.tsym);
|
||||
|
||||
if (containerFor == null) {
|
||||
log.error(pos, "invalid.container.no.containerfor", container, syms.containerForType.tsym);
|
||||
return;
|
||||
}
|
||||
|
||||
Type t = null;
|
||||
List<Pair<MethodSymbol,Attribute>> l = containerFor.values;
|
||||
if (!l.isEmpty()) {
|
||||
Assert.check(l.head.fst.name == names.value);
|
||||
t = ((Attribute.Class)l.head.snd).getValue();
|
||||
}
|
||||
|
||||
if (t == null) {
|
||||
log.error(pos, "invalid.container.wrong.containerfor", container, contained);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!types.isSameType(t, contained.type))
|
||||
log.error(pos, "invalid.container.wrong.containerfor", t.tsym, contained);
|
||||
}
|
||||
|
||||
private void validateRetention(Symbol container, Symbol contained, DiagnosticPosition pos) {
|
||||
@ -2715,7 +2654,7 @@ public class Check {
|
||||
}
|
||||
}
|
||||
if (error ) {
|
||||
log.error(pos, "invalid.containedby.annotation.retention",
|
||||
log.error(pos, "invalid.repeatable.annotation.retention",
|
||||
container, containerRetention,
|
||||
contained, containedRetention);
|
||||
}
|
||||
@ -2724,7 +2663,7 @@ public class Check {
|
||||
private void validateDocumented(Symbol container, Symbol contained, DiagnosticPosition pos) {
|
||||
if (contained.attribute(syms.documentedType.tsym) != null) {
|
||||
if (container.attribute(syms.documentedType.tsym) == null) {
|
||||
log.error(pos, "invalid.containedby.annotation.not.documented", container, contained);
|
||||
log.error(pos, "invalid.repeatable.annotation.not.documented", container, contained);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2732,7 +2671,7 @@ public class Check {
|
||||
private void validateInherited(Symbol container, Symbol contained, DiagnosticPosition pos) {
|
||||
if (contained.attribute(syms.inheritedType.tsym) != null) {
|
||||
if (container.attribute(syms.inheritedType.tsym) == null) {
|
||||
log.error(pos, "invalid.containedby.annotation.not.inherited", container, contained);
|
||||
log.error(pos, "invalid.repeatable.annotation.not.inherited", container, contained);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2752,7 +2691,7 @@ public class Check {
|
||||
// contained has target, but container has not, error
|
||||
Attribute.Array containerTarget = getAttributeTargetAttribute(container);
|
||||
if (containerTarget == null) {
|
||||
log.error(pos, "invalid.containedby.annotation.incompatible.target", container, contained);
|
||||
log.error(pos, "invalid.repeatable.annotation.incompatible.target", container, contained);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2775,7 +2714,7 @@ public class Check {
|
||||
}
|
||||
|
||||
if (!isTargetSubset(containedTargets, containerTargets)) {
|
||||
log.error(pos, "invalid.containedby.annotation.incompatible.target", container, contained);
|
||||
log.error(pos, "invalid.repeatable.annotation.incompatible.target", container, contained);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2809,7 +2748,7 @@ public class Check {
|
||||
elm.kind == Kinds.MTH &&
|
||||
((MethodSymbol)elm).defaultValue == null) {
|
||||
log.error(pos,
|
||||
"invalid.containedby.annotation.elem.nondefault",
|
||||
"invalid.repeatable.annotation.elem.nondefault",
|
||||
container,
|
||||
elm);
|
||||
}
|
||||
|
@ -261,13 +261,13 @@ public class JavacElements implements Elements {
|
||||
}
|
||||
|
||||
// Needed to unpack the runtime view of containing annotations
|
||||
private static final Class<? extends Annotation> CONTAINED_BY_CLASS = initContainedBy();
|
||||
private static final Class<? extends Annotation> REPEATABLE_CLASS = initRepeatable();
|
||||
private static final Method VALUE_ELEMENT_METHOD = initValueElementMethod();
|
||||
|
||||
private static Class<? extends Annotation> initContainedBy() {
|
||||
private static Class<? extends Annotation> initRepeatable() {
|
||||
try {
|
||||
@SuppressWarnings("unchecked") // java.lang.annotation.ContainedBy extends Annotation by being an annotation type
|
||||
Class<? extends Annotation> c = (Class)Class.forName("java.lang.annotation.ContainedBy");
|
||||
@SuppressWarnings("unchecked") // java.lang.annotation.Repeatable extends Annotation by being an annotation type
|
||||
Class<? extends Annotation> c = (Class)Class.forName("java.lang.annotation.Repeatable");
|
||||
return c;
|
||||
} catch (ClassNotFoundException e) {
|
||||
return null;
|
||||
@ -276,12 +276,12 @@ public class JavacElements implements Elements {
|
||||
}
|
||||
}
|
||||
private static Method initValueElementMethod() {
|
||||
if (CONTAINED_BY_CLASS == null)
|
||||
if (REPEATABLE_CLASS == null)
|
||||
return null;
|
||||
|
||||
Method m = null;
|
||||
try {
|
||||
m = CONTAINED_BY_CLASS.getMethod("value");
|
||||
m = REPEATABLE_CLASS.getMethod("value");
|
||||
if (m != null)
|
||||
m.setAccessible(true);
|
||||
return m;
|
||||
@ -292,19 +292,19 @@ public class JavacElements implements Elements {
|
||||
|
||||
// Helper to getAnnotations
|
||||
private static Class<? extends Annotation> getContainer(Class<? extends Annotation> annoType) {
|
||||
// Since we can not refer to java.lang.annotation.ContainedBy until we are
|
||||
// bootstrapping with java 8 we need to get the ContainedBy annotation using
|
||||
// Since we can not refer to java.lang.annotation.Repeatable until we are
|
||||
// bootstrapping with java 8 we need to get the Repeatable annotation using
|
||||
// reflective invocations instead of just using its type and element method.
|
||||
if (CONTAINED_BY_CLASS != null &&
|
||||
if (REPEATABLE_CLASS != null &&
|
||||
VALUE_ELEMENT_METHOD != null) {
|
||||
// Get the ContainedBy instance on the annotations declaration
|
||||
Annotation containedBy = (Annotation)annoType.getAnnotation(CONTAINED_BY_CLASS);
|
||||
if (containedBy != null) {
|
||||
// Get the Repeatable instance on the annotations declaration
|
||||
Annotation repeatable = (Annotation)annoType.getAnnotation(REPEATABLE_CLASS);
|
||||
if (repeatable != null) {
|
||||
try {
|
||||
// Get the value element, it should be a class
|
||||
// indicating the containing annotation type
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends Annotation> containerType = (Class)VALUE_ELEMENT_METHOD.invoke(containedBy);
|
||||
Class<? extends Annotation> containerType = (Class)VALUE_ELEMENT_METHOD.invoke(repeatable);
|
||||
if (containerType == null)
|
||||
return null;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -319,64 +319,48 @@ compiler.err.duplicate.annotation.member.value=\
|
||||
compiler.err.duplicate.annotation.missing.container=\
|
||||
duplicate annotation, the declaration of {0} does not have a valid {1} annotation
|
||||
|
||||
# 0: type, 1: type
|
||||
compiler.err.invalid.container.no.containedby=\
|
||||
invalid contained repeatable annotation, {0} is not annotated with {1}
|
||||
|
||||
# 0: type, 1: type
|
||||
compiler.err.invalid.container.wrong.containedby=\
|
||||
invalid contained repeatable annotation, {0} does not match {1}
|
||||
|
||||
# 0: type, 1: type
|
||||
compiler.err.invalid.container.no.containerfor=\
|
||||
invalid container for repeating annotations, {0} is not annotated with {1}
|
||||
|
||||
# 0: type, 1: type
|
||||
compiler.err.invalid.container.wrong.containerfor=\
|
||||
invalid container for repeating annotations, {0} does not match {1}
|
||||
# 0: type
|
||||
compiler.err.invalid.repeatable.annotation=\
|
||||
duplicate annotation, {0} is annotated with an invalid Repeatable annotation
|
||||
|
||||
# 0: type
|
||||
compiler.err.invalid.containedby.annotation=\
|
||||
duplicate annotation, {0} is annotated with an invalid ContainedBy annotation
|
||||
|
||||
# 0: type
|
||||
compiler.err.invalid.containedby.annotation.no.value=\
|
||||
duplicate annotation, {0} is not a valid ContainedBy, no value element method declared
|
||||
compiler.err.invalid.repeatable.annotation.no.value=\
|
||||
duplicate annotation, {0} is not a valid Repeatable, no value element method declared
|
||||
|
||||
# 0: type, 1: number
|
||||
compiler.err.invalid.containedby.annotation.multiple.values=\
|
||||
duplicate annotation, {0} is not a valid ContainedBy, {1} value element methods declared
|
||||
compiler.err.invalid.repeatable.annotation.multiple.values=\
|
||||
duplicate annotation, {0} is not a valid Repeatable, {1} value element methods declared
|
||||
|
||||
# 0: type
|
||||
compiler.err.invalid.containedby.annotation.invalid.value=\
|
||||
duplicate annotation, {0} is not a valid ContainedBy, invalid value element, need a method
|
||||
compiler.err.invalid.repeatable.annotation.invalid.value=\
|
||||
duplicate annotation, {0} is not a valid Repeatable, invalid value element, need a method
|
||||
|
||||
# 0: type, 1: type, 2: type
|
||||
compiler.err.invalid.containedby.annotation.value.return=\
|
||||
compiler.err.invalid.repeatable.annotation.value.return=\
|
||||
duplicate annotation, value element of containing annotation {0} should have type {2}, found {1}
|
||||
|
||||
# 0: type, 1: symbol
|
||||
compiler.err.invalid.containedby.annotation.elem.nondefault=\
|
||||
compiler.err.invalid.repeatable.annotation.elem.nondefault=\
|
||||
containing annotation {0} does not have a default value for element {1}
|
||||
|
||||
# 0: symbol, 1: type, 2: symbol, 3: type
|
||||
compiler.err.invalid.containedby.annotation.retention=\
|
||||
compiler.err.invalid.repeatable.annotation.retention=\
|
||||
containing annotation {0} has shorter retention ({1}) than the contained annotation {2} with retention {3}
|
||||
|
||||
# 0: symbol, 1: symbol
|
||||
compiler.err.invalid.containedby.annotation.not.documented=\
|
||||
compiler.err.invalid.repeatable.annotation.not.documented=\
|
||||
containing annotation type, {0}, is not @Documented while repeated annotation type, {1}, is
|
||||
|
||||
# 0: symbol, 1: symbol
|
||||
compiler.err.invalid.containedby.annotation.not.inherited=\
|
||||
compiler.err.invalid.repeatable.annotation.not.inherited=\
|
||||
containing annotation type, {0}, is not @Inherited while repeated annotation type, {1}, is
|
||||
|
||||
# 0: symbol, 1: symbol
|
||||
compiler.err.invalid.containedby.annotation.incompatible.target=\
|
||||
compiler.err.invalid.repeatable.annotation.incompatible.target=\
|
||||
target of container annotation {0} is not a subset of target of repeated annotation {1}
|
||||
|
||||
# 0: symbol
|
||||
compiler.err.invalid.containedby.annotation.repeated.and.container.present=\
|
||||
compiler.err.invalid.repeatable.annotation.repeated.and.container.present=\
|
||||
container {0} must not be present at the same time as the element it contains
|
||||
|
||||
# 0: name
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,6 +32,6 @@ import java.lang.annotation.*;
|
||||
* @author Bhavesh Patel
|
||||
*/
|
||||
@Documented
|
||||
@ContainedBy(ContainerSynthDoc.class)
|
||||
@Repeatable(ContainerSynthDoc.class)
|
||||
public @interface ContaineeSynthDoc {
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,7 +32,6 @@ import java.lang.annotation.*;
|
||||
* @author Bhavesh Patel
|
||||
*/
|
||||
@Documented
|
||||
@ContainerFor(ContaineeSynthDoc.class)
|
||||
public @interface ContainerSynthDoc {
|
||||
|
||||
ContaineeSynthDoc[] value();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,6 +32,6 @@ import java.lang.annotation.*;
|
||||
* @author Bhavesh Patel
|
||||
*/
|
||||
@Documented
|
||||
@ContainedBy(ContainerSynthNotDoc.class)
|
||||
@Repeatable(ContainerSynthNotDoc.class)
|
||||
public @interface ContaineeSynthDoc {
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,7 +31,6 @@ import java.lang.annotation.*;
|
||||
*
|
||||
* @author Bhavesh Patel
|
||||
*/
|
||||
@ContainerFor(ContaineeSynthDoc.class)
|
||||
public @interface ContainerSynthNotDoc {
|
||||
|
||||
ContaineeSynthDoc[] value();
|
||||
|
@ -6,11 +6,9 @@
|
||||
* @compile/fail/ref=BaseAnnoAsContainerAnno.out -XDrawDiagnostics BaseAnnoAsContainerAnno.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(Foo.class)
|
||||
@ContainerFor(Foo.class)
|
||||
@Repeatable(Foo.class)
|
||||
@interface Foo {
|
||||
Foo[] value() default {};
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
BaseAnnoAsContainerAnno.java:15:11: compiler.err.cyclic.annotation.element
|
||||
BaseAnnoAsContainerAnno.java:13:11: compiler.err.cyclic.annotation.element
|
||||
1 error
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,10 +34,9 @@
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@ContainedBy(Foos.class)
|
||||
@Repeatable(Foos.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface Foos {
|
||||
Foo[] value();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,32 +32,29 @@
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
@Repeatable(Foos.class)
|
||||
@Target(ElementType.TYPE)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
@interface Foos {
|
||||
Foo[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(Bars.class)
|
||||
@Repeatable(Bars.class)
|
||||
@Target(ElementType.TYPE)
|
||||
@interface Bar {}
|
||||
|
||||
@ContainerFor(Bar.class)
|
||||
@Target({ ElementType.ANNOTATION_TYPE, ElementType.TYPE })
|
||||
@interface Bars {
|
||||
Bar[] value();
|
||||
}
|
||||
|
||||
|
||||
@ContainedBy(Bazs.class)
|
||||
@Repeatable(Bazs.class)
|
||||
@Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
|
||||
@interface Baz {}
|
||||
|
||||
@ContainerFor(Baz.class)
|
||||
@Target({ ElementType.ANNOTATION_TYPE, ElementType.TYPE })
|
||||
@interface Bazs {
|
||||
Baz[] value();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,17 +30,15 @@
|
||||
* @compile ClassReaderDefault.java
|
||||
* @compile SeparateCompile.java
|
||||
*/
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
public class ClassReaderDefault {
|
||||
}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer {
|
||||
Foo[] value();
|
||||
int f() default 0;
|
||||
}
|
||||
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,15 +30,13 @@
|
||||
* @run compile ContainerHasRepeatedContained.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(BarContainer.class)
|
||||
@Repeatable(BarContainer.class)
|
||||
@interface Bar {}
|
||||
|
||||
@Bar
|
||||
@Bar
|
||||
@ContainerFor(Bar.class)
|
||||
@interface BarContainer {
|
||||
Bar[] value();
|
||||
}
|
||||
|
@ -6,17 +6,14 @@
|
||||
* @compile/fail/ref=CyclicAnnotation.out -XDrawDiagnostics CyclicAnnotation.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(Foo.class)
|
||||
@ContainerFor(Baz.class)
|
||||
@Repeatable(Foo.class)
|
||||
@interface Baz {
|
||||
Foo[] value() default {};
|
||||
}
|
||||
|
||||
@ContainedBy(Baz.class)
|
||||
@ContainerFor(Foo.class)
|
||||
@Repeatable(Baz.class)
|
||||
@interface Foo{
|
||||
Baz[] value() default {};
|
||||
}
|
||||
|
@ -1,6 +1,2 @@
|
||||
CyclicAnnotation.java:12:1: compiler.err.invalid.container.wrong.containerfor: Foo, Baz
|
||||
CyclicAnnotation.java:13:1: compiler.err.invalid.container.wrong.containedby: Foo, Baz
|
||||
CyclicAnnotation.java:15:11: compiler.err.cyclic.annotation.element
|
||||
CyclicAnnotation.java:18:1: compiler.err.invalid.container.wrong.containerfor: Baz, Foo
|
||||
CyclicAnnotation.java:19:1: compiler.err.invalid.container.wrong.containedby: Baz, Foo
|
||||
5 errors
|
||||
CyclicAnnotation.java:13:11: compiler.err.cyclic.annotation.element
|
||||
1 error
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,13 +29,11 @@
|
||||
* @compile DefaultCasePresent.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer {
|
||||
Foo[] value();
|
||||
String other() default "other-method";
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,12 +39,11 @@ public class DelayRepeatedContainer {
|
||||
|
||||
@Bar("katt")
|
||||
@Bar("lol")
|
||||
@ContainedBy(BarContainer.class)
|
||||
@Repeatable(BarContainer.class)
|
||||
@interface Bar {
|
||||
String value();
|
||||
}
|
||||
|
||||
@ContainerFor(Bar.class)
|
||||
@interface BarContainer {
|
||||
Bar[] value();
|
||||
}
|
||||
|
@ -6,15 +6,13 @@
|
||||
* @compile/fail/ref=DocumentedContainerAnno.out -XDrawDiagnostics DocumentedContainerAnno.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Documented;
|
||||
|
||||
@Documented
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer{
|
||||
Foo[] value();
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
DocumentedContainerAnno.java:14:1: compiler.err.invalid.containedby.annotation.not.documented: FooContainer, Foo
|
||||
DocumentedContainerAnno.java:13:1: compiler.err.invalid.repeatable.annotation.not.documented: FooContainer, Foo
|
||||
1 error
|
||||
|
@ -6,15 +6,13 @@
|
||||
* @compile/fail/ref=InheritedContainerAnno.out -XDrawDiagnostics InheritedContainerAnno.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Inherited;
|
||||
|
||||
@Inherited
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer{
|
||||
Foo[] value();
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
InheritedContainerAnno.java:14:1: compiler.err.invalid.containedby.annotation.not.inherited: FooContainer, Foo
|
||||
InheritedContainerAnno.java:13:1: compiler.err.invalid.repeatable.annotation.not.inherited: FooContainer, Foo
|
||||
1 error
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,11 +32,10 @@
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
@Repeatable(Foos.class)
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@Target(ElementType.TYPE)
|
||||
@interface Foos {
|
||||
Foo[] value();
|
||||
|
@ -6,13 +6,11 @@
|
||||
* @compile/fail/ref=MissingContainer.out -XDrawDiagnostics MissingContainer.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy()
|
||||
@Repeatable()
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer {
|
||||
Foo[] value();
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
MissingContainer.java:20:1: compiler.err.invalid.containedby.annotation: Foo
|
||||
MissingContainer.java:20:6: compiler.err.invalid.containedby.annotation: Foo
|
||||
MissingContainer.java:12:1: compiler.err.annotation.missing.default.value: java.lang.annotation.ContainedBy, value
|
||||
MissingContainer.java:15:1: compiler.err.invalid.container.wrong.containedby: Foo, FooContainer
|
||||
4 errors
|
||||
MissingContainer.java:18:1: compiler.err.invalid.repeatable.annotation: Foo
|
||||
MissingContainer.java:18:6: compiler.err.invalid.repeatable.annotation: Foo
|
||||
MissingContainer.java:11:1: compiler.err.annotation.missing.default.value: java.lang.annotation.Repeatable, value
|
||||
3 errors
|
||||
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @summary Smoke test for repeating annotations
|
||||
* @compile/fail MissingContainerFor.java
|
||||
* @bug 7151010
|
||||
*/
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@interface Foos {
|
||||
MissingContainerFor[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
public @interface MissingContainerFor {}
|
@ -6,13 +6,11 @@
|
||||
* @compile/fail/ref=MissingDefaultCase1.out -XDrawDiagnostics MissingDefaultCase1.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer {
|
||||
Foo[] value();
|
||||
String other(); // missing default clause
|
||||
|
@ -1,3 +1,3 @@
|
||||
MissingDefaultCase1.java:21:1: compiler.err.duplicate.annotation.invalid.repeated: Foo
|
||||
MissingDefaultCase1.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
|
||||
MissingDefaultCase1.java:19:1: compiler.err.duplicate.annotation.invalid.repeated: Foo
|
||||
MissingDefaultCase1.java:11:1: compiler.err.invalid.repeatable.annotation.elem.nondefault: FooContainer, other()
|
||||
2 errors
|
||||
|
@ -6,13 +6,11 @@
|
||||
* @compile/fail/ref=MissingDefaultCase2.out -XDrawDiagnostics MissingDefaultCase2.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer {
|
||||
Foo[] value();
|
||||
Foo other(); // missing default clause and return type is an annotation
|
||||
|
@ -1,3 +1,3 @@
|
||||
MissingDefaultCase2.java:21:1: compiler.err.duplicate.annotation.invalid.repeated: Foo
|
||||
MissingDefaultCase2.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
|
||||
MissingDefaultCase2.java:19:1: compiler.err.duplicate.annotation.invalid.repeated: Foo
|
||||
MissingDefaultCase2.java:11:1: compiler.err.invalid.repeatable.annotation.elem.nondefault: FooContainer, other()
|
||||
2 errors
|
||||
|
@ -6,13 +6,11 @@
|
||||
* @compile/fail/ref=MissingValueMethod.out -XDrawDiagnostics MissingValueMethod.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer{
|
||||
Foo[] values(); // wrong method name
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
MissingValueMethod.java:20:1: compiler.err.invalid.containedby.annotation.no.value: FooContainer
|
||||
MissingValueMethod.java:20:6: compiler.err.invalid.containedby.annotation.no.value: FooContainer
|
||||
MissingValueMethod.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, values()
|
||||
MissingValueMethod.java:18:1: compiler.err.invalid.repeatable.annotation.no.value: FooContainer
|
||||
MissingValueMethod.java:18:6: compiler.err.invalid.repeatable.annotation.no.value: FooContainer
|
||||
MissingValueMethod.java:11:1: compiler.err.invalid.repeatable.annotation.no.value: FooContainer
|
||||
3 errors
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,19 +29,16 @@
|
||||
* @compile MultiLevelRepeatableAnno.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainedBy(FooContainerContainer.class)
|
||||
@ContainerFor(Foo.class)
|
||||
@Repeatable(FooContainerContainer.class)
|
||||
@interface FooContainer {
|
||||
Foo[] value();
|
||||
}
|
||||
|
||||
@ContainerFor(FooContainer.class)
|
||||
@interface FooContainerContainer {
|
||||
FooContainer[] value();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,25 +29,22 @@
|
||||
* @compile MultipleAnnoMixedOrder.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {
|
||||
int getNumbers();
|
||||
}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer {
|
||||
Foo[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(BazContainer.class)
|
||||
@Repeatable(BazContainer.class)
|
||||
@interface Baz {
|
||||
String getStr();
|
||||
}
|
||||
|
||||
@ContainerFor(Baz.class)
|
||||
@interface BazContainer {
|
||||
Baz[] value();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,17 +34,15 @@
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@ContainedBy(Foos.class)
|
||||
@Repeatable(Foos.class)
|
||||
@interface Foo {}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@ContainedBy(FoosFoos.class)
|
||||
@ContainerFor(Foo.class)
|
||||
@Repeatable(FoosFoos.class)
|
||||
@interface Foos {
|
||||
Foo[] value();
|
||||
}
|
||||
|
||||
@ContainerFor(Foos.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface FoosFoos {
|
||||
Foos[] value();
|
||||
|
@ -1,3 +1,3 @@
|
||||
NoRepeatableAnno.java:11:1: compiler.err.duplicate.annotation.missing.container: Foo, java.lang.annotation.ContainedBy
|
||||
NoRepeatableAnno.java:11:6: compiler.err.duplicate.annotation.missing.container: Foo, java.lang.annotation.ContainedBy
|
||||
NoRepeatableAnno.java:11:1: compiler.err.duplicate.annotation.missing.container: Foo, java.lang.annotation.Repeatable
|
||||
NoRepeatableAnno.java:11:6: compiler.err.duplicate.annotation.missing.container: Foo, java.lang.annotation.Repeatable
|
||||
2 errors
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,20 +30,18 @@
|
||||
* @run compile RepMemberAnno.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
public class RepMemberAnno {
|
||||
@Bar("Apa") @Bar("Banan")
|
||||
public void meh() {}
|
||||
}
|
||||
|
||||
@ContainedBy(BarContainer.class)
|
||||
@Repeatable(BarContainer.class)
|
||||
@interface Bar {
|
||||
String value();
|
||||
}
|
||||
|
||||
@ContainerFor(Bar.class)
|
||||
@interface BarContainer {
|
||||
Bar[] value();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,21 +34,19 @@ import java.lang.annotation.*;
|
||||
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@ContainedBy(BarContainer.class)
|
||||
@Repeatable(BarContainer.class)
|
||||
public @interface RepSelfMemberAnno {
|
||||
@RepSelfMemberAnno @RepSelfMemberAnno
|
||||
String meh() default "banan";
|
||||
}
|
||||
|
||||
|
||||
@ContainedBy(BarContainerContainer.class)
|
||||
@Repeatable(BarContainerContainer.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@ContainerFor(RepSelfMemberAnno.class)
|
||||
@interface BarContainer {
|
||||
RepSelfMemberAnno[] value();
|
||||
}
|
||||
|
||||
@ContainerFor(BarContainer.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface BarContainerContainer {
|
||||
BarContainer[] value();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
@Repeatable(Foos.class)
|
||||
@interface Foo {}
|
||||
|
||||
@interface Foos {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,10 +31,9 @@
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
@Repeatable(Foos.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
@interface Foos {
|
||||
Foo[] value();
|
||||
|
@ -1,2 +1,2 @@
|
||||
RepeatingTargetNotAllowed.java:44:5: compiler.err.invalid.containedby.annotation.incompatible.target: Foos, Foo
|
||||
RepeatingTargetNotAllowed.java:43:5: compiler.err.invalid.repeatable.annotation.incompatible.target: Foos, Foo
|
||||
1 error
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,7 +33,6 @@
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainerFor(SelfRepeatingAnno.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface Foos {
|
||||
SelfRepeatingAnno[] value();
|
||||
@ -42,7 +41,7 @@ import java.lang.annotation.*;
|
||||
@SelfRepeatingAnno
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@SelfRepeatingAnno
|
||||
@ContainedBy(Foos.class)
|
||||
@Repeatable(Foos.class)
|
||||
@interface SelfRepeatingAnno {}
|
||||
|
||||
public class SelfRepeatingAnnotations {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,10 +30,9 @@
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
@Repeatable(Foos.class)
|
||||
@interface Foo {}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface Foos {
|
||||
Foo[] value();
|
||||
}
|
||||
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @summary Smoke test for repeating annotations
|
||||
* @compile/fail UseWrongContainedBy.java
|
||||
* @bug 7151010
|
||||
*/
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainerFor(UseWrongContainedBy.class)
|
||||
@interface Foos {
|
||||
UseWrongContainedBy[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(Target.class)
|
||||
public @interface UseWrongContainedBy {}
|
||||
|
||||
@UseWrongContainedBy @UseWrongContainedBy
|
||||
@interface Foo {}
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @summary Smoke test for repeating annotations
|
||||
* @compile/fail UseWrongContainerFor.java
|
||||
* @bug 7151010
|
||||
*/
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainerFor(Retention.class)
|
||||
@interface Foos {
|
||||
UseWrongContainerFor[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
public @interface UseWrongContainerFor {}
|
||||
|
||||
@UseWrongContainerFor @UseWrongContainerFor
|
||||
@interface Foo {}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -24,16 +24,18 @@
|
||||
/**
|
||||
* @test
|
||||
* @summary Smoke test for repeating annotations
|
||||
* @compile/fail MissingContainedBy.java
|
||||
* @compile/fail UseWrongRepeatable.java
|
||||
* @bug 7151010
|
||||
*/
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
||||
@ContainerFor(MissingContainedBy.class)
|
||||
@interface Foos {
|
||||
MissingContainedBy[] value();
|
||||
UseWrongRepeatable[] value();
|
||||
}
|
||||
|
||||
public @interface MissingContainedBy {}
|
||||
@Repeatable(Target.class)
|
||||
public @interface UseWrongRepeatable {}
|
||||
|
||||
@UseWrongRepeatable @UseWrongRepeatable
|
||||
@interface Foo {}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @summary Smoke test for repeating annotations
|
||||
* @compile/fail WrongContainedBy.java
|
||||
* @bug 7151010
|
||||
*/
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainerFor(WrongContainedBy.class)
|
||||
@interface Foos {
|
||||
WrongContainedBy[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(Target.class)
|
||||
public @interface WrongContainedBy {}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @summary Smoke test for repeating annotations
|
||||
* @compile/fail WrongContainerFor.java
|
||||
* @bug 7151010
|
||||
*/
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainerFor(Retention.class)
|
||||
@interface Foos {
|
||||
WrongContainerFor[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
public @interface WrongContainerFor {}
|
@ -6,15 +6,13 @@
|
||||
* @compile/fail/ref=WrongReturnTypeForValue.out -XDrawDiagnostics WrongReturnTypeForValue.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ContainedBy;
|
||||
import java.lang.annotation.ContainerFor;
|
||||
import java.lang.annotation.Repeatable;
|
||||
|
||||
@ContainedBy(FooContainer.class)
|
||||
@Repeatable(FooContainer.class)
|
||||
@interface Foo {
|
||||
int getNumbers();
|
||||
}
|
||||
|
||||
@ContainerFor(Foo.class)
|
||||
@interface FooContainer{
|
||||
Foo value(); // wrong return type
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
WrongReturnTypeForValue.java:22:1: compiler.err.invalid.containedby.annotation.value.return: FooContainer, Foo, Foo[]
|
||||
WrongReturnTypeForValue.java:22:6: compiler.err.invalid.containedby.annotation.value.return: FooContainer, Foo, Foo[]
|
||||
2 errors
|
||||
WrongReturnTypeForValue.java:20:1: compiler.err.invalid.repeatable.annotation.value.return: FooContainer, Foo, Foo[]
|
||||
WrongReturnTypeForValue.java:20:6: compiler.err.invalid.repeatable.annotation.value.return: FooContainer, Foo, Foo[]
|
||||
WrongReturnTypeForValue.java:11:1: compiler.err.invalid.repeatable.annotation.value.return: FooContainer, Foo, Foo[]
|
||||
3 errors
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -163,9 +163,8 @@ public class BasicSyntaxCombo extends Helper{
|
||||
String replaceStr = "/*"+type+"*/";
|
||||
StringBuilder annoData = new StringBuilder();
|
||||
annoData.append(Helper.ContentVars.IMPORTCONTAINERSTMTS.getVal())
|
||||
.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
|
||||
JavaFileObject pkgInfoFile = null;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -115,24 +115,21 @@ public class DeprecatedAnnoCombo extends Helper {
|
||||
switch(className) {
|
||||
case "DeprecatedonBoth":
|
||||
annoData.append(Helper.ContentVars.DEPRECATED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.DEPRECATED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
break;
|
||||
case "DeprecatedonBase":
|
||||
annoData.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
annoData.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.DEPRECATED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
break;
|
||||
case "DeprecatedonContainer":
|
||||
annoData.append(Helper.ContentVars.DEPRECATED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
break;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -93,17 +93,15 @@ public class DocumentedAnnoCombo extends Helper {
|
||||
switch(className) {
|
||||
case "DocumentedonBothAnno":
|
||||
annoData.append(Helper.ContentVars.DOCUMENTED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.DOCUMENTED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
break;
|
||||
case "DocumentedonContainer":
|
||||
annoData.append(Helper.ContentVars.DOCUMENTED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
break;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,15 +34,13 @@ import javax.tools.JavaCompiler.CompilationTask;
|
||||
public class Helper {
|
||||
|
||||
enum ContentVars {
|
||||
IMPORTCONTAINERSTMTS("\nimport java.lang.annotation.ContainedBy;\n" +
|
||||
"\nimport java.lang.annotation.ContainerFor;\n"),
|
||||
IMPORTCONTAINERSTMTS("\nimport java.lang.annotation.Repeatable;\n"),
|
||||
IMPORTDEPRECATED("import java.lang.Deprecated;\n"),
|
||||
IMPORTDOCUMENTED("import java.lang.annotation.Documented;\n"),
|
||||
IMPORTINHERITED("import java.lang.annotation.Inherited;\n"),
|
||||
IMPORTRETENTION("import java.lang.annotation.Retention;\n" +
|
||||
"\nimport java.lang.annotation.RetentionPolicy;\n"),
|
||||
CONTAINEDBY("\n@ContainedBy(FooContainer.class)\n"),
|
||||
CONTAINERFOR("@ContainerFor(Foo.class)\n"),
|
||||
REPEATABLE("\n@Repeatable(FooContainer.class)\n"),
|
||||
CONTAINER("@interface FooContainer {\n" +" Foo[] value();\n}\n"),
|
||||
BASE("@interface Foo {}\n"),
|
||||
REPEATABLEANNO("\n@Foo() @Foo()"),
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -94,17 +94,15 @@ public class InheritedAnnoCombo extends Helper {
|
||||
switch(className) {
|
||||
case "InheritedonBothAnno":
|
||||
annoData.append(Helper.ContentVars.INHERITED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.INHERITED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
break;
|
||||
case "InheritedonBase":
|
||||
annoData.append(Helper.ContentVars.INHERITED.getVal())
|
||||
.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
break;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -120,7 +120,7 @@ public class RetentionAnnoCombo extends Helper {
|
||||
new DiagnosticCollector<JavaFileObject>();
|
||||
boolean ok = compileCode(className, contents, diagnostics);
|
||||
|
||||
String expectedErrKey = "compiler.err.invalid.containedby" +
|
||||
String expectedErrKey = "compiler.err.invalid.repeatable" +
|
||||
".annotation.retention";
|
||||
if (!shouldCompile && !ok) {
|
||||
for (Diagnostic<?> d : diagnostics.getDiagnostics()) {
|
||||
@ -175,10 +175,9 @@ public class RetentionAnnoCombo extends Helper {
|
||||
StringBuilder annoData = new StringBuilder();
|
||||
annoData.append(Helper.ContentVars.IMPORTCONTAINERSTMTS.getVal())
|
||||
.append(Helper.ContentVars.IMPORTRETENTION.getVal())
|
||||
.append(Helper.ContentVars.CONTAINERFOR.getVal())
|
||||
.append(replacedRetCAVal)
|
||||
.append(Helper.ContentVars.CONTAINER.getVal())
|
||||
.append(Helper.ContentVars.CONTAINEDBY.getVal())
|
||||
.append(Helper.ContentVars.REPEATABLE.getVal())
|
||||
.append(replacedRetBaseVal)
|
||||
.append(Helper.ContentVars.BASE.getVal());
|
||||
|
||||
|
@ -5,9 +5,9 @@ compiler.err.cant.read.file # (apt.JavaCompiler?)
|
||||
compiler.err.cant.select.static.class.from.param.type
|
||||
compiler.err.dc.unterminated.string # cannot happen
|
||||
compiler.err.illegal.char.for.encoding
|
||||
compiler.err.invalid.containedby.annotation # should not happen
|
||||
compiler.err.invalid.containedby.annotation.invalid.value # "can't" happen
|
||||
compiler.err.invalid.containedby.annotation.multiple.values # can't happen
|
||||
compiler.err.invalid.repeatable.annotation # should not happen
|
||||
compiler.err.invalid.repeatable.annotation.invalid.value # "can't" happen
|
||||
compiler.err.invalid.repeatable.annotation.multiple.values # can't happen
|
||||
compiler.err.io.exception # (javah.JavahTask?)
|
||||
compiler.err.limit.code # Code
|
||||
compiler.err.limit.code.too.large.for.try.stmt # Gen
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,17 +22,16 @@
|
||||
*/
|
||||
|
||||
// key: compiler.err.duplicate.annotation.invalid.repeated
|
||||
// key: compiler.err.invalid.containedby.annotation.elem.nondefault
|
||||
//
|
||||
// key: compiler.err.invalid.repeatable.annotation.elem.nondefault
|
||||
|
||||
// We need an almost valid containing annotation. The easiest way to get
|
||||
// one close enough to valid is by forgetting a default.
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos { Anno[] value(); String foo(); }
|
||||
|
||||
@Anno
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,17 +21,16 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.containedby.annotation.not.documented
|
||||
// key: compiler.err.invalid.repeatable.annotation.not.documented
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Documented
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos { Anno[] value(); }
|
||||
|
||||
@Anno
|
||||
@Anno
|
||||
class ContainedByDocumentedMismatch { }
|
||||
class RepeatableDocumentedMismatch { }
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,17 +21,16 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.containedby.annotation.not.inherited
|
||||
// key: compiler.err.invalid.repeatable.annotation.not.inherited
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Inherited
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos { Anno[] value(); }
|
||||
|
||||
@Anno
|
||||
@Anno
|
||||
class ContainedByInheritedMismatch { }
|
||||
class RepeatableInheritedMismatch { }
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,16 +21,15 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.containedby.annotation.no.value
|
||||
// key: compiler.err.invalid.repeatable.annotation.no.value
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos {}
|
||||
|
||||
@Anno
|
||||
@Anno
|
||||
class ContainedByNoValue { }
|
||||
class RepeatableNoValue { }
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,14 +21,13 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.containedby.annotation.elem.nondefault
|
||||
// key: compiler.err.invalid.repeatable.annotation.elem.nondefault
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos { Anno[] value(); String foo(); }
|
||||
|
||||
class ContainedByNonDefault { }
|
||||
class RepeatableNonDefault { }
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,17 +21,16 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.containedby.annotation.retention
|
||||
// key: compiler.err.invalid.repeatable.annotation.retention
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos { Anno[] value(); }
|
||||
|
||||
@Anno
|
||||
@Anno
|
||||
class ContainedByRetentionMismatch { }
|
||||
class RepeatableRetentionMismatch { }
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,15 +21,14 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.containedby.annotation.incompatible.target
|
||||
// key: compiler.err.invalid.repeatable.annotation.incompatible.target
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@Target(ElementType.METHOD)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos { Anno[] value(); }
|
||||
|
||||
class ContainedByTargetMismatch { }
|
||||
class RepeatableTargetMismatch { }
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,16 +21,15 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.containedby.annotation.value.return
|
||||
// key: compiler.err.invalid.repeatable.annotation.value.return
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos { String value(); }
|
||||
|
||||
@Anno
|
||||
@Anno
|
||||
class ContainedByWrongValueType { }
|
||||
class RepeatableWrongValueType { }
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,14 +21,13 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.containedby.annotation.repeated.and.container.present
|
||||
// key: compiler.err.invalid.repeatable.annotation.repeated.and.container.present
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainedBy(Annos.class)
|
||||
@Repeatable(Annos.class)
|
||||
@interface Anno { }
|
||||
|
||||
@ContainerFor(Anno.class)
|
||||
@interface Annos { Anno[] value(); }
|
||||
|
||||
@Anno
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.container.no.containerfor
|
||||
// key: compiler.err.invalid.container.wrong.containedby
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainerFor(WrongContainedBy.class)
|
||||
@interface Foos {
|
||||
WrongContainedBy[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(Target.class)
|
||||
public @interface WrongContainedBy {}
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.err.invalid.container.wrong.containerfor
|
||||
// key: compiler.err.invalid.container.no.containedby
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@ContainerFor(Retention.class)
|
||||
@interface Foos {
|
||||
WrongContainerFor[] value();
|
||||
}
|
||||
|
||||
@ContainedBy(Foos.class)
|
||||
public @interface WrongContainerFor {}
|
Loading…
Reference in New Issue
Block a user