<h2>Changes</h2>
+<p>-version 3.25
+<ul>
+ <li>GitHub Issue #228</li>
+<ul>
+</p>
+
<p>-version 3.24 on November 1, 2018
<ul>
- <li>Java 11 supports.</li>
+ <li>Java 11 supports.</li>
<li>JIRA JASSIST-267.</li>
<li>Github PR #218.</li>
</ul>
* {@code java.lang.invoke.MethodHandles.Lookup}.
*/
private Class<?> getClassInTheSamePackage() {
- if (basename.startsWith("javassist.util.proxy.")) // maybe the super class is java.*
+ if (basename.startsWith(packageForJavaBase)) // maybe the super class is java.*
return this.getClass();
else if (superClass != null && superClass != OBJECT_TYPE)
return superClass;
if (Modifier.isFinal(superClass.getModifiers()))
throw new RuntimeException(superName + " is final");
- if (basename.startsWith("java.") || onlyPublicMethods)
- basename = "javassist.util.proxy." + basename.replace('.', '_');
+ // Since java.base module is not opened, its proxy class should be
+ // in a different (open) module. Otherwise, it could not be created
+ // by reflection.
+ if (basename.startsWith("java.") || basename.startsWith("jdk.") || onlyPublicMethods)
+ basename = packageForJavaBase + basename.replace('.', '_');
}
+ private static final String packageForJavaBase = "javassist.util.proxy.";
+
private void allocateClassName() {
classname = makeProxyName(basename);
}
}
});
}
+
+ public void testJava11jdk() throws Exception {
+ ProxyFactory factory = new ProxyFactory();
+ factory.setSuperclass(jdk.javadoc.doclet.StandardDoclet.class);
+ jdk.javadoc.doclet.StandardDoclet e = (jdk.javadoc.doclet.StandardDoclet)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);
+ }
+ });
+ }
}