method moved
authornik <Nikolay.Chashnikov@jetbrains.com>
Thu, 6 Aug 2015 16:05:57 +0000 (19:05 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Fri, 7 Aug 2015 07:44:25 +0000 (10:44 +0300)
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/OrderEntryFix.java
plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java

index 5d8eaa2ce240da081fbedfa5d3dd4df65f31da90..52c48cb6c9a37a51afad13df98fc44700d132f1a 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.codeInsight.daemon.impl.quickfix;
 
-import com.intellij.codeInsight.AnnotationUtil;
 import com.intellij.codeInsight.daemon.QuickFixActionRegistrar;
 import com.intellij.codeInsight.daemon.QuickFixBundle;
 import com.intellij.codeInsight.daemon.impl.actions.AddImportAction;
@@ -317,10 +316,4 @@ public abstract class OrderEntryFix implements IntentionAction, LocalQuickFix {
     final LocateLibraryDialog dialog = new LocateLibraryDialog(module, defaultPaths, "JetBrains Annotations");
     return dialog.showAndGetResult();
   }
-
-  public static boolean isAnnotationsJarInPath(Module module) {
-    if (module == null) return false;
-    return JavaPsiFacade.getInstance(module.getProject())
-             .findClass(AnnotationUtil.LANGUAGE, GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module)) != null;
-  }
 }
index c8bbfbc67bde466073a5542b8ba962463b208d5d..b6fd1dba5726efb2aa8805b2317c56d5d9378f5e 100644 (file)
 package org.intellij.plugins.intelliLang.inject.java;
 
 import com.intellij.codeInsight.AnnotationUtil;
-import com.intellij.codeInsight.daemon.impl.quickfix.OrderEntryFix;
 import com.intellij.lang.Language;
 import com.intellij.lang.injection.MultiHostRegistrar;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.application.Result;
 import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleUtilCore;
 import com.intellij.openapi.options.Configurable;
 import com.intellij.openapi.project.Project;
@@ -229,12 +229,18 @@ public class JavaLanguageInjectionSupport extends AbstractLanguageInjectionSuppo
     });
   }
 
+  private static boolean isAnnotationsJarInPath(Module module) {
+    if (module == null) return false;
+    return JavaPsiFacade.getInstance(module.getProject())
+             .findClass(AnnotationUtil.LANGUAGE, GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module)) != null;
+  }
+
   public static boolean doAddLanguageAnnotation(Project project,
                                                 @Nullable final PsiModifierListOwner modifierListOwner,
                                                 @NotNull final PsiLanguageInjectionHost host,
                                                 final String languageId,
                                                 Processor<PsiLanguageInjectionHost> annotationFixer) {
-    final boolean addAnnotation = OrderEntryFix.isAnnotationsJarInPath(ModuleUtilCore.findModuleForPsiElement(modifierListOwner))
+    final boolean addAnnotation = isAnnotationsJarInPath(ModuleUtilCore.findModuleForPsiElement(modifierListOwner))
       && PsiUtil.isLanguageLevel5OrHigher(modifierListOwner)
       && modifierListOwner.getModifierList() != null;
     final PsiStatement statement = PsiTreeUtil.getParentOfType(host, PsiStatement.class);