openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1531244 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
Date Fri, 11 Oct 2013 09:45:55 GMT
Author: rmannibucau
Date: Fri Oct 11 09:45:54 2013
New Revision: 1531244

URL: http://svn.apache.org/r1531244
Log:
OWB-904 interception proxy shouldn't proxy protected methods which are not in the same pacakge
than the proxied class

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java?rev=1531244&r1=1531243&r2=1531244&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
Fri Oct 11 09:45:54 2013
@@ -296,6 +296,14 @@ public class InterceptorDecoratorProxyFa
                 continue;
             }
 
+            final int modifiers = delegatedMethod.getModifiers();
+            if (Modifier.isProtected(modifiers)
+                && !delegatedMethod.getDeclaringClass().getPackage().getName()
+                .equals(classToProxy.getPackage().getName()))
+            {
+                continue;
+            }
+
             String methodDescriptor = Type.getMethodDescriptor(delegatedMethod);
 
             //X TODO handle generic exception types?
@@ -306,7 +314,7 @@ public class InterceptorDecoratorProxyFa
                 exceptionTypeNames[i] = Type.getType(exceptionTypes[i]).getInternalName();
             }
 
-            int targetModifiers = delegatedMethod.getModifiers() & (Modifier.PROTECTED
| Modifier.PUBLIC);
+            int targetModifiers = modifiers & (Modifier.PROTECTED | Modifier.PUBLIC);
 
             MethodVisitor mv = cw.visitMethod(targetModifiers, delegatedMethod.getName(),
methodDescriptor, null, exceptionTypeNames);
 



Mime
View raw message