Skip to content

Commit 4a87d27

Browse files
authored
Merge pull request #157 from unv-unv/ep-name-general-refactoring-7
Refactoring and localizing users of EP_NAME (part 7)
2 parents 24fd81e + 958d8ed commit 4a87d27

9 files changed

Lines changed: 1464 additions & 1274 deletions

File tree

java-analysis-api/src/main/resources/LOCALIZE-LIB/en_US/consulo.java.analysis.JavaAnalysisLocalize.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
add.explicit.type.arguments:
22
text: Add explicit type arguments
3-
annotation.target.ANNOTATION_TYPE:
4-
text: annotation type
5-
annotation.target.CONSTRUCTOR:
6-
text: constructor
7-
annotation.target.FIELD:
8-
text: field
9-
annotation.target.LOCAL_VARIABLE:
10-
text: local variable
11-
annotation.target.METHOD:
12-
text: method
13-
annotation.target.MODULE:
14-
text: module
15-
annotation.target.PACKAGE:
16-
text: package
17-
annotation.target.PARAMETER:
18-
text: parameter
19-
annotation.target.RECORD_COMPONENT:
20-
text: record component
21-
annotation.target.TYPE:
22-
text: type
23-
annotation.target.TYPE_PARAMETER:
24-
text: type parameter
25-
annotation.target.TYPE_USE:
26-
text: type use
273
change.type.arguments:
284
text: Change type arguments
295
change.type.arguments.to.0:

java-analysis-impl/src/main/java/com/intellij/java/analysis/impl/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,9 @@ else if (isAnnotationRepeatedTwice(owner, annotationType.getQualifiedName())) {
271271
PsiAnnotation.TargetType[] targets = AnnotationTargetUtil.getTargetsForLocation(owner);
272272
PsiAnnotation.TargetType applicable = AnnotationTargetUtil.findAnnotationTarget(container, targets);
273273
if (applicable == null) {
274-
String target = JavaErrorBundle.message("annotation.target." + targets[0]);
275274
return annotationError(
276275
annotationToCheck,
277-
JavaErrorLocalize.annotationContainerNotApplicable(container.getName(), target)
276+
JavaErrorLocalize.annotationContainerNotApplicable(container.getName(), targets[0].getPresentableText())
278277
);
279278
}
280279
}
@@ -446,8 +445,7 @@ public static HighlightInfo checkApplicability(@Nonnull PsiAnnotation annotation
446445
}
447446

448447
if (applicable == null) {
449-
String target = JavaErrorBundle.message("annotation.target." + targets[0]);
450-
return annotationError(annotation, JavaErrorLocalize.annotationNotApplicable(nameRef.getText(), target));
448+
return annotationError(annotation, JavaErrorLocalize.annotationNotApplicable(nameRef.getText(), targets[0].getPresentableText()));
451449
}
452450

453451
if (applicable == PsiAnnotation.TargetType.TYPE_USE) {

java-analysis-impl/src/main/java/com/intellij/java/analysis/impl/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ else if (referenceElements.length != 0 && element != referenceElements[0]
414414
return null;
415415
}
416416

417+
@RequiredReadAction
417418
public static HighlightInfo checkInterfaceMultipleInheritance(PsiClass aClass) {
418419
PsiClassType[] types = aClass.getSuperTypes();
419420
if (types.length < 2) {
@@ -1587,6 +1588,7 @@ public static HighlightInfo checkGenericCannotExtendException(PsiReferenceList l
15871588
return null;
15881589
}
15891590

1591+
@RequiredReadAction
15901592
public static HighlightInfo checkEnumMustNotBeLocal(PsiClass aClass) {
15911593
if (!aClass.isEnum()) {
15921594
return null;
@@ -1602,6 +1604,7 @@ public static HighlightInfo checkEnumMustNotBeLocal(PsiClass aClass) {
16021604
return null;
16031605
}
16041606

1607+
@RequiredReadAction
16051608
public static HighlightInfo checkEnumWithoutConstantsCantHaveAbstractMethods(PsiClass aClass) {
16061609
if (!aClass.isEnum()) {
16071610
return null;
@@ -1787,6 +1790,7 @@ public static HighlightInfo checkInferredIntersections(PsiSubstitutor substituto
17871790
return null;
17881791
}
17891792

1793+
@RequiredReadAction
17901794
public static HighlightInfo areSupersAccessible(@Nonnull PsiClass aClass) {
17911795
return areSupersAccessible(aClass, aClass.getResolveScope(), HighlightNamesUtil.getClassDeclarationTextRange(aClass), true);
17921796
}

0 commit comments

Comments
 (0)