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 126907

Summary: Refactoring should parse javadoc and perform changes in it
Product: java Reporter: mikbra <mikbra>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED WORKSFORME    
Severity: blocker Keywords: PLAN
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

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.