Files
openide/java/java-tests/testData/refactoring/makeMethodStatic/beforeCallSuperClassMethod.java
2024-06-26 11:52:02 +00:00

25 lines
429 B
Java

public class Foo {
private int counter;
public Foo(int initialCounter) {
this.counter = initialCounter;
}
void <caret>toBeRefactored() {
new Foo(counter + 10) {
void toImplement() {
toCall();
}
}.toImplement();
}
void toCall() {
System.out.println("Counter: " + counter);
}
public static void main(String[] args) {
Foo foo = new Foo(5);
foo.toBeRefactored();
}
}