[GR-65850] [GR-68595] Fixing registration methods bypassing reachability handler creation and adding validation checks on registration methods. #12114
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.
This PR resolves issues with some registration methods not creating reachability-handlers. Bypassing the reachability handler in conditional registrations immediately adds condition types to the image heap, which causes types to be treated as reachable even if they shouldn't be. By preventing this, we avoid increasing image size and ensure that the intended semantics of
typeReachableconditions are preserved.All proxy registrations should avoid directly calling
com.oracle.svm.core.reflect.proxy.DynamicProxySupport#addProxyClass, and instead should call the new methodcom.oracle.svm.hosted.reflect.proxy.ProxyRegistry#registerProxywhich creates reachability-handler for previous method.Additionally, this update adds missing validation checks, such as null argument and registration phase validation, across registration methods to improve code reliability. Redundant code in subclasses of
ConditionalConfigurationRegistryhas been refactored for greater consistency and maintainability.