summaryrefslogtreecommitdiffstats
path: root/src/main/javassist/util
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2009-06-26 07:08:32 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2009-06-26 07:08:32 +0000
commit3fcf471e97d82d5f7ad17d554bdd582c8a1a6986 (patch)
treef2af731bb956585a5087584648a5331399b9da20 /src/main/javassist/util
parente5ad03c45467e050b5b93cf2e95329a9e75c782e (diff)
downloadjavassist-3fcf471e97d82d5f7ad17d554bdd582c8a1a6986.tar.gz
javassist-3fcf471e97d82d5f7ad17d554bdd582c8a1a6986.zip
fixed JIRA JASSIST-85
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@483 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/util')
-rw-r--r--src/main/javassist/util/proxy/ProxyFactory.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/javassist/util/proxy/ProxyFactory.java b/src/main/javassist/util/proxy/ProxyFactory.java
index 873e6243..82d98973 100644
--- a/src/main/javassist/util/proxy/ProxyFactory.java
+++ b/src/main/javassist/util/proxy/ProxyFactory.java
@@ -749,6 +749,17 @@ public class ProxyFactory {
Method m = methods[i];
String key = m.getName() + ':' + RuntimeSupport.makeDescriptor(m);
hash.put(key, methods[i]);
+ // JIRA JASSIST-85
+ // put the method to the cache, retrieve previous definition (if any)
+ Method oldMethod = (Method)hash.put(key, methods[i]);
+
+ // check if visibility has been reduced
+ if (null != oldMethod && Modifier.isPublic(oldMethod.getModifiers())
+ && !Modifier.isPublic(methods[i].getModifiers()) ) {
+ // we tried to overwrite a public definition with a non-public definition,
+ // use the old definition instead.
+ hash.put(key, oldMethod);
+ }
}
}