From a065c9ff0a33f73331e9c7957c17b059bca84ca1 Mon Sep 17 00:00:00 2001 From: Wanying Ding Date: Tue, 12 Nov 2024 10:28:06 -0800 Subject: [PATCH] Internal changes RELNOTES=n/a PiperOrigin-RevId: 695785994 --- .../internal/managers/ActivityRetainedComponentManager.java | 2 +- .../codegen/writing/DelegateRequestRepresentation.java | 2 +- .../internal/codegen/writing/MembersInjectionMethods.java | 2 +- .../codegen/writing/ProvisionBindingRepresentation.java | 2 +- .../internal/codegen/writing/SetRequestRepresentation.java | 2 +- .../codegen/writing/StaticFactoryInstanceSupplier.java | 2 +- java/dagger/internal/codegen/xprocessing/XTypeElements.java | 2 +- java/dagger/spi/model/BUILD | 2 +- .../kotlinsrc/assisted/kotlin/KotlinAssistedInjectionTest.kt | 3 +++ 9 files changed, 11 insertions(+), 8 deletions(-) diff --git a/java/dagger/hilt/android/internal/managers/ActivityRetainedComponentManager.java b/java/dagger/hilt/android/internal/managers/ActivityRetainedComponentManager.java index 5c3817c6fd2..3f53a6bcd7e 100644 --- a/java/dagger/hilt/android/internal/managers/ActivityRetainedComponentManager.java +++ b/java/dagger/hilt/android/internal/managers/ActivityRetainedComponentManager.java @@ -120,7 +120,7 @@ public T create( @Override public ActivityRetainedComponent generatedComponent() { - // TODO(wanyingd): don't need the component lock since the component is stored in ViewModel + // TODO(bcorso): don't need the component lock since the component is stored in ViewModel // which does its own locking if (component == null) { synchronized (componentLock) { diff --git a/java/dagger/internal/codegen/writing/DelegateRequestRepresentation.java b/java/dagger/internal/codegen/writing/DelegateRequestRepresentation.java index 5af7abf61de..29b510f0151 100644 --- a/java/dagger/internal/codegen/writing/DelegateRequestRepresentation.java +++ b/java/dagger/internal/codegen/writing/DelegateRequestRepresentation.java @@ -127,7 +127,7 @@ private Expression castToRawTypeIfNecessary(Expression delegateExpression, XType // Casted raw type provider expression has to be wrapped parentheses, otherwise there // will be an error when DerivedFromFrameworkInstanceRequestRepresentation appends a `get()` to // it. - // TODO(wanyingd): change the logic to only add parenthesis when necessary. + // TODO(bcorso): change the logic to only add parenthesis when necessary. return Expression.create( castedExpression.type(), CodeBlock.of("($L)", castedExpression.codeBlock())); } diff --git a/java/dagger/internal/codegen/writing/MembersInjectionMethods.java b/java/dagger/internal/codegen/writing/MembersInjectionMethods.java index c698e2f12f8..f128de3aa38 100644 --- a/java/dagger/internal/codegen/writing/MembersInjectionMethods.java +++ b/java/dagger/internal/codegen/writing/MembersInjectionMethods.java @@ -92,7 +92,7 @@ Expression getInjectExpression(Key key, CodeBlock instance, ClassName requesting } private Expression injectMethodExpression(Binding binding) { - // TODO(wanyingd): move Switching Providers and injection methods to Shard classes to avoid + // TODO(bcorso): move Switching Providers and injection methods to Shard classes to avoid // exceeding component class constant pool limit. // Add to Component Shard so that is can be accessible from Switching Providers. ShardImplementation shardImplementation = componentImplementation.shardImplementation(binding); diff --git a/java/dagger/internal/codegen/writing/ProvisionBindingRepresentation.java b/java/dagger/internal/codegen/writing/ProvisionBindingRepresentation.java index 322e08819c3..35cdb0d2dc7 100644 --- a/java/dagger/internal/codegen/writing/ProvisionBindingRepresentation.java +++ b/java/dagger/internal/codegen/writing/ProvisionBindingRepresentation.java @@ -73,7 +73,7 @@ private boolean usesDirectInstanceExpression(RequestKind requestKind) { // be handled with simple pre-check in the graph. For example, a provider for a subcomponent // builder is backed with its direct instance, returning framework instance for both cases will // form a loop. There are also difficulties introduced by manually created framework requests. - // TODO(wanyingd): refactor framework instance so that we don't need to generate both direct + // TODO(bcorso): refactor framework instance so that we don't need to generate both direct // instance and framework instance representation for the same binding. if (compilerMode.isFastInit() && graph.topLevelBindingGraph().hasFrameworkRequest(binding)) { return false; diff --git a/java/dagger/internal/codegen/writing/SetRequestRepresentation.java b/java/dagger/internal/codegen/writing/SetRequestRepresentation.java index 8849b2f9a09..f8c9d08e6de 100644 --- a/java/dagger/internal/codegen/writing/SetRequestRepresentation.java +++ b/java/dagger/internal/codegen/writing/SetRequestRepresentation.java @@ -146,7 +146,7 @@ private CodeBlock getContributionExpression( return (!isSingleValue(dependency) && !isTypeAccessibleFrom( binding.key().type().xprocessing(), requestingClass.packageName()) - // TODO(wanyingd): Replace instanceof checks with validation on the binding. + // TODO(bcorso): Replace instanceof checks with validation on the binding. && (bindingExpression instanceof DerivedFromFrameworkInstanceRequestRepresentation || bindingExpression instanceof DelegateRequestRepresentation)) ? CodeBlocks.cast(expression, TypeNames.COLLECTION) diff --git a/java/dagger/internal/codegen/writing/StaticFactoryInstanceSupplier.java b/java/dagger/internal/codegen/writing/StaticFactoryInstanceSupplier.java index 6b78a00fdb6..cab6352c43d 100644 --- a/java/dagger/internal/codegen/writing/StaticFactoryInstanceSupplier.java +++ b/java/dagger/internal/codegen/writing/StaticFactoryInstanceSupplier.java @@ -43,7 +43,7 @@ public MemberSelect memberSelect() { return frameworkInstanceSupplier.memberSelect(); } - // TODO(wanyingd): no-op members injector is currently handled in + // TODO(bcorso): no-op members injector is currently handled in // `MembersInjectorProviderCreationExpression`, we should inline the logic here so we won't create // an extra field for it. private MemberSelect staticFactoryCreation(ContributionBinding binding) { diff --git a/java/dagger/internal/codegen/xprocessing/XTypeElements.java b/java/dagger/internal/codegen/xprocessing/XTypeElements.java index 7330b8f6a95..33b0f5be05f 100644 --- a/java/dagger/internal/codegen/xprocessing/XTypeElements.java +++ b/java/dagger/internal/codegen/xprocessing/XTypeElements.java @@ -81,7 +81,7 @@ public static ImmutableList getAllNonPrivateInstanceMethods(XTyp .collect(toImmutableList()); } - // TODO(wanyingd): rename this to getAllMethodsWithoutPrivate, since the private method declared + // TODO(bcorso): rename this to getAllMethodsWithoutPrivate, since the private method declared // within this element is being filtered out. This doesn't mirror {@code // MoreElements#getAllMethods}'s behavior but have the same name, and can cause confusion to // developers. diff --git a/java/dagger/spi/model/BUILD b/java/dagger/spi/model/BUILD index 0dcd010d4db..9567c82f85b 100644 --- a/java/dagger/spi/model/BUILD +++ b/java/dagger/spi/model/BUILD @@ -36,7 +36,7 @@ filegroup( kt_jvm_library( name = "model", srcs = [":model-srcs"], - # TODO(wanyingd): Add javacopts explicitly once kt_jvm_library supports them. + # TODO(bcorso): Add javacopts explicitly once kt_jvm_library supports them. deps = [ "//java/dagger:core", "//java/dagger/internal/codegen/extension", diff --git a/javatests/dagger/functional/kotlinsrc/assisted/kotlin/KotlinAssistedInjectionTest.kt b/javatests/dagger/functional/kotlinsrc/assisted/kotlin/KotlinAssistedInjectionTest.kt index b58d9304477..ebe8dcb4887 100644 --- a/javatests/dagger/functional/kotlinsrc/assisted/kotlin/KotlinAssistedInjectionTest.kt +++ b/javatests/dagger/functional/kotlinsrc/assisted/kotlin/KotlinAssistedInjectionTest.kt @@ -28,8 +28,11 @@ class KotlinAssistedInjectionTest { @Component internal interface TestComponent { fun fooFactory(): FooFactory + fun fooDataFactory(): FooDataFactory + fun barManagerFactory(): BarManager.Factory + } @Test