Skip to content

Conversation

@copybara-service
Copy link

Add a regression test for a bug from an earlier iteration of the MethodHandles implementation

If a javax.inject.Provider was bound in a scope, we would enforce that it was a com.google.inject.Provider which was wrong. This is due to logic in MoreTypes.canonicalizeForKey which canonicalizes javax.inject.Provider to the guice interface.

This behavior makes sense for injection points since guice only ever hands out com.google.inject.Provider instances but we don't always canonicalize them at every phase of injection which is what lead to the bug. Now we no longer use Dependency objects to enforce types so we don't risk this issue anymore

…odHandles implementation

If a `javax.inject.Provider` was bound in a scope, we would enforce that it was a `com.google.inject.Provider` which was wrong.  This is due to logic in `MoreTypes.canonicalizeForKey` which canonicalizes `javax.inject.Provider` to the guice interface.

This behavior makes sense for injection points since guice only ever hands out `com.google.inject.Provider` instances but we don't always canonicalize them at every phase of injection which is what lead to the bug.  Now we no longer use `Dependency` objects to enforce types so we don't risk this issue anymore

PiperOrigin-RevId: 741155148
@copybara-service copybara-service bot merged commit fba0e10 into master Mar 27, 2025
@copybara-service copybara-service bot deleted the test_741129931 branch March 27, 2025 15:02
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.

1 participant