if (elementToFind != null) {
oldSourceRanges = (HashMap) this.sourceRanges.clone();
}
try {
IProblemFactory factory = new DefaultProblemFactory();
SourceElementParser parser = null;
this.anonymousClassName = 0;
if (info == null) {
try {
info = (IBinaryType) this.binaryType.getElementInfo();
} catch(JavaModelException e) {
return null;
}
}
boolean isAnonymousClass = info.isAnonymous();
char[] fullName = info.getName();
if (isAnonymousClass) {
String eltName = this.binaryType.getParent().getElementName();
eltName = eltName.substring(eltName.lastIndexOf('$') + 1, eltName.length());
try {
this.anonymousClassName = Integer.parseInt(eltName);
} catch(NumberFormatException e) {
// ignore
}
}
boolean doFullParse = hasToRetrieveSourceRangesForLocalClass(fullName);
parser = new SourceElementParser(this, factory, new CompilerOptions(this.options), doFullParse, true/*optimize string literals*/);
parser.javadocParser.checkDocComment = false; // disable javadoc parsing
IJavaElement javaElement = this.binaryType.getCompilationUnit();
if (javaElement == null) javaElement = this.binaryType.getParent();
parser.parseCompilationUnit(
new BasicCompilationUnit(contents, null, this.binaryType.sourceFileName(info), javaElement),
doFullParse,
null/*no progress*/);
if (elementToFind != null) {
ISourceRange range = getNameRange(elementToFind);