Eliminate Per-Operation Lambdas for Constant Pool Overflow Fix#7150
Open
S-Saranya1 wants to merge 14 commits into
Open
Eliminate Per-Operation Lambdas for Constant Pool Overflow Fix#7150S-Saranya1 wants to merge 14 commits into
S-Saranya1 wants to merge 14 commits into
Conversation
davidh44
reviewed
Jul 15, 2026
davidh44
reviewed
Jul 15, 2026
davidh44
reviewed
Jul 15, 2026
davidh44
approved these changes
Jul 16, 2026
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.
Motivation and Context
The interceptor-to-pipeline-stages migration PR #7017 introduced two inline lambdas per operation in generated service clients for endpoint and auth scheme resolution. Each lambda adds ~8-16 constant pool entries to the class file. For services with a large number of operations (800+), this adds enough constant pool entries to push the generated async client class past the JVM's hard 65,535 entry limit, causing a compilation failure:
too many constants
PR #7111 provided a short-term fix using factory methods, reducing the cost to ~2-3 entries per operation. This PR implements the long-term fix to eliminate per-operation lambdas entirely, reducing the constant pool cost from resolvers to zero per operation.
Modifications
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License