Skip to content

Commit

Permalink
WELD-2684 - Prepend proxy class names for "jakarta.*" packages with t…
Browse files Browse the repository at this point in the history
…he same Weld Proxy prefix as "java.*" and "javax.*" packages, to prevent classloader issues in container-provided jakarta-apis
  • Loading branch information
metaxmx authored and manovotn committed Oct 6, 2021
1 parent 9b79162 commit b66b5a8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public class ProxyFactory<T> implements PrivilegedAction<T> {
protected static final String INVOKE_METHOD_NAME = "invoke";
protected static final String METHOD_HANDLER_FIELD_NAME = "methodHandler";
static final String JAVA = "java";
static final String JAKARTA = "jakarta";
static final String NO_PACKAGE = "the class package is null or empty";
static final String SIGNED = "the class is signed";
private static final Set<ProxiedMethodFilter> METHOD_FILTERS;
Expand Down Expand Up @@ -385,6 +386,8 @@ public Class<T> getProxyClass() {
}
if (proxyClassName.startsWith(JAVA)) {
proxyClassName = proxyClassName.replaceFirst(JAVA, WELD_PROXY_PREFIX);
} else if (proxyClassName.startsWith(JAKARTA)) {
proxyClassName = proxyClassName.replaceFirst(JAKARTA, WELD_PROXY_PREFIX);
}
Class<T> proxyClass = null;
Class<?> originalClass = bean != null ? bean.getBeanClass() : proxiedBeanType;
Expand Down

0 comments on commit b66b5a8

Please sign in to comment.