Search in sources :

Example 1 with InspectionToolProvider

use of com.intellij.codeInspection.InspectionToolProvider in project intellij-community by JetBrains.

the class DaemonAnalyzerTestCase method createLocalInspectionTools.

protected static LocalInspectionTool[] createLocalInspectionTools(final InspectionToolProvider... provider) {
    final ArrayList<LocalInspectionTool> result = new ArrayList<>();
    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()]);
}
Also used : TIntArrayList(gnu.trove.TIntArrayList) ArrayList(java.util.ArrayList) LocalInspectionTool(com.intellij.codeInspection.LocalInspectionTool) InspectionToolProvider(com.intellij.codeInspection.InspectionToolProvider) IOException(java.io.IOException)

Aggregations

InspectionToolProvider (com.intellij.codeInspection.InspectionToolProvider)1 LocalInspectionTool (com.intellij.codeInspection.LocalInspectionTool)1 TIntArrayList (gnu.trove.TIntArrayList)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1