forked from square/dagger
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for nullable field injection and nullable provides methods.
PiperOrigin-RevId: 675332372
- Loading branch information
1 parent
5f76186
commit 397fdbf
Showing
8 changed files
with
331 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
44 changes: 44 additions & 0 deletions
44
...ionTest_nonTypeUseNullableFieldInjection_DEFAULT_MODE_test.FieldInjection_MembersInjector
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package test; | ||
|
||
import dagger.MembersInjector; | ||
import dagger.internal.DaggerGenerated; | ||
import dagger.internal.InjectedFieldSignature; | ||
import dagger.internal.QualifierMetadata; | ||
import javax.annotation.processing.Generated; | ||
import javax.inject.Provider; | ||
|
||
@QualifierMetadata | ||
@DaggerGenerated | ||
@Generated( | ||
value = "dagger.internal.codegen.ComponentProcessor", | ||
comments = "https://dagger.dev" | ||
) | ||
@SuppressWarnings({ | ||
"unchecked", | ||
"rawtypes", | ||
"KotlinInternal", | ||
"KotlinInternalInJava", | ||
"cast", | ||
"deprecation" | ||
}) | ||
public final class FieldInjection_MembersInjector implements MembersInjector<FieldInjection> { | ||
private final Provider<String> stringProvider; | ||
|
||
public FieldInjection_MembersInjector(Provider<String> stringProvider) { | ||
this.stringProvider = stringProvider; | ||
} | ||
|
||
public static MembersInjector<FieldInjection> create(Provider<String> stringProvider) { | ||
return new FieldInjection_MembersInjector(stringProvider); | ||
} | ||
|
||
@Override | ||
public void injectMembers(FieldInjection instance) { | ||
injectString(instance, stringProvider.get()); | ||
} | ||
|
||
@InjectedFieldSignature("test.FieldInjection.string") | ||
public static void injectString(Object instance, String string) { | ||
((FieldInjection) instance).string = string; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...nTest_nonTypeUseNullableFieldInjection_FAST_INIT_MODE_test.FieldInjection_MembersInjector
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package test; | ||
|
||
import dagger.MembersInjector; | ||
import dagger.internal.DaggerGenerated; | ||
import dagger.internal.InjectedFieldSignature; | ||
import dagger.internal.QualifierMetadata; | ||
import javax.annotation.processing.Generated; | ||
import javax.inject.Provider; | ||
|
||
@QualifierMetadata | ||
@DaggerGenerated | ||
@Generated( | ||
value = "dagger.internal.codegen.ComponentProcessor", | ||
comments = "https://dagger.dev" | ||
) | ||
@SuppressWarnings({ | ||
"unchecked", | ||
"rawtypes", | ||
"KotlinInternal", | ||
"KotlinInternalInJava", | ||
"cast", | ||
"deprecation" | ||
}) | ||
public final class FieldInjection_MembersInjector implements MembersInjector<FieldInjection> { | ||
private final Provider<String> stringProvider; | ||
|
||
public FieldInjection_MembersInjector(Provider<String> stringProvider) { | ||
this.stringProvider = stringProvider; | ||
} | ||
|
||
public static MembersInjector<FieldInjection> create(Provider<String> stringProvider) { | ||
return new FieldInjection_MembersInjector(stringProvider); | ||
} | ||
|
||
@Override | ||
public void injectMembers(FieldInjection instance) { | ||
injectString(instance, stringProvider.get()); | ||
} | ||
|
||
@InjectedFieldSignature("test.FieldInjection.string") | ||
public static void injectString(Object instance, String string) { | ||
((FieldInjection) instance).string = string; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...ectionTest_typeUseNullableFieldInjection_DEFAULT_MODE_test.FieldInjection_MembersInjector
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package test; | ||
|
||
import dagger.MembersInjector; | ||
import dagger.internal.DaggerGenerated; | ||
import dagger.internal.InjectedFieldSignature; | ||
import dagger.internal.QualifierMetadata; | ||
import javax.annotation.processing.Generated; | ||
import javax.inject.Provider; | ||
|
||
@QualifierMetadata | ||
@DaggerGenerated | ||
@Generated( | ||
value = "dagger.internal.codegen.ComponentProcessor", | ||
comments = "https://dagger.dev" | ||
) | ||
@SuppressWarnings({ | ||
"unchecked", | ||
"rawtypes", | ||
"KotlinInternal", | ||
"KotlinInternalInJava", | ||
"cast", | ||
"deprecation" | ||
}) | ||
public final class FieldInjection_MembersInjector implements MembersInjector<FieldInjection> { | ||
private final Provider<String> stringProvider; | ||
|
||
public FieldInjection_MembersInjector(Provider<String> stringProvider) { | ||
this.stringProvider = stringProvider; | ||
} | ||
|
||
public static MembersInjector<FieldInjection> create(Provider<String> stringProvider) { | ||
return new FieldInjection_MembersInjector(stringProvider); | ||
} | ||
|
||
@Override | ||
public void injectMembers(FieldInjection instance) { | ||
injectString(instance, stringProvider.get()); | ||
} | ||
|
||
@InjectedFieldSignature("test.FieldInjection.string") | ||
public static void injectString(Object instance, String string) { | ||
((FieldInjection) instance).string = string; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...tionTest_typeUseNullableFieldInjection_FAST_INIT_MODE_test.FieldInjection_MembersInjector
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package test; | ||
|
||
import dagger.MembersInjector; | ||
import dagger.internal.DaggerGenerated; | ||
import dagger.internal.InjectedFieldSignature; | ||
import dagger.internal.QualifierMetadata; | ||
import javax.annotation.processing.Generated; | ||
import javax.inject.Provider; | ||
|
||
@QualifierMetadata | ||
@DaggerGenerated | ||
@Generated( | ||
value = "dagger.internal.codegen.ComponentProcessor", | ||
comments = "https://dagger.dev" | ||
) | ||
@SuppressWarnings({ | ||
"unchecked", | ||
"rawtypes", | ||
"KotlinInternal", | ||
"KotlinInternalInJava", | ||
"cast", | ||
"deprecation" | ||
}) | ||
public final class FieldInjection_MembersInjector implements MembersInjector<FieldInjection> { | ||
private final Provider<String> stringProvider; | ||
|
||
public FieldInjection_MembersInjector(Provider<String> stringProvider) { | ||
this.stringProvider = stringProvider; | ||
} | ||
|
||
public static MembersInjector<FieldInjection> create(Provider<String> stringProvider) { | ||
return new FieldInjection_MembersInjector(stringProvider); | ||
} | ||
|
||
@Override | ||
public void injectMembers(FieldInjection instance) { | ||
injectString(instance, stringProvider.get()); | ||
} | ||
|
||
@InjectedFieldSignature("test.FieldInjection.string") | ||
public static void injectString(Object instance, String string) { | ||
((FieldInjection) instance).string = string; | ||
} | ||
} |
This file contains 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
43 changes: 43 additions & 0 deletions
43
...s/ModuleFactoryGeneratorTest_typeUseNullableProvides_test.TestModule_ProvideStringFactory
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package test; | ||
|
||
import dagger.internal.DaggerGenerated; | ||
import dagger.internal.Factory; | ||
import dagger.internal.QualifierMetadata; | ||
import dagger.internal.ScopeMetadata; | ||
import javax.annotation.processing.Generated; | ||
|
||
@ScopeMetadata | ||
@QualifierMetadata | ||
@DaggerGenerated | ||
@Generated( | ||
value = "dagger.internal.codegen.ComponentProcessor", | ||
comments = "https://dagger.dev" | ||
) | ||
@SuppressWarnings({ | ||
"unchecked", | ||
"rawtypes", | ||
"KotlinInternal", | ||
"KotlinInternalInJava", | ||
"cast", | ||
"deprecation" | ||
}) | ||
public final class TestModule_ProvideStringFactory implements Factory<String> { | ||
private final TestModule module; | ||
|
||
public TestModule_ProvideStringFactory(TestModule module) { | ||
this.module = module; | ||
} | ||
|
||
@Override | ||
public @Nullable String get() { | ||
return provideString(module); | ||
} | ||
|
||
public static TestModule_ProvideStringFactory create(TestModule module) { | ||
return new TestModule_ProvideStringFactory(module); | ||
} | ||
|
||
public static @Nullable String provideString(TestModule instance) { | ||
return instance.provideString(); | ||
} | ||
} |