Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 397447 - [hovering] Code polishing for the package Javadoc hovering feature.
Summary: [hovering] Code polishing for the package Javadoc hovering feature.
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 4.3 M5   Edit
Assignee: Martin Mathew CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 398272
Blocks: 396809
  Show dependency tree
 
Reported: 2013-01-04 09:24 EST by Martin Mathew CLA
Modified: 2013-01-29 02:32 EST (History)
2 users (show)

See Also:
daniel_megert: review+


Attachments
The polished code is attached as patch (2.24 KB, patch)
2013-01-04 09:33 EST, Martin Mathew CLA
daniel_megert: review+
Details | Diff
Fix (2.02 KB, patch)
2013-01-08 02:10 EST, Martin Mathew CLA
no flags Details | Diff
Proposed Fix. (1.30 KB, patch)
2013-01-22 07:59 EST, Martin Mathew CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mathew CLA 2013-01-04 09:24:53 EST
Some minor miscellaneous code changes for the package hovering feature.
Comment 1 Martin Mathew CLA 2013-01-04 09:33:34 EST
Created attachment 225215 [details]
The polished code is attached as patch
Comment 2 Dani Megert CLA 2013-01-05 04:49:22 EST
I've already fixed the toOSString() with the fix for bug 397464, so I only applied the change in ProposalInfo:

Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=046ee0128866e0a27a85f295b682656c3af84b92


Some other thing to polish: if no Javadoc is available (e.g. for 'sun.awt.im') we log an error. This is not good.
Comment 3 Dani Megert CLA 2013-01-07 08:36:00 EST
I also get exceptions when hovering over a field in the compare editor (e.g. when comparing org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo with some older version and hover over 'fOrginalFolders':

!ENTRY org.eclipse.jdt.ui 4 10001 2013-01-07 14:33:46.863
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Java Model Status [<project root> [in  ] is not on its project's build path]
	at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:508)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:521)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:258)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:244)
	at org.eclipse.jdt.internal.core.PackageFragmentRoot.getKind(PackageFragmentRoot.java:481)
	at org.eclipse.jdt.internal.corext.javadoc.JavaDocLocations.getExplanationForMissingJavadoc(JavaDocLocations.java:647)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:651)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:567)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:559)
	at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:163)
	at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:129)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:85)
	at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:166)
!SUBENTRY 1 org.eclipse.jdt.core 4 1006 2013-01-07 14:33:46.863
!MESSAGE <project root> [in  ] is not on its project's build path
Comment 4 Dani Megert CLA 2013-01-07 09:14:57 EST
(In reply to comment #3)
> I also get exceptions when hovering over a field in the compare editor (e.g.
> when comparing org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo with
> some older version and hover over 'fOrginalFolders':
> 
Test Case:
1. paste this:
public class Bug {
	/**
	 * This works as it has Javadoc.
	 */
	void foo() {
	}
}
2. make a change and save
3. compare with previous version
4. on the right side hover over 'Bug'
==> exception and hover talking about the exception
Comment 5 Martin Mathew CLA 2013-01-08 02:10:50 EST
Created attachment 225325 [details]
Fix

This patch contains the fix for 
1. if no Javadoc is available (e.g. for 'sun.awt.im') we log an error.
2. exceptions when hovering over a field in the compare editor.
Comment 6 Dani Megert CLA 2013-01-08 07:36:48 EST
(In reply to comment #5)
> Created attachment 225325 [details] [diff]
> Fix
> 
> This patch contains the fix for 
> 1. if no Javadoc is available (e.g. for 'sun.awt.im') we log an error.

Not really. I still get:

!ENTRY org.eclipse.jdt.core 4 1008 2013-01-08 13:35:07.565
!MESSAGE Cannot retrieve the attached javadoc for sun.awt.im [in C:\JavaSDKs\jdk7-fcs-bin-b147\jre\lib\rt.jar]


> 2. exceptions when hovering over a field in the compare editor.
This seems to be gone.


Did not look at the code.
Comment 7 Martin Mathew CLA 2013-01-22 07:59:31 EST
Created attachment 225936 [details]
Proposed Fix.

Since bug 398272 is resolved, the problem with throwing an exception when the Javadoc content is not available is resolved.

The fix for Javadoc hover showing an exception in compare editor is done.
Comment 8 Dani Megert CLA 2013-01-22 09:47:12 EST
Thanks for the patch Manju.

Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=9528419f8d69d6adccd9dc68a70e733ca59b54e3
Comment 9 Dani Megert CLA 2013-01-22 10:18:24 EST
.
Comment 10 Dani Megert CLA 2013-01-29 02:32:49 EST
*** Bug 399291 has been marked as a duplicate of this bug. ***