This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | [cc] NPE thrown when any link in javadoc window is clicked | ||
---|---|---|---|
Product: | editor | Reporter: | Jiri Kovalsky <jkovalsky> |
Component: | -- Other -- | Assignee: | Martin Roskanin <mroskanin> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | dbalek, mmetelka, mroskanin, ppisl |
Priority: | P3 | Keywords: | REGRESSION |
Version: | 5.x | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | NPE thrown when link in javadoc help window is clicked |
Description
Jiri Kovalsky
2005-08-03 13:43:56 UTC
Created attachment 23458 [details]
NPE thrown when link in javadoc help window is clicked
Raising priority after some discussion in our QE department. Please note that links in Java completion window work fine. Resolved - please read comments below. However the fix is not an ideal fix due to following reasons. In the nb5.0 the Editor Code Completion API has been introduced along with changes in the way how the javadoc window behaves. AFAIK in the nb4.1 the javadoc links navigation was handled by the component itself since the browser knew what is the URL from which the provided text has been displayed and so was able to resolve these links a properly navigate among more files/anchors. Now, in the 5.0, the module code is required to handle the hyperlinks itself. CompletionDocumentation.resolveLink(...) is called whenever the user clicks to a link in the javadoc window. This method is required to return a new instance of the CompletionDocumentation object for the selected hyperlink target. This is the problematic part at least from the HTML javadoc point of view. I cannot simply resolve from the link which part of the document to show. I can determine appropriate file, but I cannot determine exact part of the documennt text based on the anchor. I can find the anchor itself, but I cannot determine where is an end of the section referenced by the anchor. The fix of this issue works as when I find the anchor in the document I cut the text before the anchor and pass the rest into the javadoc window. So it behaves "similar" to the 4.1. However this hack has at least following problem. When I cut the text on the anchor line some significant open tags in the cut text can be removed and so the html code is not rendered well. So the solution would be to allow the javadoc component to handle the links itself (for example when I return null from the resolveLink) or at least to provide a way to return an offset or something similar to say the javadoc component to scroll to it in the returned text. Editor guys, I would like to resolve this problem somehow into 5.0. Meanwhile I am at least downgrading this issue to P3 (the NPE is fixed and the linking works for most cases). Checking in src/org/netbeans/editor/ext/html/HTMLCompletionQuery.java; /cvs/html/editor/lib/src/org/netbeans/editor/ext/html/HTMLCompletionQuery.java,v <-- HTMLCompletionQuery.java new revision: 1.12; previous revision: 1.11 done Checking in src/org/netbeans/editor/ext/html/javadoc/HelpManager.java; /cvs/html/editor/lib/src/org/netbeans/editor/ext/html/javadoc/HelpManager.java,v <-- HelpManager.java new revision: 1.3; previous revision: 1.2 done Based on our offline agreement I am reassigning this issue to editor team. We agreed to use default navigation mechanism when CompletionDocumentation.resolveLink(...) returns null. See my previous comments to the problem. This is an editor regression in comparison with previous release. fixed in [maintrunk] Checking in src/org/netbeans/modules/editor/completion/DocumentationScrollPane.java; /cvs/editor/completion/src/org/netbeans/modules/editor/completion/DocumentationScrollPane.java,v <-- DocumentationScrollPane.java new revision: 1.6; previous revision: 1.5 Checking in editor/lib/src/org/netbeans/editor/ext/html/HTMLCompletionQuery.java; /cvs/html/editor/lib/src/org/netbeans/editor/ext/html/HTMLCompletionQuery.java,v <-- HTMLCompletionQuery.java new revision: 1.23; previous revision: 1.22 done Verified in FCS build #200601251500 of NetBeans 5.0. |