Bug 126907 - Refactoring should parse javadoc and perform changes in it
Refactoring should parse javadoc and perform changes in it
Status: NEW
Product: java
Classification: Unclassified
Component: Refactoring
6.x
All All
: P3 (vote)
: 7.4
Assigned To: Ralph Ruijs
issues@java
: PLAN
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-07 12:53 UTC by mikbra
Modified: 2013-04-23 00:50 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mikbra 2008-02-07 12:53:25 UTC
In the following code:

/** MyClass. Call {@link #foo} whenever. */
public class MyClass {
    public void foo() { ... }
}

When renaming (refactor) the method foo, the javadoc link "{@ #foo}" does not get updated. The same goes for renaming fields and classes.
Comment 1 Jiri Prox 2008-02-07 13:20:18 UTC
Have you check "Apply Rename on Comments" checkbox?
Comment 2 mikbra 2008-02-07 13:40:31 UTC
I'm doing "instant rename", i.e. pressing CMD+R (on a Mac) when the cursor is placed on the thing (field, method, etc) I want to rename. No dialog is shown.
Comment 3 mikbra 2008-02-07 13:54:39 UTC
Also, the checkbox "Apply Rename on Comments" only seems to do a string replace, which may be wrong. It should _analyze_ the Javadoc.

Say that I have the following code:

/** MyClass is really cool. Call {@link #cool} whenever. */
public class MyClass {
    public void cool() { ... }
}

Then I want to rename (refactor) the method "cool" to "stupid". I do not want to update my javadoc to say that "MyClass is really stupid", I only want to 
update the link.
Comment 4 Jiri Prox 2008-02-07 16:20:44 UTC
The problem with instant rename is duplicate of issue 102669.
The string replace is as designed, so it works in all types of comments.  You can turn off some replacements in preview. 

-> I'm changing the summary and switching this issue to enhancement.



By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo