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

Bug 319837

Summary: Exception when hovering over TODO
Product: [Eclipse Project] JDT Reporter: Benjamin Muskalla <b.muskalla>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, daniel_megert, deepakazad, Olivier_Thomann
Version: 3.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Benjamin Muskalla CLA 2010-07-14 07:58:02 EDT
class A {

  public static void main(String[] args) {
     // TODO
  }
  
}

Hover over TODO

-- Error Details --
Date: Wed Jul 14 13:56:03 CEST 2010
Message: Internal Error
Severity: Error
Product: Eclipse SDK 3.6.0.v201006080911 (org.eclipse.sdk.ide)
Plugin: org.eclipse.jdt.ui
Session Data:
eclipse.buildId=I20100608-0911
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -showLocation -showLocation -showLocation
Command-line arguments:  -os linux -ws gtk -arch x86 -showLocation -showLocation -data /projects/egit -showLocation


Exception Stack Trace:
Java Model Exception: Java Model Status [Unknown javadoc format for TODO {key=Lcom/sun/xml/internal/bind/v2/TODO;} [in TODO.class [in com.sun.xml.internal.bind.v2 [in /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/rt.jar]]]]
	at org.eclipse.jdt.internal.core.JavadocContents.getTypeDoc(JavadocContents.java:78)
	at org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc(BinaryType.java:997)
	at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:470)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:609)
	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)
Comment 1 Dani Megert CLA 2010-07-14 09:08:52 EDT
>TODO should not show javadoc hover
This is already covered by bug 56473. And of course it should not log exceptions. Using this bug to fix the exception.

Important is to use Java 6 from Oracle/Sun.
Comment 2 Dani Megert CLA 2010-07-14 09:56:39 EDT
Jay, please also look at the other "[Unknown javadoc format for ...]" bug reports.
Comment 3 Olivier Thomann CLA 2010-07-14 09:58:07 EDT
I think if there is a legitimate javadoc hovering and the javadoc could not be found or the format is unknown, it makes sense to log it so we can potentially fix a bug.
Comment 4 Dani Megert CLA 2010-07-14 10:06:07 EDT
(In reply to comment #3)
> I think if there is a legitimate javadoc hovering and the javadoc could not be
> found or the format is unknown, it makes sense to log it so we can potentially
> fix a bug.
Yes, of course. With
>And of course it should not log exceptions.
I meant that we have to fix the bug so that nothing gets logged ;-)
Comment 5 Jay Arthanareeswaran CLA 2010-07-15 07:58:30 EDT
There doesn't seem to be anything wrong with the code. The exception is thrown because the Javadoc doesn't have a valid format - JavadocConstants.START_OF_CLASS_DATA can not be found in TODO.html.

Fixing bug 56473 should take care of this one too.
Comment 6 Jay Arthanareeswaran CLA 2010-09-06 07:00:54 EDT
It so happens that there is a class by name TODO with incorrectly generated Javadoc - The generated HTML misses the following mandatory tag 

<!-- ======== START OF CLASS DATA ======== -->

So, even though we are not supposed to be looking up type TODO, which is what bug 56473 is about, the exception thrown is expected. Marking as a duplicate.

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