mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
[java] validates container annotation "concreteness" (IDEA-201354)
This commit is contained in:
@@ -623,6 +623,12 @@ public class AnnotationsHighlightUtil {
|
||||
}
|
||||
}
|
||||
|
||||
for (PsiMethod method : container.getMethods()) {
|
||||
if (method instanceof PsiAnnotationMethod && !"value".equals(method.getName()) && ((PsiAnnotationMethod)method).getDefaultValue() == null) {
|
||||
return JavaErrorMessages.message("annotation.container.abstract", container.getQualifiedName(), method.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ annotation.container.no.value=Invalid container annotation ''{0}'': no ''value''
|
||||
annotation.container.bad.type=Invalid container annotation ''{0}'': ''value'' method should have type ''{1}''
|
||||
annotation.container.low.retention=Container annotation ''{0}'' has shorter retention (''{1}'') than the contained annotation
|
||||
annotation.container.wide.target=Target of container annotation ''{0}'' is not a subset of target of this annotation
|
||||
annotation.container.abstract=Container annotation ''{0}'' does not have a default value for ''{1}''
|
||||
annotation.duplicate.explained=Duplicate annotation. {0}
|
||||
annotation.non.repeatable=The declaration of ''{0}'' does not have a valid java.lang.annotation.Repeatable annotation
|
||||
annotation.container.wrong.place=Container annotation ''{0}'' must not be present at the same time as the element it contains
|
||||
|
||||
@@ -53,3 +53,6 @@ class C8 {
|
||||
<error descr="Container annotation '@AA8' is not applicable to field">@A8</error> <error descr="Container annotation '@AA8' is not applicable to field">@A8</error> int f2;
|
||||
@A8 @A8 void m() { }
|
||||
}
|
||||
|
||||
@interface AA9 { A9[] value(); int i(); }
|
||||
@Repeatable(<error descr="Container annotation 'AA9' does not have a default value for 'i'">AA9.class</error>) @interface A9 { }
|
||||
Reference in New Issue
Block a user