From ce5a0d65c2ebda4b19459e8e43ca6917be27029d Mon Sep 17 00:00:00 2001 From: Mikhail Pyltsin Date: Thu, 13 Jun 2024 11:15:05 +0200 Subject: [PATCH] IJ-CR-135655 [java-highlighting] S IDEA-286130 annotations are not allowed in permitted list - fix text - fix test GitOrigin-RevId: 87072c9561528bd04a27c03293f926a33a2519f9 --- .../resources/messages/JavaErrorBundle.properties | 2 +- .../advHighlightingSealedTypes/PermitsList.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/java/java-psi-impl/resources/messages/JavaErrorBundle.properties b/java/java-psi-impl/resources/messages/JavaErrorBundle.properties index 308827841b2b..a8ded7291ab6 100644 --- a/java/java-psi-impl/resources/messages/JavaErrorBundle.properties +++ b/java/java-psi-impl/resources/messages/JavaErrorBundle.properties @@ -30,7 +30,7 @@ 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 annotation.container.not.applicable=Container annotation ''@{0}'' is not applicable to {1} -annotation.not.allowed.in.permit.list = Annotation is not allowed in permit list +annotation.not.allowed.in.permit.list=Annotations not allowed in 'permits' list receiver.wrong.context=Receivers are not allowed outside of method parameter list receiver.static.context=The receiver cannot be used in a static context diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlightingSealedTypes/PermitsList.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlightingSealedTypes/PermitsList.java index 1e5d388869d0..fdc8bfe50c8f 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlightingSealedTypes/PermitsList.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlightingSealedTypes/PermitsList.java @@ -30,6 +30,8 @@ sealed class Parent permits TypedChildpermits I {} + class TestWithAnnotations{ @Target(ElementType.TYPE_USE) @interface Ann { @@ -38,7 +40,7 @@ class TestWithAnnotations{ public static void main(String[] args) { } - sealed class PermittedAnnotations permits @Ann SealedOne { + sealed class PermittedAnnotations permits @Ann SealedOne { } non-sealed class SealedOne extends PermittedAnnotations {