apache / apache/netbeans

Bug: Inheritance structure prioritization. Resulting in a change in the renaming invocation relationship

Open
#7,842 0 comments 0 reactions 0 assignees View on GitHub
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 23

### What happened

The "methodToBeRenamed" method is renamed in the "ParentClass" class; Code before refactoring, the body of "testMethod()" method calls the "method()" in the "SubClass" class; Code after refactoring, the body of "testMethod()" method calls the "method()" in the "ParentClass" class; The rename method refactoring has resulted in a change in the method call within the body of "testMethod()" method .

class ParentClass{
void methodToBeRenamed(){}
}
class SourceClass{
void method(){}
class InnerClass extends ParentClass{
void test(){
method();
}
}
}

### Language / Project Type / NetBeans Component

_No response_

### How to reproduce

The "methodToBeRenamed" method is renamed in the "ParentClass" class; Code before refactoring, the body of "testMethod()" method calls the "method()" in the "SubClass" class; Code after refactoring, the body of "testMethod()" method calls the "method()" in the "ParentClass" class; The rename method refactoring has resulted in a change in the method call within the body of "testMethod()" method .

class ParentClass{
void methodToBeRenamed(){}
}
class SourceClass{
void method(){}
class InnerClass extends ParentClass{
void test(){
method();
}
}
}

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

No / Don't know

### Operating System

Windows11

### JDK

20

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

_No response_

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

No

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the rename-method refactoring in Apache NetBeans 23 using the ParentClass, SourceClass, and InnerClass snippet from the report on Windows 11 with JDK 20. Done means renaming the parent method does not change the method call inside InnerClass.test from the enclosing class's method to the parent method.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.