if(targetContextName.isEmpty()) {
if(isEnvironmentEntryType(injectionType)) {
targetContextName = contextNameSuffix;
} else if(injectionType.isAnnotationPresent(ManagedBean.class)) {
final ManagedBean managedBean = injectionType.getAnnotation(ManagedBean.class);
targetContextName = managedBean.value().isEmpty() ? injectionType.getName() : managedBean.value();
} else {
throw new DeploymentUnitProcessingException("Unable to determine mapped name for @Resource injection.");
}
}
return targetContextName;