コード例 #1
0
 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()]);
 }
コード例 #2
0
 protected void enableInspectionToolsFromProvider(InspectionToolProvider toolProvider) {
   try {
     for (Class c : toolProvider.getInspectionClasses()) {
       enableInspectionTool((InspectionProfileEntry) c.newInstance());
     }
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
 }