myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1416907 - in /myfaces/extensions/scripting/trunk/extscript-core-root: extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/ extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/
Date Tue, 04 Dec 2012 12:08:58 GMT
Author: werpu
Date: Tue Dec  4 12:08:57 2012
New Revision: 1416907

URL: http://svn.apache.org/viewvc?rev=1416907&view=rev
Log:
https://issues.apache.org/jira/browse/EXTSCRIPT-183

Modified:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/CDIThrowAwayClassloader.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/CDIThrowAwayClassloader.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/CDIThrowAwayClassloader.java?rev=1416907&r1=1416906&r2=1416907&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/CDIThrowAwayClassloader.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/CDIThrowAwayClassloader.java
Tue Dec  4 12:08:57 2012
@@ -59,25 +59,28 @@ public class CDIThrowAwayClassloader ext
     @Override
     public Class<?> loadClass(String className) throws ClassNotFoundException
     {
-        Class clazz = _delegate.loadClass(className);
         ClassResource res = (ClassResource) WeavingContext.getInstance().getResource(className);
-        if(res == null) {
+        boolean tainted = res.isTainted();
+        Class clazz = _delegate.loadClass(className);
+        if (res == null)
+        {
             return clazz;
         }
 
         Annotation[] anns = clazz.getAnnotations();
         boolean cdiAnnotation = false;
-        if(anns == null || anns.length == 0) {
-            cdiAnnotation = true;
-        } else {
-            for(Annotation ann: anns) {
-               cdiAnnotation = ann instanceof Named;
-               if(cdiAnnotation) break;
-            }
+        //@Named required without named no cdi bean
+        for (Annotation ann : anns)
+        {
+            cdiAnnotation = ann instanceof Named;
+            if (cdiAnnotation) break;
         }
         //we have to taint so that the extscript
         // scanner can take over
-        res.setTainted(!cdiAnnotation);
+        if (!cdiAnnotation)
+        {
+            res.setTainted(tainted);
+        }
         return clazz;
     }
 
@@ -140,7 +143,6 @@ public class CDIThrowAwayClassloader ext
         return ClassLoader.getSystemClassLoader();
     }
 
-
     @Override
     public void setDefaultAssertionStatus(boolean b)
     {

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java?rev=1416907&r1=1416906&r2=1416907&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java
Tue Dec  4 12:08:57 2012
@@ -51,7 +51,6 @@ public class CompilationAwareContextLoad
 
         //we now init the scripting system
 
-
         Class contextClass = determineContextClass(servletContext);
         if (!ConfigurableWebApplicationContext.class.isAssignableFrom(contextClass))
         {



Mime
View raw message