Community
Participate
Working Groups
The following NPE happend while hovering over a callout binding (of CompletionAdaptor.CreateMethodMappingCompletionProposal.MyJavaLinkedModeProposal) java.lang.NullPointerException at org.eclipse.jdt.internal.core.SourceRefElement.getAnnotations(SourceRefElement.java:115) at org.eclipse.objectteams.otdt.internal.core.MethodMapping.getAnnotations(MethodMapping.java:763) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getAnnotations(JavadocHover.java:957) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.addAnnotations(JavadocHover.java:937) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:604) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:555) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:547) at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:141) at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:82) at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:166)
Created attachment 179156 [details] Fix with one test Fixed by these steps: * include annotations in transformations by SourceElementNotifier and CompilationUnitStructureRequestor * don't let MethodMapping.getAnnotation(s) delegate to the IMethod - meanwhile MethodMappings are JavaElements and support getElementInfo() directly. BTW: we might want to reconsider class MethodMappingInfo, which essentially duplicates ISourceElementRequestor.MappingInfo and subclasses. However, such changes would need to respect ClassFileInfo which currently uses MethodMappingInfo for creating method mappings from bytecode attributes.
Fix has been committed as r823 / r824.
Verified using I201009211735
.