duplicate throws: ensure checks are proceed with correct type after first problem detected (IDEA-145542)

This commit is contained in:
Anna Kozlova
2015-09-25 15:43:12 +03:00
parent 2da2ff75fa
commit 06eecb0b1d
3 changed files with 11 additions and 2 deletions
@@ -63,8 +63,8 @@ public class DuplicateThrowsInspection extends BaseJavaBatchLocalInspectionTool
PsiJavaCodeReferenceElement[] refs = throwsList.getReferenceElements();
PsiClassType[] types = throwsList.getReferencedTypes();
for (int i = 0; i < types.length; i++) {
PsiClassType type = types[i];
for (int j = i+1; j < types.length; j++) {
PsiClassType type = types[i];
PsiClassType otherType = types[j];
String problem = null;
PsiJavaCodeReferenceElement ref = refs[i];
@@ -0,0 +1,7 @@
// "Suppress for method" "false"
import java.io.FileNotFoundException;
import java.io.IOException;
class Main {
public void test() throws Exce<caret>ption, FileNotFoundException, IOException {}
}
@@ -19,6 +19,7 @@ import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.accessStaticViaInstance.AccessStaticViaInstance;
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
import com.intellij.codeInspection.deprecation.DeprecationInspection;
import com.intellij.codeInspection.duplicateThrows.DuplicateThrowsInspection;
import com.intellij.codeInspection.javaDoc.JavaDocReferenceInspection;
import com.intellij.codeInspection.sillyAssignment.SillyAssignmentInspection;
import com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection;
@@ -43,7 +44,8 @@ public class Suppress15InspectionsTest extends LightQuickFixParameterizedTestCas
new AccessStaticViaInstance(),
new DeprecationInspection(),
new JavaDocReferenceInspection(),
new UncheckedWarningLocalInspection()
new UncheckedWarningLocalInspection(),
new DuplicateThrowsInspection()
};
}