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

   ### Apache NetBeans version
   
   Apache NetBeans 23
   
   ### What happened
   
   When test() is selected to perform pull down refactoring into class A, 
before refactoring, test() method calls method() of class ParentClass, after 
refactoring, test() method calls method() of class SubClass, resulting in a 
change in code behavior.
   
   Code before refactoring
   ```java
   class ParentClass {
   void method() {
    System.out.println("ParentClass method");
    }
   }
   class A extends SubClass { 
   void method() {
    System.out.println("Class A method");
    }
   }
   class SubClass extends ParentClass {
   void test() {
    method(); 
    }
   }
   ```
   
   
   ### Language / Project Type / NetBeans Component
   
   _No response_
   
   ### How to reproduce
   
   When test() is selected to perform pull down refactoring into class A, 
before refactoring, test() method calls method() of class ParentClass, after 
refactoring, test() method calls method() of class SubClass, resulting in a 
change in code behavior.
   
   Code before refactoring
   ```java
   class ParentClass {
   void method() {
    System.out.println("ParentClass method");
    }
   }
   class A extends SubClass { 
   void method() {
    System.out.println("Class A method");
    }
   }
   class SubClass 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
   
   Code after refactoring
   ```java
   class ParentClass {
   void method() {
    System.out.println("ParentClass method");
    }
   }
   class A extends SubClass { 
   void method() {
    System.out.println("Class A method");
    }
   void test() {
    method(); 
    }
   }
   class SubClass extends ParentClass {
   }
   ```
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to