decouple PsiAnnotationImpl from AnnotationUtil
authorDmitry Jemerov <yole@jetbrains.com>
Fri, 23 Sep 2011 15:11:45 +0000 (17:11 +0200)
committerDmitry Jemerov <yole@jetbrains.com>
Fri, 23 Sep 2011 17:12:33 +0000 (19:12 +0200)
java/java-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java
java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiAnnotationImpl.java
java/openapi/src/com/intellij/codeInsight/AnnotationUtil.java
java/openapi/src/com/intellij/psi/CommonClassNames.java

index b1fadafc53b6f12e80c62f44f7041485abeb0f6a..564ecfc146c00a0c32086277353fe16d29f6a5c8 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.codeInsight.daemon.impl.analysis;
 
-import com.intellij.codeInsight.AnnotationUtil;
 import com.intellij.codeInsight.CodeInsightUtilBase;
 import com.intellij.codeInsight.daemon.JavaErrorMessages;
 import com.intellij.codeInsight.daemon.impl.HighlightInfo;
@@ -312,7 +311,7 @@ public class AnnotationsHighlightUtil {
     if (nameRef == null) return null;
     PsiElement resolved = nameRef.resolve();
     if (!(resolved instanceof PsiClass) ||
-        !AnnotationUtil.TARGET_ANNOTATION_FQ_NAME.equals(((PsiClass) resolved).getQualifiedName())) return null;
+        !CommonClassNames.TARGET_ANNOTATION_FQ_NAME.equals(((PsiClass) resolved).getQualifiedName())) return null;
 
     PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes();
     if (attributes.length < 1) return null;
index 6b4b45d983a3068458118ebd4c6cdf0370f1a559..a89a4aebc90320bad75b362e25b5c5825c5e75ae 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.psi.impl.source.tree.java;
 
-import com.intellij.codeInsight.AnnotationUtil;
 import com.intellij.lang.ASTNode;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
@@ -151,7 +150,7 @@ public class PsiAnnotationImpl extends JavaStubPsiElement<PsiAnnotationStub> imp
       return !strict;
     }
     PsiClass annotationType = (PsiClass)resolved;
-    PsiAnnotation target = annotationType.getModifierList().findAnnotation(AnnotationUtil.TARGET_ANNOTATION_FQ_NAME);
+    PsiAnnotation target = annotationType.getModifierList().findAnnotation(CommonClassNames.TARGET_ANNOTATION_FQ_NAME);
     if (target == null) {
       //todo hack: ambiguity in spec
       return !strict;
index cac457cd295e535a728834e51c759a142d017da1..395a559b8af152186f1a4f07953713c87bf85938 100644 (file)
@@ -67,7 +67,6 @@ public class AnnotationUtil {
   @NonNls private static final String[] SIMPLE_NAMES =
     {NOT_NULL_SIMPLE_NAME, NULLABLE_SIMPLE_NAME, NON_NLS_SIMPLE_NAME, PROPERTY_KEY_SIMPLE_NAME, TEST_ONLY_SIMPLE_NAME,
       "Language", "Identifier", "Pattern", "PrintFormat", "RegExp", "Subst"};
-  public static final String TARGET_ANNOTATION_FQ_NAME = "java.lang.annotation.Target";
 
   static {
     ALL_ANNOTATIONS = new HashSet<String>(2);
index 3d259163c3b899c55f92e639e5e60146d04d5434..4fb3775d9b1664f3c9cce57a32e716e4ab6a5bcf 100644 (file)
@@ -84,4 +84,5 @@ public interface CommonClassNames {
   @NonNls String JAVA_UTIL_ARRAY_LIST = "java.util.ArrayList";
 
   @NonNls String JAVA_LANG_INVOKE_MH_POLYMORPHIC = "java.lang.invoke.MethodHandle.PolymorphicSignature";
+  String TARGET_ANNOTATION_FQ_NAME = "java.lang.annotation.Target";
 }