Repository navigation
Fix setting JDK internal containers into Object properties - #1395
Merged
Merged
Conversation
github-actions
Bot
requested review from
SooKim1110,
acktsap,
benelog,
jwChung and
mhyeon-lee
November 19, 2026 04:44
seongahjo
force-pushed
the
fix/1390-object-immutable-container
branch
5 times, most recently
from
November 19, 2026 07:28
7008b97 to
9273483
Compare
This was referenced Nov 19, 2026
seongahjo
force-pushed
the
fix/1390-object-immutable-container
branch
2 times, most recently
from
November 19, 2026 08:18
d635af9 to
a86f7ca
Compare
- Resolve non-public JDK containers to the nearest public container supertype - Use the implementation registered for that supertype, or the default one - Keep declared type arguments when the inferred one is a non-public JDK container - Resolve the content sharing its container's path without the container's path resolver
seongahjo
force-pushed
the
fix/1390-object-immutable-container
branch
from
November 19, 2026 08:31
a86f7ca to
932469c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
set()of a JDK internal container such asList.of(...),Set.of(...)orMap.of(...)into anObjectproperty threwInaccessibleObjectException, or samplednullwith three or more elements (#1390). The property now gets a public implementation with the same elements, as in 1.1.23.This is the second of four stacked PRs, based on #1397:
(Optional): Description
ImmutableCollections$List12,Collections$UnmodifiableSet, ...),JvmNodeTreeTransformerresolves the node to the nearest public container supertype (List,Set,Map,NavigableSet, ...) and then to its implementation.interfaceImplements(NavigableSet.class, ...), or the default one.Object:Serializable, a type variable,List<Serializable>elements, wildcard elements andMap<Object, V>keys.GenericTypeResolverConverteruses the type arguments inferred from the value only when they are assignable to the declared ones. It keeps the declared ones when the inferred type is a non-public JDK container and the declared type has a default container implementation.Types.isJdkInternalTypedecides what a non-public JDK type is. It replaces the package-privateInterfaceResolverConverter.isInstantiable.Supplier,FunctionorOptional) is resolved without the container's path-based interface resolver. A set object with aSupplier<Object>field no longer ends in aStackOverflowError.How Has This Been Tested?
SetJdkInternalContainerTestinfixture-monkey-tests/java-17-tests(16 tests):List.of,Set.ofandMap.ofwith one and three elements into anObjectpropertyList.ofinto anObjectpropertySet.ofinto aList<Object>elementList.ofinto aMap<String, Object>value and aMap<Object, V>keyNavigableSetuses the implementation registered forNavigableSetSerializableproperty, type variable property,List<Serializable>element and wildcard list elementSetObjectIsolationTest: a set object keeps itsSupplier<Object>andSupplier<Supplier<Object>>fields. Both ended inStackOverflowErrorbefore this PR.object-farm-api,fixture-monkey,fixture-monkey-kotlin,java-tests,java-17-testsandkotlin-testswith checkstyle, Checker Framework and ktlintIs the Document updated?
No documentation change is needed.