import edu.umd.cs.findbugs.DetectorFactoryCollection;
public abstract class PrintBugDescriptions {
public void print() throws IOException {
// Ensure bug patterns are loaded
DetectorFactoryCollection factories = DetectorFactoryCollection.instance();
// Find all bug patterns reported by at least one non-disabled detector.
Collection<BugPattern> enabledPatternSet = new HashSet<BugPattern>();
for (Iterator<DetectorFactory> i = factories.factoryIterator(); i.hasNext();) {
DetectorFactory factory = i.next();
if (isEnabled(factory)) {
enabledPatternSet.addAll(factory.getReportedBugPatterns());
}
}