#ref #loc
synchronization.on.method.parameter.problem.descriptor=Synchronization on method parameter #ref #loc
too.broad.catch.quickfix=Add ''catch'' clause for ''{0}''
+replace.with.catch.clause.for.runtime.exception.quickfix=Replace with 'catch' clause for 'RuntimeException'
too.broad.catch.option=&Only warn on RuntimeException, Exception, Error or Throwable
unnecessary.call.to.string.valueof.display.name=Unnecessary call to 'String.valueOf()'
unnecessary.tostring.call.display.name=Unnecessary call to 'toString()'
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/TooBroadCatchInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/TooBroadCatchInspectionBase.java
index eb292f4f644f..d225e64f225a 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/TooBroadCatchInspectionBase.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/TooBroadCatchInspectionBase.java
@@ -21,7 +21,6 @@ import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.psiutils.ClassUtils;
import com.siyeh.ig.psiutils.ExceptionUtils;
-import com.siyeh.ig.psiutils.TestUtils;
import org.jetbrains.annotations.NotNull;
import java.util.*;
@@ -29,8 +28,8 @@ import java.util.*;
public class TooBroadCatchInspectionBase extends BaseInspection {
@SuppressWarnings({"PublicField"})
public boolean onlyWarnOnRootExceptions = false;
- @SuppressWarnings("PublicField")
- public boolean ignoreInTestCode = false;
+ @SuppressWarnings({"PublicField", "UnusedDeclaration"})
+ public boolean ignoreInTestCode = false; // keep for compatibility
@SuppressWarnings("PublicField")
public boolean ignoreThrown = false;
@@ -80,9 +79,6 @@ public class TooBroadCatchInspectionBase extends BaseInspection {
if (tryBlock == null) {
return;
}
- if (ignoreInTestCode && TestUtils.isInTestCode(statement)) {
- return;
- }
final SetUse the first checkbox below to have this inspection only warn on the most generic exceptions.
-Use the second checkbox below to ignore overly broad catch blocks in test code. -
-Use the third checkbox below to ignore any exceptions which hide other exceptions, but which may be thrown and thus +Use the second checkbox below to ignore any exceptions which hide other exceptions, but which may be thrown and thus are technically not overly broad.