boolean runAsJob = store.getBoolean(FindBugsConstants.KEY_RUN_ANALYSIS_AS_EXTRA_JOB);
FindBugsJob fbJob = new StartedFromBuilderJob("Finding bugs in " + resource.getName() + "...", resource, resources);
if(runAsJob) {
// run asynchronously, so there might be more similar jobs waiting to run
FindBugsJob.cancelSimilarJobs(fbJob);
fbJob.scheduleAsSystem();
} else {
// run synchronously (in same thread)
fbJob.run(monitor);
}
}