Skip to content

Commit

Permalink
Merge pull request #2 from jboss-javassist/master
Browse files Browse the repository at this point in the history
Sync with master /jboss-javassist/javassist/.
  • Loading branch information
NingZhang-e committed Dec 4, 2018
2 parents 10f4eaf + a82e2d7 commit 4f32527
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
destdir="${build.classes.dir}"
debug="on"
deprecation="on"
source="1.8"
target="1.8"
source="1.7"
target="1.7"
optimize="off"
includeantruntime="true"
includes="**">
Expand Down
Binary file modified javassist.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>1.7</source>
<target>1.7</target>
<testSource>11</testSource>
<testTarget>11</testTarget>
<testCompilerArgument>-parameters</testCompilerArgument>
Expand Down
4 changes: 3 additions & 1 deletion src/main/javassist/util/proxy/ProxyFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ private void createClass3(ClassLoader cl, Lookup lookup) {
* {@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];
Expand Down
12 changes: 12 additions & 0 deletions src/test/javassist/proxyfactory/ProxyFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,16 @@ public static class TestDefaultC implements TestDefaultI {
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);
}
});
}
}

0 comments on commit 4f32527

Please sign in to comment.