redhat-developer / redhat-developer/vscode-java
Renaming methods causes code behavior to change
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
[provide a description of the issue]
Environment
Operating System: Windows11
JDK version: 17
Visual Studio Code version: 1.88
Java extension version: 1.29
Steps To Reproduce
- select "k()"
- click "Refactor-Rename"
- new method name "m()"
In this example, before the rename, the f() method calls the m() method in the parent class, and after the rename, the f() method calls the method in the subclass renamed m(). The rename causes the code behavior to change, so it is a bug.
class A {
void m(Object m){
System.out.println("A");
}
}
class B extends A{
// rename k to m
void k(String m){
System.out.println("B");
}
void f(){
m("1");
}
}
Current Result:
Expected Result: A warning is given during the refactoring process that the name may cause the refactoring behavior to change
Additional Informations
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された Java クラス、Windows 11、JDK 17、VS Code 1.88、Java extension 1.29 を使用して、Refactor-Rename フローで問題を再現します。k から m への名前変更が f() 内の呼び出しにどのような影響を与えるかを追跡し、その後、メソッド解決が変わる可能性がある場合にリファクタリングが警告することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- developer-experience
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100