diff --git a/platform/analysis-api/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java b/platform/analysis-api/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java index 779910576f5f..d6df865c7130 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java @@ -60,13 +60,9 @@ public abstract class InspectionToolWrapper other) { myEP = other.myEP; // we need to create a copy for buffering - if (myEP != null) { + if (other.myTool != null) { //noinspection unchecked - myTool = (T)myEP.instantiateTool(); - } - else if (other.myTool != null) { - //noinspection unchecked - myTool = (T)InspectionToolsRegistrarCore.instantiateTool(other.myTool.getClass()); + myTool = myEP != null ? (T)myEP.instantiateTool() : (T)InspectionToolsRegistrarCore.instantiateTool(other.myTool.getClass()); } else { myTool = null;