Skip to content

fix(aop): preserve toString behavior for lazy proxies - #12875

Open
Boulea7 wants to merge 1 commit into
micronaut-projects:5.2.xfrom
Boulea7:zln-fix-12873-refreshable-tostring
Open

fix(aop): preserve toString behavior for lazy proxies#12875
Boulea7 wants to merge 1 commit into
micronaut-projects:5.2.xfrom
Boulea7:zln-fix-12873-refreshable-tostring

Conversation

@Boulea7

@Boulea7 Boulea7 commented Aug 11, 2026

Copy link
Copy Markdown

Fixes #12873

Summary

  • avoid emitting a duplicate lazy-proxy toString() when the target declares an interceptable override
  • avoid overriding an inherited final toString() while preserving default and inherited non-final behavior
  • add annotation-processing and runtime coverage for @Refreshable proxies

Verification

  • focused ScopedProxyToStringSpec: 4 tests passed
  • related AOP and final-method tests: 41 tests passed
  • RefreshScopeSpec: 9 tests passed
  • full micronaut-inject-java tests: 4,880 tests, 8 skipped, 0 failed
  • spotlessCheck
  • micronaut-core-processor and micronaut-inject-java Checkstyle, build, and japiCmp tasks

Local verification used OpenJDK 26 because the GraalVM for JDK 25 version specified by CONTRIBUTING.md was not available in the test environment. The affected module builds completed successfully while reporting existing Javadoc diagnostics from unchanged files. Upstream CI has not yet run for this pull request.

@cla-assistant

cla-assistant Bot commented Aug 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Boulea7
Boulea7 marked this pull request as ready for review August 11, 2026 16:52
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.

ClassFormatError: duplicate toString() in generated $Intercepted proxy when the proxied bean declares toString()

1 participant