Skip to content

Java 6065#2

Open
rozza wants to merge 3 commits into
vbabanin:JAVA-6065from
rozza:JAVA-6065
Open

Java 6065#2
rozza wants to merge 3 commits into
vbabanin:JAVA-6065from
rozza:JAVA-6065

Conversation

@rozza

@rozza rozza commented Jul 13, 2026

Copy link
Copy Markdown

Minor updates for JAVA-6065 branch

rozza added 3 commits July 13, 2026 14:50
Holder/NonGeneric fields must be private (VisibilityModifier); they are
read via reflection so accessors are unnecessary. Also drop the unused
Holder.scalar field.

JAVA-6065
resolveTypeArgument previously fell through to Object for a WildcardType,
so a wildcard nested inside a forwarded supertype argument (e.g.
extends Base<List<? extends Number>>) lost its bound. Resolve it to its
upper bound, mirroring getNestedTypeData, so a type variable inside the
bound is still substituted against the current context.

Adds a TypeData unit test for the bound resolution and a discriminated
POJO round-trip (ForwardingWildcardModel) that fails without the fix.

JAVA-6065
The two newInstance overloads duplicated near-identical type-argument
walking. resolveTypeArgument is a strict superset of getNestedTypeData
(with an empty context, type variables erase to Object exactly as
before), and it also fixes a latent ClassCastException when a wildcard's
upper bound is itself parameterized (e.g. ? extends List<String>).
Delegate the two-arg newInstance to it and remove getNestedTypeData.

JAVA-6065
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.

1 participant