FindbugsPlugin.getDefault().logError("Marker does not contain unique id for warning");
return null;
}
try {
BugCollection bugCollection = FindbugsPlugin.getBugCollection(project, null);
if (bugCollection == null) {
FindbugsPlugin.getDefault().logError("Could not get BugCollection for FindBugs marker");
return null;
}
String bugType = (String) marker.getAttribute(FindBugsMarker.BUG_TYPE);
Integer primaryLineNumber = (Integer) marker.getAttribute(FindBugsMarker.PRIMARY_LINE);
// compatibility
if (primaryLineNumber == null) {
primaryLineNumber = Integer.valueOf(getEditorLine(marker));
}
if (bugType == null) {
FindbugsPlugin.getDefault().logError(
"Could not get find attributes for marker " + marker + ": (" + bugId + ", " + primaryLineNumber + ")");
return null;
}
BugInstance bug = bugCollection.findBug(bugId, bugType, primaryLineNumber.intValue());
if(bug == null) {
FindbugsPlugin.getDefault().logError(
"Could not get find bug for marker on " + resource + ": (" + bugId + ", " + primaryLineNumber + ")");
return null;
}