X-Git-Url: https://git.jetbrains.org/?p=idea%2Fcommunity.git;a=blobdiff_plain;f=platform%2FtestFramework%2Fsrc%2Fcom%2Fintellij%2FtestFramework%2Ffixtures%2Fimpl%2FCodeInsightTestFixtureImpl.java;h=8326f588c41d4ff4576df9c94a09ea015d7122f6;hp=12a52ff7399c9fd98bebe1705c6ee05bb0e67262;hb=6248d2e2b0988bb9336b1fc4151b93ae3d6b3084;hpb=74b6cd609d077febd29e6cc472cea806b281bf66 diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java index 12a52ff7399c..8326f588c41d 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java @@ -254,11 +254,14 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig for (InspectionToolProvider provider: providers) { for (Class clazz: provider.getInspectionClasses()) { try { - LocalInspectionTool inspection = (LocalInspectionTool)clazz.getConstructor().newInstance(); - tools.add(inspection); + Object o = clazz.getConstructor().newInstance(); + if (o instanceof LocalInspectionTool) { + LocalInspectionTool inspection = (LocalInspectionTool)o; + tools.add(inspection); + } } catch (Exception e) { - throw new RuntimeException("Cannot instantiate " + clazz); + throw new RuntimeException("Cannot instantiate " + clazz, e); } } }