summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2018-09-02 19:25:12 +0900
committerchibash <chiba@javassist.org>2018-09-02 19:25:12 +0900
commita13f51b8d12510152bffe1fc7bd1f4a1ca16fefb (patch)
tree8ad2779b81118ccdfcb3fc893266004aee61ff99
parentbca5c7aad8551aebda6039fb74b41c20de3d23d9 (diff)
downloadjavassist-a13f51b8d12510152bffe1fc7bd1f4a1ca16fefb.tar.gz
javassist-a13f51b8d12510152bffe1fc7bd1f4a1ca16fefb.zip
adds a comment for the fix to JIRA JASSIST-267
-rw-r--r--Readme.html6
-rw-r--r--javassist.jarbin759474 -> 761569 bytes
-rw-r--r--src/main/javassist/util/proxy/ProxyFactory.java4
-rw-r--r--src/test/test/javassist/proxy/ProxySimpleTest.java31
4 files changed, 39 insertions, 2 deletions
diff --git a/Readme.html b/Readme.html
index c8649848..5ffb7165 100644
--- a/Readme.html
+++ b/Readme.html
@@ -281,6 +281,12 @@ see javassist.Dump.
<h2>Changes</h2>
+<p>-version 3.24
+<ul>
+ <li>JIRA JASSIST-267.
+</ul>
+</p>
+
<p>-version 3.23.1 on July 2, 2018
<ul>
<li>Github pull issue #171.</li>
diff --git a/javassist.jar b/javassist.jar
index edf45a97..7a5d8200 100644
--- a/javassist.jar
+++ b/javassist.jar
Binary files differ
diff --git a/src/main/javassist/util/proxy/ProxyFactory.java b/src/main/javassist/util/proxy/ProxyFactory.java
index 646bbcc4..d3fcddbd 100644
--- a/src/main/javassist/util/proxy/ProxyFactory.java
+++ b/src/main/javassist/util/proxy/ProxyFactory.java
@@ -1186,8 +1186,8 @@ public class ProxyFactory {
// put the method to the cache, retrieve previous definition (if any)
Method oldMethod = hash.put(key, m);
- // JIRA JASSIST-244
- // ignore a bridge method with the same signature that the overridden one has.
+ // JIRA JASSIST-244, 267
+ // ignore a bridge method to a method declared in a non-public class.
if (null != oldMethod && isBridge(m)
&& !Modifier.isPublic(oldMethod.getDeclaringClass().getModifiers())
&& !Modifier.isAbstract(oldMethod.getModifiers()) && !isDuplicated(i, methods))
diff --git a/src/test/test/javassist/proxy/ProxySimpleTest.java b/src/test/test/javassist/proxy/ProxySimpleTest.java
index 76178a7e..63298501 100644
--- a/src/test/test/javassist/proxy/ProxySimpleTest.java
+++ b/src/test/test/javassist/proxy/ProxySimpleTest.java
@@ -330,5 +330,36 @@ public class ProxySimpleTest extends TestCase {
public static class Extended267 extends Base267 {
public String base(Integer i) { return "extended" + i + i; }
}
+
+ String value267b;
+ public void testJIRA267b() throws Exception {
+ Extended267b extended267 = new Extended267b();
+ ProxyFactory factory = new ProxyFactory();
+ factory.setSuperclass(Extended267b.class);
+ Extended267b e = (Extended267b)factory.create(null, null, new MethodHandler() {
+ @Override
+ public Object invoke(Object self, Method thisMethod,
+ Method proceed, Object[] args) throws Throwable {
+ value267b += thisMethod.getDeclaringClass().getName();
+ value267b += ";" + thisMethod.getReturnType().getName();
+ return proceed.invoke(self, args);
+ }
+ });
+
+ value267b = "";
+ assertEquals("extended", e.base());
+ System.out.println(value267b);
+ assertEquals(Extended267b.class.getName() + ";" + String.class.getName(), value267b);
+ }
+
+ public static class Base267b {
+ public Object base() { return "base"; }
+ }
+
+ // Extended267b has a bridge method for base():Object,
+ // since Extended267b#base() is covariant.
+ public static class Extended267b extends Base267b {
+ public String base() { return "extended"; }
+ }
}