redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.06k stars 425 forks source link

Move method refactoring causes syntax errors due to dependency on internal classes #3607

Open DongChunHao opened 3 months ago

DongChunHao commented 3 months ago

[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
  1. select "myMethod()"
  2. click “Refacator-Move method”

class OriginalClass { TargetClass c; protected class ProtectedInnerClass { void innerMethod() { // Some logic here } }

public void myMethod() { ProtectedInnerClass inner = new ProtectedInnerClass(); inner.innerMethod(); } } // TargetClass.java class TargetClass {

}

refactoring result: image

github-actions[bot] commented 3 months ago

We have found issues that are potential duplicates:

If any of the issues listed above are a duplicate, please consider closing this issue & upvoting/commenting the original one. Alternatively, if neither of the listed issues addresses your feature/bug, keep this issue open.