You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class A {
public class BaseTargetClass {}
public class OriginalClass {
public int data = 40;
public void memberMethod() {
System.out.println("Nested anonymous data: " + data);
}
public class NestedOriginalClass extends BaseTargetClass {
void setup() {
new BaseTargetClass() {
void methodToBePulledUp() {
new BaseTargetClass() {
void innerMethod() {
System.out.println("Deeply nested method: " + data);
}
};
}
};
}
}
}
}
Left click the methodToBePulledUp(), then right click -> Refactor -> Pull Up, and use the default configurations (the destination is set as BaseTargetClass by default) as following, click Finish:
The refactoring is performed without any warning or exception. The refactored program is following, which contains syntax error:
public class A {
public class BaseTargetClass {
void methodToBePulledUp() {
new BaseTargetClass() {
void innerMethod() {
System.out.println("Deeply nested method: " + data);// syntax error
}
};
}}
public class OriginalClass {
public int data = 40;
public void memberMethod() {
System.out.println("Nested anonymous data: " + data);
}
public class NestedOriginalClass extends BaseTargetClass {
void setup() {
new BaseTargetClass() {
};
}
}
}
}
Environment
OS Version
Windows 10, 64-bit Operating System, x64-based processor
Eclipse Version
Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2024-09 (4.33.0)
Build id: 20240905-0614
JDK Version
java version "22.0.1" 2024-04-16
Java(TM) SE Runtime Environment (build 22.0.1+8-16)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)
The text was updated successfully, but these errors were encountered:
Steps to reproduce
The input program is following:
Left click the methodToBePulledUp(), then right click -> Refactor -> Pull Up, and use the default configurations (the destination is set as BaseTargetClass by default) as following, click Finish:
The refactoring is performed without any warning or exception. The refactored program is following, which contains syntax error:
Environment
OS Version
Windows 10, 64-bit Operating System, x64-based processor
Eclipse Version
Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2024-09 (4.33.0)
Build id: 20240905-0614
JDK Version
java version "22.0.1" 2024-04-16
Java(TM) SE Runtime Environment (build 22.0.1+8-16)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)
The text was updated successfully, but these errors were encountered: