Repository navigation
Make gRPC advice handler methods accessible - #443
Merged
Merged
Conversation
Allow public exception handler methods declared on package-private advice classes to be invoked from another package. Add regression coverage for package-private advice and a public control. Fixes spring-projectsgh-442 Signed-off-by: Jialin Chen <cccll2019@gmail.com>
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
Public exception handler methods on package-private
@GrpcAdvicebeans are discovered but cannot be invoked from another package, causingINTERNALinstead of the intended status. Make the mapped method accessible before invoking it, and add a cross-package regression test with a public-class control.+ ReflectionUtils.makeAccessible(mappedMethod); return mappedMethod.invoke(instanceOfMappedMethod, instancedParams);Closes #442.
Evidence
5b1ed1a, the eight focused advice tests have one failure: the package-private advice returnsINTERNALinstead ofINVALID_ARGUMENT; the public-class control passes../mvnw -B clean installpasses on Java 25: 172 tests, zero failures or errors, two existing domain-socket tests skipped on macOS../mvnw spring-javaformat:apply javadoc:javadoc -Pjavadocpasses.