Skip to content

Commit

Permalink
Clean up old eclipse workaround that should be resolved as of Eclipse…
Browse files Browse the repository at this point in the history
… 4.7 as per

https://bugs.eclipse.org/bugs/show_bug.cgi?id=517710

RELNOTES=N/A
PiperOrigin-RevId: 693597625
  • Loading branch information
java-team-github-bot authored and Dagger Team committed Nov 6, 2024
1 parent 1e94691 commit c44ddb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions java/dagger/internal/DoubleCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ public T get() {
}

/** Returns a {@link Provider} that caches the value from the given delegate provider. */
// This method is declared this way instead of "<T> Provider<T> provider(Provider<T> delegate)"
// to work around an Eclipse type inference bug: https://github.com/google/dagger/issues/949.
public static <P extends dagger.internal.Provider<T>, T> dagger.internal.Provider<T> provider(
P delegate) {
public static <T> dagger.internal.Provider<T> provider(dagger.internal.Provider<T> delegate) {
checkNotNull(delegate);
if (delegate instanceof DoubleCheck) {
/* This should be a rare case, but if we have a scoped @Binds that delegates to a scoped
Expand Down
4 changes: 1 addition & 3 deletions java/dagger/internal/SingleCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ public T get() {
}

/** Returns a {@link Provider} that caches the value from the given delegate provider. */
// This method is declared this way instead of "<T> Provider<T> provider(Provider<T> provider)"
// to work around an Eclipse type inference bug: https://github.com/google/dagger/issues/949.
public static <P extends Provider<T>, T> Provider<T> provider(P provider) {
public static <T> Provider<T> provider(Provider<T> provider) {
// If a scoped @Binds delegates to a scoped binding, don't cache the value again.
if (provider instanceof SingleCheck || provider instanceof DoubleCheck) {
return provider;
Expand Down

0 comments on commit c44ddb5

Please sign in to comment.