Source:
<code>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 { <START> if (superInterface.getSigners() != null || superInterface.getPackage().isSealed()) { <END> proxyPackage = DEFAULT_PROTECED_PROXY_PACKAGE; } else if (superInterface.getPackage() == null) { proxyPackage = DEFAULT_PROXY_PACKAGE; } else { proxyPackage = superInterface.getPackage().getName(); } } } else { if (proxiedBeanType.getSigners() != null || proxiedBeanType.getPackage().isSealed()) { proxyPackage = DEFAULT_PROTECED_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(); 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) { 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; }</code><technical_language>This throw NPE if package is null</technical_language>

Target:
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 { String reason = getDefaultPackageReason(superInterface); if (reason != null) { proxyPackage = DEFAULT_PROXY_PACKAGE; BeanLogger.LOG.generatingProxyToDefaultPackage(superInterface, DEFAULT_PROXY_PACKAGE, reason); } else { proxyPackage = superInterface.getPackage().getName(); } } } else { String reason = getDefaultPackageReason(proxiedBeanType); if (reason != null) { proxyPackage = DEFAULT_PROXY_PACKAGE; BeanLogger.LOG.generatingProxyToDefaultPackage(proxiedBeanType, DEFAULT_PROXY_PACKAGE, reason); } else { proxyPackage = proxiedBeanType.getPackage().getName(); } } final String className; if (typeInfo.getSuperClass() == Object.class) { final StringBuilder name = new StringBuilder(); 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) { 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; }