From 2036285ee65c9bbeb8f4edcf2ea4b15d937ec005 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Tue, 2 Sep 2014 20:32:01 +0400 Subject: [PATCH] scary racy field removed --- .../source/resolve/PsiResolveHelperImpl.java | 13 ++----------- .../completion/SmartType18CompletionTest.java | 18 ++++-------------- .../lambda/ConstraintsInferenceMiscTest.java | 2 +- .../lambda/Diamond8HighlightingTest.java | 4 ++-- .../ExceptionVariablesInferenceTest.java | 4 ++-- ...alExpressionIncompleteHighlightingTest.java | 2 +- ...tionalTypeWildcardParameterizationTest.java | 2 +- .../lambda/GenericsHighlighting8Test.java | 16 +++------------- .../lambda/GraphInferenceHighlightingTest.java | 4 ++-- .../daemon/lambda/LambdaHighlightingTest.java | 2 +- .../daemon/lambda/LambdaInferenceTest.java | 4 ++-- .../daemon/lambda/LambdaParamsTest.java | 4 ++-- .../daemon/lambda/LambdaRedundantCastTest.java | 4 ++-- .../lambda/LightAdvHighlightingJdk8Test.java | 3 +-- .../lambda/MethodRefHighlightingTest.java | 4 ++-- .../lambda/MostSpecificResolutionTest.java | 2 +- .../lambda/NewLambdaHighlightingTest.java | 2 +- .../lambda/NewMethodRefHighlightingTest.java | 4 ++-- .../refactoring/IntroduceVariableTest.java | 18 ++++++------------ .../daemon/LightDaemonAnalyzerTestCase.java | 17 +---------------- 20 files changed, 39 insertions(+), 90 deletions(-) diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java index 556bf7152b68..a27dfe5adb83 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java @@ -15,7 +15,6 @@ */ package com.intellij.psi.impl.source.resolve; -import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.*; @@ -211,16 +210,8 @@ public class PsiResolveHelperImpl implements PsiResolveHelper { .getSubstitutionForTypeParameter(typeParam, param, arg, isContraVariantPosition, languageLevel); } - private PsiInferenceHelper myTestHelper; - - public void setTestHelper(PsiInferenceHelper testHelper) { - myTestHelper = testHelper; - } - - public PsiInferenceHelper getInferenceHelper(LanguageLevel languageLevel) { - if (ApplicationManager.getApplication().isUnitTestMode() && myTestHelper != null) { - return myTestHelper; - } + @NotNull + public PsiInferenceHelper getInferenceHelper(@NotNull LanguageLevel languageLevel) { if (languageLevel.isAtLeast(LanguageLevel.JDK_1_8)) { return new PsiGraphInferenceHelper(myManager); } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java index eb3c4c4577b6..68aba5eca978 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartType18CompletionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +17,6 @@ package com.intellij.codeInsight.completion; import com.intellij.JavaTestUtil; import com.intellij.codeInsight.lookup.Lookup; -import com.intellij.psi.JavaPsiFacade; -import com.intellij.psi.impl.source.resolve.PsiResolveHelperImpl; -import com.intellij.psi.impl.source.resolve.graphInference.PsiGraphInferenceHelper; import com.intellij.testFramework.LightProjectDescriptor; import org.jetbrains.annotations.NotNull; @@ -117,16 +114,9 @@ public class SmartType18CompletionTest extends LightFixtureCompletionTestCase { } public void testInferFromRawType() throws Exception { - final PsiResolveHelperImpl helper = (PsiResolveHelperImpl)JavaPsiFacade.getInstance(getProject()).getResolveHelper(); - helper.setTestHelper(new PsiGraphInferenceHelper(getPsiManager())); - try { - configureByFile("/" + getTestName(false) + ".java"); - assertNotNull(myItems); - assertTrue(myItems.length == 0); - } - finally { - helper.setTestHelper(null); - } + configureByFile("/" + getTestName(false) + ".java"); + assertNotNull(myItems); + assertTrue(myItems.length == 0); } public void testDiamondsInsideMethodCall() throws Exception { diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ConstraintsInferenceMiscTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ConstraintsInferenceMiscTest.java index 42433d327e2d..9ab0ba5fae37 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ConstraintsInferenceMiscTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ConstraintsInferenceMiscTest.java @@ -55,7 +55,7 @@ public class ConstraintsInferenceMiscTest extends LightDaemonAnalyzerTestCase { } private void doTest(final boolean checkWarnings) { - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Diamond8HighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Diamond8HighlightingTest.java index eb73906a5f15..62c96e148ea1 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Diamond8HighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Diamond8HighlightingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ public class Diamond8HighlightingTest extends LightDaemonAnalyzerTestCase { } private void doTest() throws Exception { - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", false, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ExceptionVariablesInferenceTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ExceptionVariablesInferenceTest.java index 0384c0f074db..c55c6ae2e775 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ExceptionVariablesInferenceTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ExceptionVariablesInferenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,6 +54,6 @@ public class ExceptionVariablesInferenceTest extends LightDaemonAnalyzerTestCase } private void doTest(final boolean checkWarnings) throws Exception { - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); } } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FunctionalExpressionIncompleteHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FunctionalExpressionIncompleteHighlightingTest.java index e47f6acc9afc..5e34b963e321 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FunctionalExpressionIncompleteHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FunctionalExpressionIncompleteHighlightingTest.java @@ -47,7 +47,7 @@ public class FunctionalExpressionIncompleteHighlightingTest extends LightDaemonA } private void doTest(final boolean checkWarnings) { - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FunctionalTypeWildcardParameterizationTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FunctionalTypeWildcardParameterizationTest.java index 599ae74cd00d..72f709a48697 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FunctionalTypeWildcardParameterizationTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FunctionalTypeWildcardParameterizationTest.java @@ -38,7 +38,7 @@ public class FunctionalTypeWildcardParameterizationTest extends LightDaemonAnaly private void doTest() { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", false, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java index a66d999b283c..a919843a3164 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java @@ -1,11 +1,11 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http:www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -24,9 +24,6 @@ import com.intellij.openapi.projectRoots.JavaSdkVersion; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.roots.LanguageLevelProjectExtension; import com.intellij.pom.java.LanguageLevel; -import com.intellij.psi.JavaPsiFacade; -import com.intellij.psi.impl.source.resolve.PsiResolveHelperImpl; -import com.intellij.psi.impl.source.resolve.graphInference.PsiGraphInferenceHelper; import com.intellij.testFramework.IdeaTestUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -772,14 +769,7 @@ public class GenericsHighlighting8Test extends LightDaemonAnalyzerTestCase { private void doTest(boolean warnings) { LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject()).setLanguageLevel(LanguageLevel.JDK_1_8); IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), myTestRootDisposable); - final PsiResolveHelperImpl helper = (PsiResolveHelperImpl)JavaPsiFacade.getInstance(getProject()).getResolveHelper(); - helper.setTestHelper(new PsiGraphInferenceHelper(getPsiManager())); - try { - doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); - } - finally { - helper.setTestHelper(null); - } + doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java index 7585d661b289..e6e4534b6560 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -242,7 +242,7 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase private void doTest(final boolean checkWarnings) throws Exception { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java index a3a326cfcf81..5ecab96d8926 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java @@ -112,7 +112,7 @@ public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase { } private void doTest(final boolean checkWarnings) { - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaInferenceTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaInferenceTest.java index 96e60587a225..b13cfbc22e02 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaInferenceTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaInferenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,6 @@ public class LambdaInferenceTest extends LightDaemonAnalyzerTestCase { } private void doTest() throws Exception { - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", false, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false); } } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaParamsTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaParamsTest.java index 94ca90df2d02..faf1608c1cf0 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaParamsTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaParamsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,6 @@ public class LambdaParamsTest extends LightDaemonAnalyzerTestCase { public void testInferFromFormal() { doTest(); } private void doTest() { - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", false, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false); } } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaRedundantCastTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaRedundantCastTest.java index 36f98aa91cc6..ae5a97933ca8 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaRedundantCastTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaRedundantCastTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,6 @@ public class LambdaRedundantCastTest extends LightDaemonAnalyzerTestCase { public void testIntersection() { doTest(); } public void testSer() { doTest(); } private void doTest() { - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", true, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false); } } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LightAdvHighlightingJdk8Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LightAdvHighlightingJdk8Test.java index 630acb0404b7..08a2b63550ff 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LightAdvHighlightingJdk8Test.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LightAdvHighlightingJdk8Test.java @@ -18,7 +18,6 @@ package com.intellij.codeInsight.daemon.lambda; import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase; import com.intellij.codeInspection.LocalInspectionTool; import com.intellij.codeInspection.compiler.JavacQuirksInspection; -import com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspection; import com.intellij.openapi.projectRoots.JavaSdkVersion; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.testFramework.IdeaTestUtil; @@ -42,7 +41,7 @@ public class LightAdvHighlightingJdk8Test extends LightDaemonAnalyzerTestCase { private void doTest() { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", true, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MethodRefHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MethodRefHighlightingTest.java index 156aac5613c1..d0bed5e9d5df 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MethodRefHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MethodRefHighlightingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,7 +116,7 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase { private void doTest(boolean warnings) { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MostSpecificResolutionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MostSpecificResolutionTest.java index 9bb7d4801944..294a3cc8a4f6 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MostSpecificResolutionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/MostSpecificResolutionTest.java @@ -121,7 +121,7 @@ public class MostSpecificResolutionTest extends LightDaemonAnalyzerTestCase { private void doTest(boolean warnings) { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java index 5307493a7455..60d88ef4f727 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java @@ -136,7 +136,7 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase { private void doTest(boolean warnings) { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java index 437159d1646e..3d5bcdecd0e5 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -319,7 +319,7 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase { private void doTest(boolean warnings) { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); - doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); + doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); } @Override diff --git a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java index 34745372977e..6ef80d01903e 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java @@ -18,9 +18,10 @@ package com.intellij.refactoring; import com.intellij.JavaTestUtil; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; -import com.intellij.psi.*; -import com.intellij.psi.impl.source.resolve.PsiResolveHelperImpl; -import com.intellij.psi.impl.source.resolve.graphInference.PsiGraphInferenceHelper; +import com.intellij.psi.CommonClassNames; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiExpression; +import com.intellij.psi.PsiType; import com.intellij.refactoring.introduce.inplace.OccurrencesChooser; import com.intellij.refactoring.introduceVariable.InputValidator; import com.intellij.refactoring.introduceVariable.IntroduceVariableBase; @@ -95,15 +96,8 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase { } public void testExpectedType8Inference() { - final PsiResolveHelperImpl helper = (PsiResolveHelperImpl)JavaPsiFacade.getInstance(getProject()).getResolveHelper(); - helper.setTestHelper(new PsiGraphInferenceHelper(getPsiManager())); - try { - doTest(new MockIntroduceVariableHandler("temp", true, false, false, - "java.util.Map>")); - } - finally { - helper.setTestHelper(null); - } + doTest(new MockIntroduceVariableHandler("temp", true, false, false, + "java.util.Map>")); } public void testMethodCall() { diff --git a/java/testFramework/src/com/intellij/codeInsight/daemon/LightDaemonAnalyzerTestCase.java b/java/testFramework/src/com/intellij/codeInsight/daemon/LightDaemonAnalyzerTestCase.java index ff98bd23b858..d2b25c6d3d04 100644 --- a/java/testFramework/src/com/intellij/codeInsight/daemon/LightDaemonAnalyzerTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/daemon/LightDaemonAnalyzerTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,11 +24,8 @@ import com.intellij.lang.injection.InjectedLanguageManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.vfs.VirtualFileFilter; -import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; -import com.intellij.psi.impl.source.resolve.PsiResolveHelperImpl; -import com.intellij.psi.impl.source.resolve.graphInference.PsiGraphInferenceHelper; import com.intellij.testFramework.ExpectedHighlightingData; import com.intellij.testFramework.FileTreeAccessFilter; import com.intellij.testFramework.HighlightTestInfo; @@ -83,18 +80,6 @@ public abstract class LightDaemonAnalyzerTestCase extends LightCodeInsightTestCa doTestConfiguredFile(checkWarnings, checkInfos, filePath); } - protected void doTestNewInference(@NonNls String filePath, boolean checkWarnings, boolean checkInfos) { - final PsiResolveHelperImpl helper = (PsiResolveHelperImpl)JavaPsiFacade.getInstance(getProject()).getResolveHelper(); - helper.setTestHelper(new PsiGraphInferenceHelper(getPsiManager())); - try { - configureByFile(filePath); - doTestConfiguredFile(checkWarnings, checkInfos, filePath); - } - finally { - helper.setTestHelper(null); - } - } - protected void doTest(@NonNls String filePath, boolean checkWarnings, boolean checkWeakWarnings, boolean checkInfos) { configureByFile(filePath); doTestConfiguredFile(checkWarnings, checkWeakWarnings, checkInfos, filePath);