You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "assdfsdafasfa (via GitHub)" <gi...@apache.org> on 2024/09/26 13:43:29 UTC

[I] Move method refactoring leads to changes in calling relationships. [netbeans]

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

   ### Apache NetBeans version
   
   Apache NetBeans 23
   
   ### What happened
   
   When the m() method in the selection class C performs a move method refactoring into A.B, resulting in a change in the calling relationship. Before refactoring, k() calls the m() method in class A. After refactoring, the method m() in class C moving to class B is called.
   ```java
   class A {
   privatevoid m() {
    System.out.println("Method m() in Class A");
    }
   class B {
   void k() {
    m(); // Calls method m() from Class A
    }
    }
   }
   class C {
   static A.B b; // A static reference to Class B inside Class A
   publicvoid m() {
    System.out.println("Method m() in Class C");
    }
   }
   
   
   ### Language / Project Type / NetBeans Component
   
   _No response_
   
   ### How to reproduce
   
   Select m() in class C, click move, select A.B, and perform the refactoring.
   ```java
   class A {
   privatevoid m() {
    System.out.println("Method m() in Class A");
    }
   class B {
   void k() {
    m(); // Calls method m() from Class A
    }
    }
   }
   class C {
   static A.B b; // A static reference to Class B inside Class A
   publicvoid m() {
    System.out.println("Method m() in Class C");
    }
   }
   ```
   
   
   ### 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


-- 
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-unsubscribe@netbeans.apache.org.apache.org

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


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

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