mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-21 13:20:56 +07:00
Fixes IDEA-218207 Move refactoring doesn't work for local classes Also: Convert anonymous to inner -> do not create fields used in other field initializers only Also: Convert anonymous to inner -> capture implicitly referred type parameters (mentioned in types of captured variables) GitOrigin-RevId: 5d326e0b6fdff4de850ce48582cc3ca0fe003b43
38 lines
994 B
Java
38 lines
994 B
Java
import java.util.function.IntFunction;
|
|
|
|
public class LocalClass {
|
|
<T> void test(int x, T t) {
|
|
class Hell<caret>o<X> {
|
|
Hello(int a) {}
|
|
Hello(String a) {}
|
|
|
|
static {
|
|
System.out.println("hello");
|
|
}
|
|
|
|
{
|
|
System.out.println("hi"+x);
|
|
}
|
|
|
|
void run(X xx, T t) {
|
|
System.out.println(xx);
|
|
System.out.println(x);
|
|
System.out.println(Hello.class);
|
|
var xHello = new Hello<X>(3);
|
|
System.out.println(xHello);
|
|
xHello.run(xx, t);
|
|
}
|
|
}
|
|
|
|
Hello<Integer> h = new Hello<Integer>(1);
|
|
Hello<String> h2 = new Hello<>("1");
|
|
Hello raw = new Hello("1");
|
|
IntFunction<Hello<Character>> ic = Hello::new;
|
|
System.out.println(new Hello<Number>(1) {
|
|
void test() {}
|
|
});
|
|
|
|
h2.run("hello", t);
|
|
}
|
|
}
|