* {@code java.lang.invoke.MethodHandles.Lookup}.
*/
private Class<?> getClassInTheSamePackage() {
- if (superClass != null && superClass != OBJECT_TYPE)
+ if (basename.startsWith("javassist.util.proxy.")) // maybe the super class is java.*
+ return this.getClass();
+ else if (superClass != null && superClass != OBJECT_TYPE)
return superClass;
else if (interfaces != null && interfaces.length > 0)
return interfaces[0];
public static class TestDefaultC2 extends TestDefaultC {
public int baz() { return super.foo(); }
}
+
+ public void testJava11() throws Exception {
+ ProxyFactory factory = new ProxyFactory();
+ factory.setSuperclass(java.util.HashMap.class);
+ java.util.HashMap e = (java.util.HashMap)factory.create(null, null, new MethodHandler() {
+ @Override
+ public Object invoke(Object self, Method thisMethod,
+ Method proceed, Object[] args) throws Throwable {
+ return proceed.invoke(self, args);
+ }
+ });
+ }
}