openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1800730 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy: AbstractProxyFactory.java InterceptorDecoratorProxyFactory.java NormalScopeProxyFactory.java SubclassProxyFactory.java
Date Tue, 04 Jul 2017 06:59:46 GMT
Author: rmannibucau
Date: Tue Jul  4 06:59:46 2017
New Revision: 1800730

URL: http://svn.apache.org/viewvc?rev=1800730&view=rev
Log:
OWB-1196 ensure we can proxy signed classes - propagating to interceptors and normal scoped
proxies

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

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java?rev=1800730&r1=1800729&r2=1800730&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
Tue Jul  4 06:59:46 2017
@@ -184,6 +184,13 @@ public abstract class AbstractProxyFacto
         throw new WebBeansException("Unable to detect a free proxy class name based on: "
+ proxyClassName);
     }
 
+    protected  <T> String getSignedClassProxyName(final Class<T> classToProxy)
+    {
+        // avoid java.lang.SecurityException: class's signer information
+        // does not match signer information of other classes in the same package
+        return "org.apache.webbeans.custom.signed." + classToProxy.getName();
+    }
+
     protected String fixPreservedPackages(String proxyClassName)
     {
         proxyClassName = fixPreservedPackage(proxyClassName, "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=1800730&r1=1800729&r2=1800730&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
Tue Jul  4 06:59:46 2017
@@ -208,7 +208,9 @@ public class InterceptorDecoratorProxyFa
                                           Method[] interceptedMethods, Method[] nonInterceptedMethods)
             throws ProxyGenerationException
     {
-        String proxyClassName = getUnusedProxyClassName(classLoader, classToProxy.getName()
+ "$$OwbInterceptProxy");
+        String proxyClassName = getUnusedProxyClassName(
+                classLoader,
+                (classToProxy.getSigners() != null ? getSignedClassProxyName(classToProxy)
: classToProxy.getName()) + "$$OwbInterceptProxy");
 
 
         Class<T> clazz = createProxyClass(classLoader, proxyClassName, classToProxy,
interceptedMethods, nonInterceptedMethods);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java?rev=1800730&r1=1800729&r2=1800730&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
Tue Jul  4 06:59:46 2017
@@ -232,7 +232,9 @@ public class NormalScopeProxyFactory ext
     public <T> Class<T> createProxyClass(ClassLoader classLoader, Class<T>
classToProxy)
             throws ProxyGenerationException
     {
-        String proxyClassName = getUnusedProxyClassName(classLoader, classToProxy.getName()
+ "$$OwbNormalScopeProxy");
+        String proxyClassName = getUnusedProxyClassName(
+                classLoader,
+                (classToProxy.getSigners() != null ? getSignedClassProxyName(classToProxy)
: classToProxy.getName()) + "$$OwbNormalScopeProxy");
 
         Method[] nonInterceptedMethods;
         Method[] interceptedMethods = null;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java?rev=1800730&r1=1800729&r2=1800730&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
Tue Jul  4 06:59:46 2017
@@ -95,9 +95,7 @@ public class SubclassProxyFactory extend
     {
         if (classToProxy.getSigners() != null)
         {
-            // avoid java.lang.SecurityException: class's signer information
-            // does not match signer information of other classes in the same package
-            return "org.apache.webbeans.custom.signed." + classToProxy.getName();
+            return getSignedClassProxyName(classToProxy);
         }
         return fixPreservedPackages(classToProxy.getName() + "$$OwbSubClass");
     }



Mime
View raw message