diff --git a/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties b/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties index 6f36341d776e..6ae9012eb3a7 100644 --- a/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties +++ b/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties @@ -1,30 +1,5 @@ add.explicit.type.arguments=Add explicit type arguments -# suppress inspection "UnusedProperty" -annotation.target.ANNOTATION_TYPE=annotation type -# suppress inspection "UnusedProperty" -annotation.target.CONSTRUCTOR=constructor -# suppress inspection "UnusedProperty" -annotation.target.FIELD=field -# suppress inspection "UnusedProperty" -annotation.target.LOCAL_VARIABLE=local variable -# suppress inspection "UnusedProperty" -annotation.target.METHOD=method -# suppress inspection "UnusedProperty" -annotation.target.MODULE=module -# suppress inspection "UnusedProperty" -annotation.target.PACKAGE=package -# suppress inspection "UnusedProperty" -annotation.target.PARAMETER=parameter -# suppress inspection "UnusedProperty" -annotation.target.RECORD_COMPONENT=record component -# suppress inspection "UnusedProperty" -annotation.target.TYPE=type -# suppress inspection "UnusedProperty" -annotation.target.TYPE_PARAMETER=type parameter -# suppress inspection "UnusedProperty" -annotation.target.TYPE_USE=type use - change.type.arguments=Change type arguments change.type.arguments.to.0=Change type arguments to <{0}> diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java index 46b62ac8d860..2246acc93932 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java @@ -274,7 +274,7 @@ public final class AnnotationsHighlightUtil { PsiAnnotation.TargetType[] targets = AnnotationTargetUtil.getTargetsForLocation(owner); PsiAnnotation.TargetType applicable = AnnotationTargetUtil.findAnnotationTarget(container, targets); if (applicable == null) { - String target = JavaAnalysisBundle.message("annotation.target." + targets[0]); + String target = JavaPsiBundle.message("annotation.target." + targets[0]); String message = JavaErrorBundle.message("annotation.container.not.applicable", container.getName(), target); return createAnnotationError(annotationToCheck, message); } @@ -480,7 +480,7 @@ public final class AnnotationsHighlightUtil { private static @NotNull HighlightInfo.Builder createNotApplicableTargetInfo(@NotNull PsiAnnotation annotation, PsiJavaCodeReferenceElement nameRef, PsiAnnotation.TargetType[] targets) { - String target = JavaAnalysisBundle.message("annotation.target." + targets[0]); + String target = JavaPsiBundle.message("annotation.target." + targets[0]); String message = JavaErrorBundle.message("annotation.not.applicable", nameRef.getText(), target); HighlightInfo.Builder info = createAnnotationError(annotation, message); if (BaseIntentionAction.canModify(Objects.requireNonNull(annotation.resolveAnnotationType()))) { diff --git a/java/java-frontback-psi-api/resources/messages/JavaPsiBundle.properties b/java/java-frontback-psi-api/resources/messages/JavaPsiBundle.properties index 7668620d1143..29c7be128c7e 100644 --- a/java/java-frontback-psi-api/resources/messages/JavaPsiBundle.properties +++ b/java/java-frontback-psi-api/resources/messages/JavaPsiBundle.properties @@ -291,4 +291,29 @@ error.incompatible.type.incompatible.equality.constraint=Incompatible equality c list.item.no.module= # {0} = localized element kind ('class', 'field', 'method', etc.); {1} = element name element.kind.and.name={0} {1} -command.name.insert.block.statement=Insert Block Statement \ No newline at end of file +command.name.insert.block.statement=Insert Block Statement + +# suppress inspection "UnusedProperty" +annotation.target.ANNOTATION_TYPE=annotation type +# suppress inspection "UnusedProperty" +annotation.target.CONSTRUCTOR=constructor +# suppress inspection "UnusedProperty" +annotation.target.FIELD=field +# suppress inspection "UnusedProperty" +annotation.target.LOCAL_VARIABLE=local variable +# suppress inspection "UnusedProperty" +annotation.target.METHOD=method +# suppress inspection "UnusedProperty" +annotation.target.MODULE=module +# suppress inspection "UnusedProperty" +annotation.target.PACKAGE=package +# suppress inspection "UnusedProperty" +annotation.target.PARAMETER=parameter +# suppress inspection "UnusedProperty" +annotation.target.RECORD_COMPONENT=record component +# suppress inspection "UnusedProperty" +annotation.target.TYPE=type +# suppress inspection "UnusedProperty" +annotation.target.TYPE_PARAMETER=type parameter +# suppress inspection "UnusedProperty" +annotation.target.TYPE_USE=type use diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/checkers/CustomAnnotationChecker.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/checkers/CustomAnnotationChecker.java index 469b44310bf0..5648946aa862 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/checkers/CustomAnnotationChecker.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/checkers/CustomAnnotationChecker.java @@ -3,7 +3,7 @@ package org.jetbrains.plugins.groovy.annotator.checkers; import com.intellij.codeInsight.daemon.JavaErrorBundle; import com.intellij.codeInspection.util.InspectionMessage; -import com.intellij.java.analysis.JavaAnalysisBundle; +import com.intellij.core.JavaPsiBundle; import com.intellij.lang.annotation.AnnotationHolder; import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.util.Pair; @@ -44,7 +44,7 @@ public abstract class CustomAnnotationChecker { PsiElement ownerToUse = owner instanceof PsiModifierList ? ((PsiElement)owner).getParent() : (PsiElement)owner; PsiAnnotation.TargetType[] elementTypeFields = GrAnnotationImpl.getApplicableElementTypeFields(ownerToUse); if (elementTypeFields.length != 0 && !GrAnnotationImpl.isAnnotationApplicableTo(annotation, elementTypeFields)) { - String annotationTargetText = JavaAnalysisBundle.message("annotation.target." + elementTypeFields[0]); + String annotationTargetText = JavaPsiBundle.message("annotation.target." + elementTypeFields[0]); GrCodeReferenceElement ref = annotation.getClassReference(); return JavaErrorBundle.message("annotation.not.applicable", ref.getText(), annotationTargetText); }