This commit is contained in:
Alexey Kudravtsev
2013-06-24 10:35:41 +04:00
parent 32b39b3d7d
commit c2f5d602a5
5 changed files with 12 additions and 8 deletions
@@ -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);
@@ -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)
@@ -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;
}
});
@@ -243,6 +243,7 @@ public abstract class InspectionProfileEntry {
}
}
@NotNull
public static Collection<String> 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<? extends InspectionProfileEntry> getDescriptionContextClass() {
return getClass();
}
@@ -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<ProfileChangeAdapter> 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;