protected static LocalInspectionTool[] createLocalInspectionTools( final InspectionToolProvider... provider) { final ArrayList<LocalInspectionTool> result = new ArrayList<LocalInspectionTool>(); for (InspectionToolProvider toolProvider : provider) { for (Class aClass : toolProvider.getInspectionClasses()) { try { final Object tool = aClass.newInstance(); assertTrue(tool instanceof LocalInspectionTool); result.add((LocalInspectionTool) tool); } catch (Exception e) { LOG.error(e); } } } return result.toArray(new LocalInspectionTool[result.size()]); }
protected void enableInspectionToolsFromProvider(InspectionToolProvider toolProvider) { try { for (Class c : toolProvider.getInspectionClasses()) { enableInspectionTool((InspectionProfileEntry) c.newInstance()); } } catch (Exception e) { throw new RuntimeException(e); } }