Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the javac element to get the @BindsInstance parameter name. #3056

Merged
merged 1 commit into from Nov 22, 2021

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Nov 22, 2021

Use the javac element to get the @BindsInstance parameter name.

This CL fixes an issue where the parameter name for a ComponentRequirement causes a cache-miss for that requirement. This occurs because one ComponentRequirement uses the name from JavacMethodParameter.getName() which pulls the original parameter name from the KotlinMetadata, and the other uses VariableElement.getSimpleName() which may match the original parameter in some cases but may be "arg0" if the name comes from a precompiled class. This difference in name causes the cache miss.

I'll need to look into if this is something we should fix on the XProcessing side, e.g. have the user explicitly choose if they want to use the name from the kotlin metadata.

Fixes #2997

Fixes #3032

RELNOTES=N/A

@google-cla google-cla bot added the cla: yes label Nov 22, 2021
@copybara-service copybara-service bot force-pushed the test_411454511 branch 3 times, most recently from 5a8880a to 826582b Compare November 22, 2021 21:33
This CL fixes an issue where the parameter name for a ComponentRequirement causes a cache-miss for that requirement. This occurs because one ComponentRequirement uses the name from JavacMethodParameter.getName() which pulls the original parameter name from the KotlinMetadata, and the other uses VariableElement.getSimpleName() which may match the original parameter in some cases but may be "arg0" if the name comes from a precompiled class. This difference in name causes the cache miss.

I'll need to look into if this is something we should fix on the XProcessing side, e.g. have the user explicitly choose if they want to use the name from the kotlin metadata.

Fixes #2997

Fixes #3032

RELNOTES=N/A
PiperOrigin-RevId: 411640088
@copybara-service copybara-service bot merged commit ec1a98c into master Nov 22, 2021
@copybara-service copybara-service bot deleted the test_411454511 branch November 22, 2021 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant