Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 397455

Summary: [hovering] Package Javadoc hover throws NPE if package-info.java contains references
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Martin Mathew <manju656>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P1 CC: daniel_megert, markus.kell.r
Version: 4.3   
Target Milestone: 4.3 M5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
The fix
daniel_megert: review-
JUnits Attached
none
Test data Attached none

Description Markus Keller CLA 2013-01-04 10:37:25 EST
- have pack/package-info.java with contents:

/**
 * The pack is a test package. This doc contains references like
 * {@link Object} and {@link Defaults#foo(String)} and tags:
 * @deprecated use a pick
 * @author me
 */
@org.eclipse.jdt.annotation.NonNullByDefault
@java.lang.Deprecated
@Generated("me")
package pack;

- try to show Javadoc:

Exception in thread "Info view input computer" java.lang.NullPointerException
	at org.eclipse.jdt.internal.ui.viewsupport.JavaElementLinks.createURI(JavaElementLinks.java:295)
	at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.handleLink(JavadocContentAccess2.java:1572)
	at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.handleInlineTagElement(JavadocContentAccess2.java:1161)
	at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.handleContentElements(JavadocContentAccess2.java:1089)
	at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.handleContentElements(JavadocContentAccess2.java:1055)
	at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.toHTML(JavadocContentAccess2.java:796)
	at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:1681)
	at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:1640)
	at org.eclipse.jdt.internal.ui.infoviews.JavadocView.getJavadocHtml(JavadocView.java:1104)
	at org.eclipse.jdt.internal.ui.infoviews.JavadocView.computeInput(JavadocView.java:982)
	at org.eclipse.jdt.internal.ui.infoviews.AbstractInfoView$2.run(AbstractInfoView.java:697)

=> JavadocContentAccess2(IMember, ...) doesn't expect null.
Comment 1 Dani Megert CLA 2013-01-05 04:22:43 EST
Happens because JavadocContentAccess2 is created with 'null' as member.
Comment 2 Martin Mathew CLA 2013-01-07 04:55:51 EST
Created attachment 225268 [details]
The fix

Fix for the bug is attached.
Comment 3 Martin Mathew CLA 2013-01-07 05:29:46 EST
Created attachment 225270 [details]
JUnits Attached

The JUnit testcase is attached.
Comment 4 Martin Mathew CLA 2013-01-07 05:31:26 EST
Created attachment 225271 [details]
Test data Attached
Comment 5 Dani Megert CLA 2013-01-07 09:32:43 EST
Comment on attachment 225268 [details]
The fix

This does not work. Just try the steps from 397464: you'll now get an AFE with your patch.
Comment 6 Martin Mathew CLA 2013-01-23 04:17:40 EST
The fix for this bug is taken care in the fix for bug 397464.
Comment 7 Markus Keller CLA 2013-01-25 11:05:46 EST

*** This bug has been marked as a duplicate of bug 397464 ***