in cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/util/Annotates.java [348:359]
public static Class<? extends Annotation> beanScope(Annotated annotated, Class<? extends Annotation> defaultValue) {
CachingAnnotated cachingAnnotated = CachingAnnotated.class.isInstance(annotated) ?
CachingAnnotated.class.cast(annotated) : null;
Class<? extends Annotation> cached = cachingAnnotated == null ? null : cachingAnnotated.getBeanScope();
if (cached == null) {
cached = collect(annotated.getAnnotations()).stream().filter(isScope).map(Annotation::annotationType).findFirst().orElse(null);
if (cachingAnnotated != null) {
cachingAnnotated.setBeanScope(cached);
}
}
return cached == null ? defaultValue : cached;
}