Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332982 - [hovering] Exception when showing JavaDoc hover
Summary: [hovering] Exception when showing JavaDoc hover
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-20 17:57 EST by Torkild Resheim CLA
Modified: 2011-01-04 11:58 EST (History)
2 users (show)

See Also:


Attachments
JRE Definition Dialog (185.09 KB, image/png)
2010-12-20 18:02 EST, Torkild Resheim CLA
no flags Details
Fix for the NPEs (3.00 KB, patch)
2011-01-04 11:56 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Torkild Resheim CLA 2010-12-20 17:57:12 EST
When hovering over a base Java class I don't get a tooltip but an exception is thrown instead

java.lang.NullPointerException
at org.eclipse.jdt.internal.corext.javadoc.JavaDocLocations.getBaseURL(JavaDocLocations.java:605)
at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:630)
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)

I've been checking my JavaDoc and source attachments for the JDK being used and they appear to be OK.
Comment 1 Torkild Resheim CLA 2010-12-20 18:02:34 EST
Created attachment 185604 [details]
JRE Definition Dialog

I've checked the contents of both the Src and the JavaDoc jars and they appear normal.
Comment 2 Torkild Resheim CLA 2010-12-20 18:23:58 EST
Switching back to the default JavaDoc location (http://java.sun.com/javase/6/docs/api/) I get the same problem.
Comment 3 Remy Suen CLA 2010-12-20 22:26:26 EST
(In reply to comment #1)
> Created an attachment (id=185604) [details]
> JRE Definition Dialog

Is there supposed to be an exclamation mark in that path?
Comment 4 Torkild Resheim CLA 2010-12-21 02:19:33 EST
(In reply to comment #3)
> (In reply to comment #1)
> > Created an attachment (id=185604) [details]
> > JRE Definition Dialog
> 
> Is there supposed to be an exclamation mark in that path?
I guess so. This is automatically added and I think it is used to separate the path to the jar from the path inside the jar.

Note that when I tested with a fresh Eclipse installation I do not get this problem. So I guess there is something dirty in my settings. I'm reluctant to start assembling a new Eclipse installation but I think that's the quickest solution for me anyway.
Comment 5 Dani Megert CLA 2010-12-21 04:08:34 EST
What's the build id?

Markus, can you please have a look?
Comment 6 Torkild Resheim CLA 2010-12-21 04:39:37 EST
The build id is M20100909-0800.
Comment 7 Markus Keller CLA 2011-01-03 18:46:55 EST
The Javadoc and source paths in comment 1 are looking fine. For classes where source is available, the Javadoc path should not be consulted at all (Javadoc is extracted from source).

I could not reproduce the exception, and AFAICS, this can only happen if the help UI is not available. It looks like the org.eclipse.help.ui plug-in is  missing in your install.

The screenshot also doesn't look like it's coming from a proper SDK install, since the fonts are too big. This happens if -Dorg.eclipse.swt.internal.carbon.smallFonts is missing from the command line (but it's there in the default Eclipse.app/Contents/MacOS/eclipse.ini).

I can add protection against the NPE, but I don't think we need to backport this to 3.6.2.
Comment 8 Dani Megert CLA 2011-01-04 02:57:30 EST
> I can add protection against the NPE, but I don't think we need to backport
> this to 3.6.2.
+1
Comment 9 Markus Keller CLA 2011-01-04 11:56:06 EST
Created attachment 186029 [details]
Fix for the NPEs
Comment 10 Markus Keller CLA 2011-01-04 11:58:38 EST
Fixed in HEAD.

You also get entries like this in the log when org.eclipse.help.ui is not available:
!ENTRY org.eclipse.ui 4 4 2011-01-04 17:51:05.847
!MESSAGE Unable to instantiate help UI