Files
openide/java/java-tests/testData/refactoring/inlineMethod/InlineSingleImplementationGenericMethod.java.after
Tagir Valeev 09bd11efd8 [java-refactoring] IDEA-71792 Support inlining of abstract methods having one implementation
GitOrigin-RevId: 00491acff53aff96705a866e0d799dfe22873d23
2024-10-11 08:10:27 +00:00

27 lines
741 B
Plaintext

public class InlineSingleImplementation {
interface MyIface<T> {
<M> M myGenericMethod(M m, T t);
}
static class MyIfaceImpl<E extends CharSequence> implements MyIface<E> {
@Override
public <M1> M1 myGenericMethod(M1 m, E e) {
M1 m1 = m;
E e1 = e;
if (m == null) return null;
System.out.println("Impl: " + m1 + " : " + e);
return m;
}
}
void test(MyIface<String> iface) {
Integer result = null;
Integer m1 = 123;
String e1 = "hello";
if ((Integer) 123 != null) {
System.out.println("Impl: " + m1 + " : " + "hello");
result = 123;
}
int x = result;
}
}