Skip to content

Commit

Permalink
WELD-1903 Make sure @Vetoed beans do not sneak in through AnnotatedTy…
Browse files Browse the repository at this point in the history
…peLoader fallback
  • Loading branch information
jharting committed Apr 2, 2015
1 parent d15cd68 commit 3b81ed9
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -38,7 +38,8 @@
/**
* Specialized version of {@link AnnotatedTypeLoader}. This implementation uses {@link ClassFileServices} to avoid loading application classes that are not
* needed for Weld. In addition, this implementation feeds {@link SlimAnnotatedTypeContext} with {@link ClassFileInfo} and resolved {@link ProcessAnnotatedType}
* observer methods.
* observer methods. If {@link ClassFileServices} is not sufficient to load an annotated type (e.g. superclass information missing from the index) then a fall back
* to {@link AnnotatedTypeLoader} is performed.
*
* @author Jozef Hartinger
*
Expand All @@ -47,10 +48,12 @@ class FastAnnotatedTypeLoader extends AnnotatedTypeLoader {

private final ClassFileServices classFileServices;
private final FastProcessAnnotatedTypeResolver resolver;
private final AnnotatedTypeLoader fallback;

FastAnnotatedTypeLoader(BeanManagerImpl manager, ClassTransformer transformer, ClassFileServices classFileServices,
ContainerLifecycleEvents events, FastProcessAnnotatedTypeResolver resolver) {
super(manager, transformer, events);
this.fallback = new AnnotatedTypeLoader(manager, transformer, events);
this.classFileServices = classFileServices;
this.resolver = resolver;
}
Expand Down Expand Up @@ -86,7 +89,7 @@ public <T> SlimAnnotatedTypeContext<T> loadAnnotatedType(String className, Strin
return null;
} catch (ClassFileInfoException e) {
BootstrapLogger.LOG.exceptionLoadingAnnotatedType(e.getMessage());
return super.loadAnnotatedType(className, bdaId);
return fallback.loadAnnotatedType(className, bdaId);
}
}

Expand Down

0 comments on commit 3b81ed9

Please sign in to comment.