Java: Implemented completion of field types and method signatures in calls to findConstructor(), findVirtual(), findVarHandle(), etc (IDEA-167319)

This commit is contained in:
Pavel Dolgov
2017-03-22 14:44:26 +03:00
parent b9f3e284d6
commit 7c3a2057df
26 changed files with 484 additions and 27 deletions
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findConstructor(Types.class, <caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findConstructor(Types.class, MethodType.methodType(void.class));
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findConstructor(Constructed.class, <caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findConstructor(Constructed.class, MethodType.methodType(void.class));
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findConstructor(Constructed.class, <caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findConstructor(Constructed.class, MethodType.methodType(void.class, Object[].class));
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findGetter(Test.class, "f1",<caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findGetter(Test.class, "f1",int.class);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findSetter(Test.class, "f2", <caret> String.class);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findSetter(Test.class, "f2", float.class);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findStatic(Types.class, "sObjMethod", <caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findStatic(Types.class, "sGenericMethod", <caret>);
}
}
@@ -0,0 +1,9 @@
import java.lang.invoke.*;
import java.util.List;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findStatic(Types.class, "sGenericMethod", MethodType.methodType(Object.class, List.class, Object[].class));
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findStatic(Types.class, "sObjMethod", MethodType.methodType(Object.class, Object.class));
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findStaticVarHandle(Types.class, "sObj", <caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findStaticVarHandle(Types.class, "sObj", Object.class);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findVarHandle(Types.class, "str",<caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findVarHandle(Types.class, "str",String.class);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findVirtual(Types.class, "strMethod",<caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findVirtual(Types.class, "genericMethod", <caret>);
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findVirtual(Types.class, "genericMethod", MethodType.methodType(Object.class, Object.class, String.class));
}
}
@@ -0,0 +1,8 @@
import java.lang.invoke.*;
public class Main {
void foo() throws Throwable {
MethodHandles.Lookup lookup = MethodHandles.lookup();
lookup.findVirtual(Types.class, "strMethod", MethodType.methodType(String.class));
}
}