Map<Class<?>, Type> typeMap = new LinkedHashMap<Class<?>, Type>();
HierarchyDiscovery beanClassDiscovery = HierarchyDiscovery.forNormalizedType(ejbDescriptor.getBeanClass());
for (BusinessInterfaceDescriptor<?> businessInterfaceDescriptor : ejbDescriptor.getLocalBusinessInterfaces()) {
// first we need to resolve the local interface
Type resolvedLocalInterface = beanClassDiscovery.resolveType(Types.getCanonicalType(businessInterfaceDescriptor.getInterface()));
SessionBeanHierarchyDiscovery interfaceDiscovery = new SessionBeanHierarchyDiscovery(resolvedLocalInterface);
if (beanClassDiscovery.getTypeMap().containsKey(businessInterfaceDescriptor.getInterface())) {
// WELD-1675 Only add types also included in Annotated.getTypeClosure()
for (Entry<Class<?>, Type> entry : interfaceDiscovery.getTypeMap().entrySet()) {
if (annotated.getTypeClosure().contains(entry.getValue())) {
typeMap.put(entry.getKey(), entry.getValue());
}
}
} else {
// Session bean class does not implement the business interface and @javax.ejb.Local applied to the session bean class
typeMap.putAll(interfaceDiscovery.getTypeMap());
}
}
if (annotated.isAnnotationPresent(Typed.class)) {
types.addAll(getTypedTypes(typeMap, annotated.getJavaClass(), annotated.getAnnotation(Typed.class)));
} else {