inference of @Nullable methods in integration tests

This commit is contained in:
Ilya Klyuchnikov
2014-10-03 11:25:37 +04:00
parent 322a489b98
commit 1d28161995
2 changed files with 13 additions and 2 deletions
@@ -17,7 +17,6 @@ package com.intellij.codeInspection.bytecodeAnalysis;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInspection.dataFlow.ControlFlowAnalyzer;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProgressManager;
@@ -62,7 +61,7 @@ public class ProjectBytecodeAnalysis {
public ProjectBytecodeAnalysis(Project project) {
myProject = project;
nullableMethod = Registry.is(NULLABLE_METHOD) || ApplicationManager.getApplication().isUnitTestMode();
nullableMethod = Registry.is(NULLABLE_METHOD);
nullableMethodTransitivity = Registry.is(NULLABLE_METHOD_TRANSITIVITY);
}
@@ -28,6 +28,8 @@ import com.intellij.openapi.roots.ModuleRootModificationUtil;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.roots.libraries.LibraryTable;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.registry.RegistryValue;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtilCore;
@@ -58,11 +60,21 @@ public class BytecodeAnalysisIntegrationTest extends JavaCodeInsightFixtureTestC
private MessageDigest myMessageDigest;
private List<String> diffs = new ArrayList<String>();
private boolean nullableMethodRegistryValue;
@Override
protected void setUp() throws Exception {
super.setUp();
myMessageDigest = BytecodeAnalysisConverter.getMessageDigest();
RegistryValue registryValue = Registry.get(ProjectBytecodeAnalysis.NULLABLE_METHOD);
nullableMethodRegistryValue = registryValue.asBoolean();
registryValue.setValue(true);
}
@Override
protected void tearDown() throws Exception {
Registry.get(ProjectBytecodeAnalysis.NULLABLE_METHOD).setValue(nullableMethodRegistryValue);
super.tearDown();
}
@NotNull