diff --git a/java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightSuppressedWarningsHandler.java b/java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightSuppressedWarningsHandler.java index 85835a8fcff1..9d6fe8845a82 100644 --- a/java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightSuppressedWarningsHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightSuppressedWarningsHandler.java @@ -118,11 +118,11 @@ public class HighlightSuppressedWarningsHandler extends HighlightUsagesHandlerBa if (!(value instanceof String)) { continue; } - InspectionToolWrapper toolById = ((InspectionProfileImpl)inspectionProfile).getToolById((String)value, target); - if (!(toolById instanceof LocalInspectionToolWrapper)) { + InspectionToolWrapper toolWrapperById = ((InspectionProfileImpl)inspectionProfile).getToolById((String)value, target); + if (!(toolWrapperById instanceof LocalInspectionToolWrapper)) { continue; } - final LocalInspectionToolWrapper toolWrapper = ((LocalInspectionToolWrapper)toolById).createCopy(); + final LocalInspectionToolWrapper toolWrapper = ((LocalInspectionToolWrapper)toolWrapperById).createCopy(); final InspectionManagerEx managerEx = (InspectionManagerEx)InspectionManager.getInstance(project); final GlobalInspectionContextImpl context = managerEx.createNewGlobalContext(false); toolWrapper.initialize(context); diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/RemoveRedundantUncheckedSuppressionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/RemoveRedundantUncheckedSuppressionTest.java index 1101f6762ee9..4afe45903fcc 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/RemoveRedundantUncheckedSuppressionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/RemoveRedundantUncheckedSuppressionTest.java @@ -32,7 +32,7 @@ public class RemoveRedundantUncheckedSuppressionTest extends LightQuickFixTestCa final UncheckedWarningLocalInspection warningLocalInspection = new UncheckedWarningLocalInspection(); final RedundantSuppressInspection inspection = new RedundantSuppressInspection(){ @Override - protected InspectionToolWrapper[] getInspectionTools(PsiElement psiElement, InspectionManager manager) { + protected InspectionToolWrapper[] getInspectionTools(PsiElement psiElement, @NotNull InspectionManager manager) { return new InspectionToolWrapper[]{ new LocalInspectionToolWrapper(varargsInspection), new LocalInspectionToolWrapper(warningLocalInspection) diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantSuppressTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantSuppressTest.java index 816eee99a47a..1d00526eacf7 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantSuppressTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantSuppressTest.java @@ -5,6 +5,7 @@ import com.intellij.codeInspection.ex.*; import com.intellij.codeInspection.i18n.I18nInspection; import com.intellij.psi.PsiElement; import com.intellij.testFramework.InspectionTestCase; +import org.jetbrains.annotations.NotNull; public class RedundantSuppressTest extends InspectionTestCase { private GlobalInspectionToolWrapper myWrapper; @@ -19,7 +20,7 @@ public class RedundantSuppressTest extends InspectionTestCase { myWrapper = new GlobalInspectionToolWrapper(new RedundantSuppressInspection() { @Override - protected InspectionToolWrapper[] getInspectionTools(PsiElement psiElement, InspectionManager manager) { + protected InspectionToolWrapper[] getInspectionTools(PsiElement psiElement, @NotNull InspectionManager manager) { return myInspectionToolWrappers; } }); diff --git a/platform/analysis-api/src/com/intellij/codeInspection/InspectionProfileEntry.java b/platform/analysis-api/src/com/intellij/codeInspection/InspectionProfileEntry.java index 492add7fc8cf..da8b13581290 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/InspectionProfileEntry.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/InspectionProfileEntry.java @@ -243,6 +243,7 @@ public abstract class InspectionProfileEntry { } } + @NotNull public static Collection getBlackList() { synchronized (BLACK_LIST_LOCK) { if (ourBlackList == null) { @@ -270,7 +271,7 @@ public abstract class InspectionProfileEntry { * @param project to be associated with this entry * @deprecated this won't work for inspections configured via {@link com.intellij.codeInspection.InspectionEP} */ - public void projectOpened(Project project) { + public void projectOpened(@NotNull Project project) { } /** @@ -279,7 +280,7 @@ public abstract class InspectionProfileEntry { * @param project to be disassociated from this entry * @deprecated this won't work for inspections configured via {@link com.intellij.codeInspection.InspectionEP} */ - public void projectClosed(Project project) { + public void projectClosed(@NotNull Project project) { } /** @@ -304,6 +305,7 @@ public abstract class InspectionProfileEntry { return ResourceUtil.getResource(getDescriptionContextClass(), "/inspectionDescriptions", fileName); } + @NotNull protected Class getDescriptionContextClass() { return getClass(); } diff --git a/platform/analysis-api/src/com/intellij/profile/DefaultProjectProfileManager.java b/platform/analysis-api/src/com/intellij/profile/DefaultProjectProfileManager.java index e08009d56fdb..ce8310fcdce0 100644 --- a/platform/analysis-api/src/com/intellij/profile/DefaultProjectProfileManager.java +++ b/platform/analysis-api/src/com/intellij/profile/DefaultProjectProfileManager.java @@ -49,6 +49,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager private static final String VERSION = "1.0"; + @NotNull protected final Project myProject; /** This field is used for serialization. Do not rename it or make access weaker */ @@ -63,7 +64,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager private final List myProfilesListener = ContainerUtil.createLockFreeCopyOnWriteList(); @NonNls private static final String PROJECT_DEFAULT_PROFILE_NAME = "Project Default"; - public DefaultProjectProfileManager(final Project project, final ApplicationProfileManager applicationProfileManager, + public DefaultProjectProfileManager(@NotNull final Project project, final ApplicationProfileManager applicationProfileManager, final DependencyValidationManager holder) { myProject = project; myHolder = holder;