int lastDollar = qualifiedClassName.lastIndexOf('$'); boolean isInnerClass = lastDollar > 0;
Matcher m = fullName.matcher(qualifiedClassName); IType type;
	public static IResource getUnderlyingResource(BugInstance bug, IProject project)		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();			}		}		else {			packageName = primarySourceLineAnnotation.getPackageName();			qualifiedClassName = primarySourceLineAnnotation.getClassName();		}		if (qualifiedClassName == null) {			return null;		}		if (Reporter.DEBUG) {			System.out.println("Looking up class: " //$NON-NLS-1$			+ packageName + ", " //$NON-NLS-1$			+ qualifiedClassName);		}		int lastDollar = qualifiedClassName.lastIndexOf('$');		boolean isInnerClass = lastDollar > 0;		String innerName = null;		IType type = null;		if (isInnerClass) {			// cut the useless number value			innerName = qualifiedClassName.substring(lastDollar + 1);			String shortQualifiedClassName =				qualifiedClassName.substring(0, lastDollar);			type = Reporter.getJavaProject(project).findType(shortQualifiedClassName);			/*			 * code below only points to the first line of inner class			 * even if this is not a class bug but field bug			 */			completeInnerClassInfo(qualifiedClassName, innerName, type, bug);		} else {			type = Reporter.getJavaProject(project).findType(qualifiedClassName);		}		// reassign it as it may be changed for inner classes		primarySourceLineAnnotation = bug.getPrimarySourceLineAnnotation();		int startLine;		/*		 *  Eclipse can help us find the line number for fields => we trying to add line		 *  info for fields here		 */		if (primarySourceLineAnnotation != null) {			startLine = primarySourceLineAnnotation.getStartLine();			if(startLine <= 0 && bug.getPrimaryField() != null){				completeFieldInfo(qualifiedClassName, innerName, type, bug);			}		} else {			if(bug.getPrimaryField() != null){				completeFieldInfo(qualifiedClassName, innerName, type, bug);			}		}		if (type != null) {			return type.getUnderlyingResource();		}		return null;	}