Files
openide/java/java-tests/testData/refactoring/inlineMethod/InlineSingleImplementationCastOnThisUnnecessary.java
Tagir Valeev d2b1f518c8 [java-refactoring] IDEA-360614 Replace with single implementation: no downcast when 'this' is used
(cherry picked from commit f2ea406a5cf229cf9e63b6c2b53b9d86f245a6d9)

IJ-CR-150207

GitOrigin-RevId: 0eec797e7e9d105bf594aabd85533bd5c5395dd1
2024-11-26 19:12:59 +00:00

17 lines
354 B
Java

public class InlineSingleImplementation {
interface MyIface {
void mySimpleMethod();
}
static class MyIfaceImpl implements MyIface {
@Override
public void mySimpleMethod() {
System.out.println(toString());
System.out.println(this.toString());
}
}
void test(MyIface iface) {
iface.<caret>mySimpleMethod();
}
}