if (index >= 0) {
BugAnnotation theAnnotation = bug.getAnnotationsForMessage(false).get(index);
findLocation: try {
if (theAnnotation instanceof SourceLineAnnotation) {
SourceLineAnnotation sla = (SourceLineAnnotation) theAnnotation;
int line = sla.getStartLine();
EditorUtil.goToLine(activeEditor, line);
return;
} else if (theAnnotation instanceof MethodAnnotation) {
MethodAnnotation ma = (MethodAnnotation) theAnnotation;
String className = ma.getClassName();
IJavaProject project = getIProject();
IType type = project.findType(className);
if (type == null) {
break findLocation;
}
IMethod m = getIMethod(type, ma);
if (m != null) {
JavaUI.openInEditor(m, true, true);
} else {
activeEditor = JavaUI.openInEditor(type, true, true);
SourceLineAnnotation sla = ma.getSourceLines();
EditorUtil.goToLine(activeEditor, sla.getStartLine());
}
return;
} else if (theAnnotation instanceof FieldAnnotation) {
FieldAnnotation fa = (FieldAnnotation) theAnnotation;
String className = fa.getClassName();
IJavaProject project = getIProject();
IType type = project.findType(className);
if (type == null) {
break findLocation;
}
IField f = type.getField(fa.getFieldName());
if (f != null) {
JavaUI.openInEditor(f, true, true);
} else {
activeEditor = JavaUI.openInEditor(type, true, true);
SourceLineAnnotation sla = fa.getSourceLines();
EditorUtil.goToLine(activeEditor, sla.getStartLine());
}
return;
} else if (theAnnotation instanceof TypeAnnotation) {
TypeAnnotation fa = (TypeAnnotation) theAnnotation;
String className = ClassName.fromFieldSignature(fa.getTypeDescriptor());