private void initDetectorMaps() {
Iterator<DetectorFactory> iterator = DetectorFactoryCollection.instance().factoryIterator();
while (iterator.hasNext()) {
DetectorFactory factory = iterator.next();
Set<BugPattern> patterns = factory.getReportedBugPatterns();
for (BugPattern pattern : patterns) {
Set<DetectorFactory> set = patternToFactory.get(pattern);
if (set == null) {
set = new TreeSet<DetectorFactory>(new Comparator<DetectorFactory>() {
public int compare(DetectorFactory f1, DetectorFactory f2) {
return f1.getFullName().compareTo(f2.getFullName());
}
});
patternToFactory.put(pattern, set);
}
set.add(factory);
Set<Plugin> pset = patternToPlugin.get(pattern);
if (pset == null) {
pset = new TreeSet<Plugin>(new Comparator<Plugin>() {
public int compare(Plugin f1, Plugin f2) {
return f1.getPluginId().compareTo(f2.getPluginId());
}
});
patternToPlugin.put(pattern, pset);
}
pset.add(factory.getPlugin());
}
}
}