cleanup
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Mon, 25 May 2015 17:20:30 +0000 (20:20 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Tue, 26 May 2015 09:54:26 +0000 (12:54 +0300)
java/debugger/openapi/src/com/intellij/debugger/engine/DebuggerUtils.java

index 32b443f9393f45c332a249defa8c4200f43f04f4..123a831f3c022813f0f39e007aa008a88889b7d1 100644 (file)
@@ -362,21 +362,20 @@ public abstract class DebuggerUtils {
   public static PsiClass findClass(@NotNull final String className, @NotNull Project project, final GlobalSearchScope scope) {
     ApplicationManager.getApplication().assertReadAccessAllowed();
     try {
-      final PsiManager psiManager = PsiManager.getInstance(project);
-      final JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(psiManager.getProject());
       if (getArrayClass(className) != null) {
-        return javaPsiFacade.getElementFactory()
-          .getArrayClass(LanguageLevelProjectExtension.getInstance(psiManager.getProject()).getLanguageLevel());
+        return JavaPsiFacade.getInstance(project).getElementFactory()
+          .getArrayClass(LanguageLevelProjectExtension.getInstance(project).getLanguageLevel());
       }
       if (project.isDefault()) {
         return null;
       }
 
-      PsiClass psiClass = ClassUtil.findPsiClass(PsiManager.getInstance(project), className, null, true, scope);
+      PsiManager psiManager = PsiManager.getInstance(project);
+      PsiClass psiClass = ClassUtil.findPsiClass(psiManager, className, null, true, scope);
       if (psiClass == null) {
         GlobalSearchScope globalScope = GlobalSearchScope.allScope(project);
         if (!globalScope.equals(scope)) {
-          psiClass = ClassUtil.findPsiClass(PsiManager.getInstance(project), className, null, true, globalScope);
+          psiClass = ClassUtil.findPsiClass(psiManager, className, null, true, globalScope);
         }
       }