Annotation[] annotations = pat.getAnnotatedType().getAnnotations()
.toArray(new Annotation[pat.getAnnotatedType().getAnnotations().size()]);
if (ResourceMetadataCollector.isResource(beanClass) && !CdiUtils.isBeanWithScope(annotations, beanManager)) {
logger.trace("{} upgraded to {} scoped bean.", beanClass.getName(), RequestScoped.class.getName());
pat.setAnnotatedType(new WinkAnnotatedTypeWrapper(pat.getAnnotatedType(), new RequestScopedLiteral()));
} else if ((ProviderMetadataCollector.isProvider(beanClass) ||
ApplicationMetadataCollector.isApplication(beanClass)) &&
!CdiUtils.isBeanWithScope(annotations, beanManager)) {
logger.trace("{} upgraded to {} scoped bean.", beanClass.getName(), ApplicationScoped.class.getName());
pat.setAnnotatedType(new WinkAnnotatedTypeWrapper(pat.getAnnotatedType(), new ApplicationScopedLiteral()));