Skip to content

REGRESSION: Refactor>Rename messes up javadoc comment formatting. #9492

Description

@errael

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. <CR> to refactor

Observe The comments, line 6 and 13, messed up.
If there are multiple lines after the <p> the whole paragraph if affected.

NOTE: if <p> 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.
 * <p>
 * This is stuff RefactorRenameCommentFormat.someMethod().anotherMethod.
 */
public class RefactorRenameCommentFormat
{
    /**
     * Some stuff.
     * <p>
     * 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 #202605191504177946462222.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)JavaDoc[ci] enable java/javadoc tests and build-javadoc targetkind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions