openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1477188 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ProviderBasedProxyProducer.java
Date Mon, 29 Apr 2013 16:44:38 GMT
Author: rmannibucau
Date: Mon Apr 29 16:44:38 2013
New Revision: 1477188

URL: http://svn.apache.org/r1477188
Log:
OWB-849 classloader can be null here

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ProviderBasedProxyProducer.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ProviderBasedProxyProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ProviderBasedProxyProducer.java?rev=1477188&r1=1477187&r2=1477188&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ProviderBasedProxyProducer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ProviderBasedProxyProducer.java
Mon Apr 29 16:44:38 2013
@@ -23,6 +23,7 @@ import javax.inject.Provider;
 
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.proxy.NormalScopeProxyFactory;
+import org.apache.webbeans.util.WebBeansUtil;
 
 public class ProviderBasedProxyProducer<T> extends AbstractProducer<T>
 {
@@ -45,7 +46,11 @@ public class ProviderBasedProxyProducer<
         if (proxyInstance == null)
         {
             NormalScopeProxyFactory proxyFactory = webBeansContext.getNormalScopeProxyFactory();
-            Class<T> proxyClass = proxyFactory.createProxyClass(returnType.getClassLoader(),
returnType);
+            ClassLoader loader = returnType.getClassLoader();
+            if (loader == null) {
+                loader = WebBeansUtil.getCurrentClassLoader();
+            }
+            Class<T> proxyClass = proxyFactory.createProxyClass(loader, returnType);
             proxyInstance = proxyFactory.createProxyInstance(proxyClass, provider);
         }
         return proxyInstance;



Mime
View raw message