Skip to content

OWB-1465 - Preserve ACC_BRIDGE / ACC_SYNTHETIC on bridge methods re-declared by normal scope proxies#140

Merged
struberg merged 2 commits into
apache:mainfrom
rzo1:normalscope-proxy-bridge-flag
Jul 13, 2026
Merged

OWB-1465 - Preserve ACC_BRIDGE / ACC_SYNTHETIC on bridge methods re-declared by normal scope proxies#140
struberg merged 2 commits into
apache:mainfrom
rzo1:normalscope-proxy-bridge-flag

Conversation

@rzo1

@rzo1 rzo1 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

NormalScopeProxyFactory re-declares the JVM bridge methods of the proxied class but masked the method modifiers with PROTECTED | PUBLIC | VARARGS, dropping the ACC_BRIDGE flag. The proxy then exposed two regular methods with the same name and assignable parameter types, which breaks overload resolution in EL implementations (jakarta.el / Tomcat's ReflectionUtil tie-break on Method#isBridge()) with 'Unable to find unambiguous method'.

Keep ACC_BRIDGE and ACC_SYNTHETIC in both generation paths (delegateNonInterceptedMethods for public methods, generateDelegationMethod for protected ones). Introduces MODIFIER_BRIDGE / MODIFIER_SYNTHETIC constants next to the existing MODIFIER_VARARGS as java.lang.reflect.Modifier does not expose them.

…eclared by normal scope proxies

NormalScopeProxyFactory re-declares the JVM bridge methods of the
proxied class but masked the method modifiers with
PROTECTED | PUBLIC | VARARGS, dropping the ACC_BRIDGE flag. The proxy
then exposed two regular methods with the same name and assignable
parameter types, which breaks overload resolution in EL
implementations (jakarta.el / Tomcat's ReflectionUtil tie-break on
Method#isBridge()) with 'Unable to find unambiguous method'.

Keep ACC_BRIDGE and ACC_SYNTHETIC in both generation paths
(delegateNonInterceptedMethods for public methods,
generateDelegationMethod for protected ones). Introduces
MODIFIER_BRIDGE / MODIFIER_SYNTHETIC constants next to the existing
MODIFIER_VARARGS as java.lang.reflect.Modifier does not expose them.

@mawiesne mawiesne left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

… feedback)

Replace the four inlined modifier masks in NormalScopeProxyFactory and
InterceptorDecoratorProxyFactory with a single documented constant in
AbstractProxyFactory. No behavioural change for the interceptor proxy
paths: bridge methods never reach them (unproxyableMethod skips them),
and synthetic non-bridge methods (lambda$, access$) are private or
static and filtered out before generation.
@struberg struberg merged commit f8f68cc into apache:main Jul 13, 2026
1 check passed
@rzo1 rzo1 deleted the normalscope-proxy-bridge-flag branch July 13, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants