assdfsdafasfa opened a new issue, #8300:
URL: https://github.com/apache/netbeans/issues/8300

   ### Apache NetBeans version
   
   Apache NetBeans 25
   
   ### What happened
   
   When the "Move Method" refactoring is performed using NetBeans, it causes 
changes to the code's behavior.
   
   ### Language / Project Type / NetBeans Component
   
   _No response_
   
   ### How to reproduce
   
   Select the m() method in class C, select the move method refactoring, move 
it to class B, before refactoring, the f() method calls the m() method of class 
A, after refactoring, the f() method calls the m() method of class B。
   ```java
   class A {
       void m(Object m) {
           System.out.println("A");
       }
   }
   
   class B extends A {
       void k(String m) {
           System.out.println("B");
       }
   
       void f() {
           m("1");
       }
   }
   
   class C {
       B b;
       // move m() to class B
       void m(String m) {
           System.out.println("B");
       }
   }
   ```
   Code after refactoring:
   ```java
   class A {
       void m(Object m) {
           System.out.println("A");
       }
   }
   
   class B extends A {
       void k(String m) {
           System.out.println("B");
       }
   
       void f() {
           m("1");
       }
   
       // move m() to class B
       void m(String m) {
           System.out.println("B");
       }
   }
   class C {
       B b;
   }
   ```
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 25
   
   ### Operating System
   
   windows11
   
   ### JDK
   
   17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans platform
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to