Community
Participate
Working Groups
I added the following method to a class. public boolean hi(String there) { return false; } I then selected all three lines (entirely) andd chose Source>Add Javadoc. A javadoc entry was added to the class instead of the method. I actually did this several times before I realized what was happening so I ended up with several class comments all of which were identical. I then selected just the method name and performed the operation and it worked as expected. I then selected all three lines of the method and performed the action again and this time it added the javadoc to the method (resulting in 2 identical javadoc comments. There are two problems to consider here: 1) Selecting the method in its entirety should have added the javadoc to the method and not the class. 2) Would it be possible to detect the fact that the comment being added is identical to the existing comment and warn the user. It may even be benefitial to warn the user even if the comment differs from the existing comment. I will attach the file that resulted in this behavior
Created attachment 12064 [details] Java file
Regarding issue 2: bug 30153 is requesting this feature. Issue 1: we try to find the enclosing element of the current selection and add Javadoc to this one. Since for the Java model a method start with the visibility modifier and ends with } a "line" selection covering the method is considered to be covered by the Type. We should be smarter here and should ignore white spaces
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Still occurs in 4.24 M3