/** * Create a new BugInstance. This is the constructor that should be used by * Detectors. * * @param detector * the Detector2 that is reporting the BugInstance * @param type * the bug type * @param priority * the bug priority */ public BugInstance(Detector2 detector, String type, int priority) { this(type, priority); if (detector != null) { // Adjust priority if required String detectorName = detector.getDetectorClassName(); adjustForDetector(detectorName); } }
System.out.println("Applying " + detector.getDetectorClassName() + " to " + classDescriptor); detector.visitClass(classDescriptor); } catch (ClassFormatException e) { logRecoverableException(classDescriptor, detector, e); detector.finishPass();
private static void doRunDetectorOnClass(Detector2 pluginDetector, Class<?> classToTest, BugReporter bugReporter) throws Exception { String dottedClassName = classToTest.getName(); ClassDescriptor classDescriptor = createClassDescriptorFromDottedClassName(dottedClassName); pluginDetector.visitClass(classDescriptor); } }
System.out.println("Applying " + detector.getDetectorClassName() + " to " + classDescriptor); detector.visitClass(classDescriptor); } catch (ClassFormatException e) { logRecoverableException(classDescriptor, detector, e); detector.finishPass();
/** * Report an exception that occurred while analyzing a class with a * detector. * * @param classDescriptor * class being analyzed * @param detector * detector doing the analysis * @param e * the exception */ private void logRecoverableException(ClassDescriptor classDescriptor, Detector2 detector, Throwable e) { bugReporter.logError( "Exception analyzing " + classDescriptor.toDottedClassName() + " using detector " + detector.getDetectorClassName(), e); }
/** * Create a new BugInstance. This is the constructor that should be used by * Detectors. * * @param detector * the Detector2 that is reporting the BugInstance * @param type * the bug type * @param priority * the bug priority */ public BugInstance(Detector2 detector, String type, int priority) { this(type, priority); if (detector != null) { // Adjust priority if required String detectorName = detector.getDetectorClassName(); adjustForDetector(detectorName); } }
/** * Report an exception that occurred while analyzing a class with a * detector. * * @param classDescriptor * class being analyzed * @param detector * detector doing the analysis * @param e * the exception */ private void logRecoverableException(ClassDescriptor classDescriptor, Detector2 detector, Throwable e) { bugReporter.logError( "Exception analyzing " + classDescriptor.toDottedClassName() + " using detector " + detector.getDetectorClassName(), e); }