this.instantiatorFactory = null;
}
}
static String getProxyName(String contextId, Class<?> proxiedBeanType, Set<? extends Type> typeClosure, Bean<?> bean) {
TypeInfo typeInfo = TypeInfo.of(typeClosure);
String proxyPackage;
if (proxiedBeanType.equals(Object.class)) {
Class<?> superInterface = typeInfo.getSuperInterface();
if (superInterface == null) {
throw new IllegalArgumentException("Proxied bean type cannot be java.lang.Object without an interface");
} else {
proxyPackage = DEFAULT_PROXY_PACKAGE;
}
} else {
if (proxiedBeanType.getPackage() == null) {
proxyPackage = DEFAULT_PROXY_PACKAGE;
} else {
proxyPackage = proxiedBeanType.getPackage().getName();
}
}
final String className;
if (typeInfo.getSuperClass() == Object.class) {
final StringBuilder name = new StringBuilder();
//interface only bean.
className = createCompoundProxyName(contextId, bean, typeInfo, name) + PROXY_SUFFIX;
} else {
boolean typeModified = false;
for (Class<?> iface : typeInfo.getInterfaces()) {
if (!iface.isAssignableFrom(typeInfo.getSuperClass())) {
typeModified = true;
break;
}
}
if (typeModified) {
//this bean has interfaces that the base type is not assignable to
//which can happen with some creative use of the SPI
//interface only bean.
StringBuilder name = new StringBuilder(typeInfo.getSuperClass().getSimpleName() + "$");
className = createCompoundProxyName(contextId, bean, typeInfo, name) + PROXY_SUFFIX;
} else {
className = typeInfo.getSuperClass().getSimpleName() + PROXY_SUFFIX;
}
}
return proxyPackage + '.' + getEnclosingPrefix(proxiedBeanType) + className;