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.

Bug 257347 - Javadoc viewer shows class Javadoc when method Javadoc is selected
Summary: Javadoc viewer shows class Javadoc when method Javadoc is selected
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-31 05:22 UTC by _ gtzabari
Modified: 2016-04-28 02:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ObjectPreconditions.java (3.66 KB, application/octet-stream)
2016-01-13 10:29 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2015-12-31 05:22:45 UTC
Product Version: NetBeans IDE Dev (Build 201512240002)
Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b17
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b17
System: Windows 10 version 10.0 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

Given:

public class SomeClass
{
  /**
   * method 1.
   */
  void method1();
  /**
   * method 2.
   */
  void method2();
}

If a user places the caret on "method 2" (inside the Javadoc) then the viewer shows the Javadoc for method 1.

Workaround: Place caret on method2() prototype, below the actual Javadoc.

Justification: The current behavior makes it hard to edit Javadoc and see the results update live. I have to constantly shift the caret down to the method prototype to view my changes.

Expected behavior: When the Javadoc for method2 is selected, it should get displayed as opposed to that of method 1.
Comment 1 _ gtzabari 2015-12-31 05:27:59 UTC
In fact, the only way to get the Javadoc to display seems to be to select the method name. Selecting the return type, or method parameters shows their respective Javadoc instead.
Comment 2 _ gtzabari 2015-12-31 10:16:49 UTC
I changed this issue to an enhancement request. It looks like the viewer shows the class Javadoc when the caret is on top of a method's Javadoc, so I assume this behavior is by design.

I still strongly recommend changing the behavior to displaying the method's Javadoc so it can be previewed as it is being edited.
Comment 3 Svata Dedic 2016-01-07 08:34:34 UTC
I tried to reproduce with the SomeClass code (and with a very similar hand-written), but javadoc window tracks properly when either the caret is inside the javadoc or at the very start of it.

Please attach the exact file, maybe some subtle formatting issue confuses the analyzer ?
Comment 4 _ gtzabari 2016-01-13 10:28:51 UTC
You are right, this is file-specific. Please open ObjectPreconditions.java (attached) and please the caret on any of the method Javadocs. Let me know if you can reproduce this on your end.
Comment 5 _ gtzabari 2016-01-13 10:29:56 UTC
Created attachment 158113 [details]
ObjectPreconditions.java
Comment 6 _ gtzabari 2016-01-13 10:30:29 UTC
"please the caret on any of the method Javadocs" -> *place* the caret on any of the method Javadocs :)
Comment 7 Svata Dedic 2016-04-26 14:29:41 UTC
Note that on e.g. class/type parameter return type, the javadoc window will display javadoc for the return type (type parameter) rather than for the method.

Fixed in jet-main#07d159ae4cec
Comment 8 Quality Engineering 2016-04-28 02:02:29 UTC
Integrated into 'main-silver', will be available in build *201604280002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/07d159ae4cec
User: Svata Dedic <sdedic@netbeans.org>
Log: #257347: navigate to member if positioned in javadoc or at start of 1char ident