Skip to content

Commit

Permalink
Fixed bug 435279: [Hover] NPE when Annotation not visible on classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
Manju Mathew authored and noopur2507 committed May 20, 2014
1 parent 25f839b commit 882b452
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,14 @@ private static IBinding resolveSuperclassConstructor(ITypeBinding superClassDecl
}

private static void addAnnotation(StringBuffer buf, IJavaElement element, IAnnotationBinding annotation) throws URISyntaxException {
String uri= JavaElementLinks.createURI(JavaElementLinks.JAVADOC_SCHEME, annotation.getAnnotationType().getJavaElement());
IJavaElement javaElement= annotation.getAnnotationType().getJavaElement();
buf.append('@');
addLink(buf, uri, annotation.getName());
if (javaElement != null) {
String uri= JavaElementLinks.createURI(JavaElementLinks.JAVADOC_SCHEME, javaElement);
addLink(buf, uri, annotation.getName());
} else {
buf.append(annotation.getName());
}

IMemberValuePairBinding[] mvPairs= annotation.getDeclaredMemberValuePairs();
if (mvPairs.length > 0) {
Expand Down

0 comments on commit 882b452

Please sign in to comment.