apache / apache/netbeans

REGRESSION: Refactor>Rename messes up javadoc comment formatting.

Open
#9,492 0 comments 0 reactions 0 assignees View on GitHub
Java JavaDoc kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 30

### What happened

In the example class file below,
1. cursor on class decl class name, line 8
2. rename RefactorRenameCommentFormat to Foo
3. checked: Apply Rename on Comments
4. \ to refactor

Observe The comments, line 6 and 13, messed up.
If there are multiple lines after the \

the whole paragraph if affected.

NOTE: if \

is taken away:
1. the comment indentation is not changed
2. the class name in the comment is not renamed.

```
package com.raelity.play;

/**
* Some stuff.
*


* This is stuff RefactorRenameCommentFormat.someMethod().anotherMethod.
*/
public class RefactorRenameCommentFormat
{
/**
* Some stuff.
*


* This is stuff RefactorRenameCommentFormat.someMethod().anotherMethod.
*/
public RefactorRenameCommentFormat someMethod() {
return null;
}
public String anotherMethod() {
return null;
}
}
```

### Language / Project Type / NetBeans Component

java/javadoc

### How to reproduce

See OP.
I'm assuming this a regression since #8233 was a regression. This might be another case of the same problem from #8233.

### Did this work correctly in an earlier version?

Apache NetBeans 26 or earlier

### Operating System

Linux harmony 7.0.9-76070009-generic #202605191504~1779464622~22.04~ef31795 SMP PREEMPT_DYNAMIC Fri M x86_64 x86_64 x86_64 GNU/Linux

### JDK

Java: 26; OpenJDK 64-Bit Server VM 26+35-2893 Runtime: OpenJDK Runtime Environment 26+35-2893

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the rename in a Java class with Javadoc, using Refactor > Rename and Apply Rename on Comments, then compare the paragraph formatting with NetBeans 26 or earlier. Trace the Java refactoring path responsible for updating Javadoc comments; done means the class name is renamed while indentation and paragraph formatting after

remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.