use of edu.umd.cs.findbugs.Project in project spotbugs by spotbugs.
the class MainFrame method shouldDisplayIssue.
// @SuppressWarnings({ "SimplifiableIfStatement" })
boolean shouldDisplayIssue(BugInstance b) {
Project project = getProject();
Filter suppressionFilter = project.getSuppressionFilter();
if (null == getBugCollection() || suppressionFilter.match(b)) {
return false;
}
return viewFilter.show(b);
}
use of edu.umd.cs.findbugs.Project in project spotbugs by spotbugs.
the class MainFrame method redoAnalysis.
void redoAnalysis() {
// / QQQ-TODO: new RuntimeException("Redo analysis called").printStackTrace();
acquireDisplayWait();
edu.umd.cs.findbugs.util.Util.runInDameonThread(() -> {
try {
Project project = getProject();
BugCollection bc = BugLoader.redoAnalysisKeepComments(project);
updateProjectAndBugCollection(bc);
setProjectAndBugCollectionInSwingThread(project, bc);
} finally {
releaseDisplayWait();
}
});
}
use of edu.umd.cs.findbugs.Project in project spotbugs by spotbugs.
the class MainFrame method updateTitle.
/**
* Changes the title based on curProject and saveFile.
*/
public void updateTitle() {
Project project = getProject();
String name = project.getProjectName();
if ((name == null || "".equals(name.trim())) && saveFile != null) {
name = saveFile.getAbsolutePath();
}
if (name == null) {
// Project.UNNAMED_PROJECT;
name = "";
}
String oldTitle = this.getTitle();
String newTitle = TITLE_START_TXT + ("".equals(name.trim()) ? "" : " - " + name);
if (oldTitle.equals(newTitle)) {
return;
}
this.setTitle(newTitle);
}
use of edu.umd.cs.findbugs.Project in project spotbugs by spotbugs.
the class MainFrame method openBugCollection.
public void openBugCollection(SortedBugCollection bugs) {
acquireDisplayWait();
try {
mainFrameLoadSaveHelper.prepareForFileLoad(null, null);
Project project = bugs.getProject();
project.setGuiCallback(guiCallback);
BugLoader.addDeadBugMatcher(bugs);
setProjectAndBugCollectionInSwingThread(project, bugs);
} finally {
releaseDisplayWait();
}
}
use of edu.umd.cs.findbugs.Project in project spotbugs by spotbugs.
the class MainFrame method setProjectAndBugCollection.
@SwingThread
private void setProjectAndBugCollection(@CheckForNull Project project, @CheckForNull BugCollection bugCollection) {
if (GUI2_DEBUG) {
if (bugCollection == null) {
System.out.println("Setting bug collection to null");
} else {
System.out.println("Setting bug collection; contains " + bugCollection.getCollection().size() + " bugs");
}
}
if (bugCollection != null && bugCollection.getProject() != project) {
Project p2 = bugCollection.getProject();
throw new IllegalArgumentException(String.format("project %x and bug collection %x don't match", System.identityHashCode(project), System.identityHashCode(p2)));
}
acquireDisplayWait();
try {
// setRebuilding(false);
setProject(project);
this.bugCollection = bugCollection;
BugLoader.addDeadBugMatcher(bugCollection);
displayer.clearCache();
mainFrameTree.updateBugTree();
setProjectChanged(false);
Runnable runnable = () -> {
PreferencesFrame.getInstance().updateFilterPanel();
mainFrameMenu.getReconfigMenuItem().setEnabled(true);
mainFrameMenu.setViewMenu();
newProject();
clearSourcePane();
clearSummaryTab();
/*
* This is here due to a threading issue. It can only be
* called after curProject has been changed. Since this
* method is called by both open methods it is put here.
*/
updateTitle();
};
if (SwingUtilities.isEventDispatchThread()) {
runnable.run();
} else {
SwingUtilities.invokeLater(runnable);
}
} finally {
releaseDisplayWait();
}
}
Aggregations