mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
38 lines
1.4 KiB
Plaintext
38 lines
1.4 KiB
Plaintext
call text: Object result = Test.invoke();
|
|
class:
|
|
public class GeneratedEvaluationClass {
|
|
static Object invoke() {
|
|
return newWithReflectionAccess$Inner1();
|
|
}
|
|
|
|
public static Object newWithReflectionAccess$Inner1() {
|
|
try {
|
|
Class<?> klass = Class.forName("WithReflectionAccess$Inner");
|
|
java.lang.reflect.Constructor<?> member = null;
|
|
int interfaceNumber = -1;
|
|
Class<?>[] interfaces = null;
|
|
while (member == null) {
|
|
try {
|
|
member = klass.getDeclaredConstructor();
|
|
} catch (ReflectiveOperationException e) {
|
|
if (interfaceNumber == -1) {
|
|
interfaces = klass.getInterfaces();
|
|
interfaceNumber = 0;
|
|
}
|
|
if (interfaceNumber < interfaces.length) {
|
|
klass = interfaces[interfaceNumber];
|
|
interfaceNumber += 1;
|
|
} else {
|
|
klass = klass.getSuperclass();
|
|
if (klass == null) throw e;
|
|
interfaceNumber = -1;
|
|
}
|
|
}
|
|
}
|
|
member.setAccessible(true);
|
|
return (Object) member.newInstance();
|
|
} catch (ReflectiveOperationException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
} |