return bugCollection.lookupFromUniqueId(uniqueId);
BugInstance bug = bugCollection.lookupFromUniqueId(uniqueId); if (bug == null) { return null; } assert bug.getUniqueId().equals(uniqueId); return bug;
	public static BugInstance findBugInstanceForMarker(IMarker marker) {		IResource resource = marker.getResource();		if (resource == null) {			// Also shouldn't happen.			FindbugsPlugin.getDefault().logError("No resource for warning marker");			return null;		}		IProject project = resource.getProject();		if (project == null) {			// Also shouldn't happen.			FindbugsPlugin.getDefault().logError("No project for warning marker");			return null;		}		try {			String markerType = marker.getType();			//System.out.println("Marker type is " + markerType);			if (!markerType.equals(FindBugsMarker.NAME)) {				FindbugsPlugin.getDefault().logError("Selected marker is not a FindBugs marker");				return null;			}			// We have a FindBugs marker.  Get the corresponding BugInstance.			String uniqueId = marker.getAttribute(FindBugsMarker.UNIQUE_ID, null);			if (uniqueId == null) {				FindbugsPlugin.getDefault().logError("Marker does not contain unique id for warning");				return null;			}			BugCollection bugCollection = FindbugsPlugin.getBugCollection(project, null);			if (bugCollection == null) {				FindbugsPlugin.getDefault().logError("Could not get BugCollection for FindBugs marker");				return null;			}			return bugCollection.lookupFromUniqueId(uniqueId);		} catch (RuntimeException e) {			throw e;		} catch (Exception e) {			// Multiple exception types caught here			FindbugsPlugin.getDefault().logException(e, "Could not get BugInstance for FindBugs marker");			return null;		}	}