Author: struberg
Date: Tue Jan 22 20:51:12 2013
New Revision: 1437157

URL: http://svn.apache.org/viewvc?rev=1437157&view=rev
Log:
OWB-344 remove proxying for protected methods again.

We must find a proper solution for this ...

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/NormalScopeProxyFactory.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=1437157&r1=1437156&r2=1437157&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 Jan 22 20:51:12 2013
@@ -258,21 +258,10 @@ public abstract class AbstractProxyFacto
         {
             Class<T> definedClass = (Class<T>) 
defineClassMethod.invoke(classLoader, proxyName, proxyBytes, 0, 
proxyBytes.length);
 
-            try
-            {
-                Class<T> loadedClass = (Class<T>) 
Class.forName(definedClass.getName(), true, classLoader);
-                return loadedClass;
-            }
-            catch (ClassNotFoundException e)
-            {
-                throw new ProxyGenerationException(e);
-            }
+            Class<T> loadedClass = (Class<T>) 
Class.forName(definedClass.getName(), true, classLoader);
+            return loadedClass;
         }
-        catch (IllegalAccessException e)
-        {
-            throw new ProxyGenerationException(e);
-        }
-        catch (InvocationTargetException e)
+        catch (Throwable e)
         {
             throw new ProxyGenerationException(e);
         }
@@ -284,7 +273,7 @@ public abstract class AbstractProxyFacto
         int modifiers = delegatedMethod.getModifiers();
 
         //X TODO how to deal with native functions?
-        return (modifiers & (Modifier.PRIVATE | Modifier.STATIC | 
Modifier.FINAL | Modifier.NATIVE)) > 0 ||
+        return (modifiers & (Modifier.PRIVATE | Modifier.PROTECTED | 
Modifier.STATIC | Modifier.FINAL | Modifier.NATIVE)) > 0 ||
                "finalize".equals(delegatedMethod.getName());
     }
 

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=1437157&r1=1437156&r2=1437157&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 Jan 22 20:51:12 2013
@@ -294,16 +294,6 @@ public class NormalScopeProxyFactory ext
             {
                 continue;
             }
-            if (classLoader != classToProxy.getClassLoader())
-            {
-                // We can only proxy protected methods that way if the subclass
-                // and the proxied class are in the same classloader
-                // Otherwise they don't technically count as being 'in the 
same package'
-                if (Modifier.isProtected(delegatedMethod.getModifiers()))
-                {
-                    continue;
-                }
-            }
 
             String methodDescriptor = 
Type.getMethodDescriptor(delegatedMethod);
 


Reply via email to