private IResource getUnderlyingResource(BugInstance bug) { try { SourceLineAnnotation primarySourceLineAnnotation = bug.getPrimarySourceLineAnnotation(); if (primarySourceLineAnnotation != null) { String packageName = primarySourceLineAnnotation.getPackageName(); String qualifiedClassName = primarySourceLineAnnotation.getClassName(); if (DEBUG) { System.out.println( "Looking up class: " + packageName + ", " + qualifiedClassName); } IType type = getJavaProject().findType(qualifiedClassName); if (type != null) { IResource res = type.getUnderlyingResource(); if (res != null) { return res; } }
private IResource getUnderlyingResource(BugInstance bug) throws JavaModelException { SourceLineAnnotation primarySourceLineAnnotation = bug.getPrimarySourceLineAnnotation(); PackageMemberAnnotation packageAnnotation = null; String packageName = null; String qualifiedClassName = null; if(primarySourceLineAnnotation == null){ packageAnnotation = bug.getPrimaryClass(); if(packageAnnotation != null){ packageName = packageAnnotation.getPackageName(); qualifiedClassName = packageAnnotation.getClassName();
	private IResource getUnderlyingResource(BugInstance bug) {		try {			SourceLineAnnotation primarySourceLineAnnotation =				bug.getPrimarySourceLineAnnotation();			if (primarySourceLineAnnotation != null) {				String packageName = primarySourceLineAnnotation.getPackageName();				String qualifiedClassName =					primarySourceLineAnnotation.getClassName();				if (DEBUG) {					System.out.println(						"Looking up class: "							+ packageName							+ ", "							+ qualifiedClassName);				}				IType type = getJavaProject().findType(qualifiedClassName);				if (type != null) {					IResource res = type.getUnderlyingResource();					if (res != null) {						return res;					}				}			}		}		catch (JavaModelException e) {			e.printStackTrace();		}		return null;	}