scary racy field removed

This commit is contained in:
Alexey Kudravtsev
2014-09-03 16:18:55 +04:00
parent 2c9f8daaad
commit 2036285ee6
20 changed files with 39 additions and 90 deletions
@@ -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 {
@@ -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
@@ -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
@@ -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);
}
}
@@ -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
@@ -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
@@ -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);
}
@@ -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
@@ -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
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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<java.lang.String,java.util.List<java.lang.String>>"));
}
finally {
helper.setTestHelper(null);
}
doTest(new MockIntroduceVariableHandler("temp", true, false, false,
"java.util.Map<java.lang.String,java.util.List<java.lang.String>>"));
}
public void testMethodCall() {