Skip to content

Make gRPC advice handler methods accessible - #443

Merged
dsyer merged 1 commit into
spring-projects:mainfrom
CCCLL:gh-442
Oct 26, 2026
Merged

dsyer merged 1 commit into
spring-projects:mainfrom
CCCLL:gh-442

Conversation

@CCCLL

@CCCLL CCCLL commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Public exception handler methods on package-private @GrpcAdvice beans are discovered but cannot be invoked from another package, causing INTERNAL instead 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

  • Before: On main 5b1ed1a, the eight focused advice tests have one failure: the package-private advice returns INTERNAL instead of INVALID_ARGUMENT; the public-class control passes.
  • After: All eight focused advice tests pass. ./mvnw -B clean install passes on Java 25: 172 tests, zero failures or errors, two existing domain-socket tests skipped on macOS.
  • ./mvnw spring-javaformat:apply javadoc:javadoc -Pjavadoc passes.

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>
@dsyer
dsyer merged commit ed51451 into spring-projects:main Oct 26, 2026
6 checks passed
@dsyer dsyer added this to the 1.1.3 milestone Oct 26, 2026
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.

Package-private @GrpcAdvice classes fail to handle exceptions

2 participants