Permalink
Browse files

https://issues.apache.org/jira/browse/EXTSCRIPT-183

  • Loading branch information...
1 parent fd312a1 commit 04b2602634f1de3b65dde64fcd8935ac57c0aeca @weblets weblets committed Dec 4, 2012
@@ -59,25 +59,28 @@ public CDIThrowAwayClassloader()
@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 static ClassLoader getSystemClassLoader()
return ClassLoader.getSystemClassLoader();
}
-
@Override
public void setDefaultAssertionStatus(boolean b)
{
@@ -51,7 +51,6 @@ protected WebApplicationContext createWebApplicationContext(
//we now init the scripting system
-
Class contextClass = determineContextClass(servletContext);
if (!ConfigurableWebApplicationContext.class.isAssignableFrom(contextClass))
{

0 comments on commit 04b2602

Please sign in to comment.