diff --git a/java/dagger/internal/codegen/BUILD b/java/dagger/internal/codegen/BUILD index af3e3e6be9b..80ca8d7dc5e 100644 --- a/java/dagger/internal/codegen/BUILD +++ b/java/dagger/internal/codegen/BUILD @@ -88,7 +88,6 @@ gen_maven_artifact( ], artifact_target_maven_deps = [ "com.google.code.findbugs:jsr305", - "com.google.dagger:dagger-producers", "com.google.dagger:dagger-spi", "com.google.dagger:dagger", "com.google.devtools.ksp:symbol-processing-api", diff --git a/java/dagger/internal/codegen/binding/BUILD b/java/dagger/internal/codegen/binding/BUILD index e606eb414db..7ba349e5bd8 100644 --- a/java/dagger/internal/codegen/binding/BUILD +++ b/java/dagger/internal/codegen/binding/BUILD @@ -31,11 +31,8 @@ java_library( "//java/dagger/internal/codegen/extension", "//java/dagger/internal/codegen/javapoet", "//java/dagger/internal/codegen/kotlin", - "//java/dagger/internal/codegen/langmodel", "//java/dagger/internal/codegen/model", "//java/dagger/internal/codegen/xprocessing", - "//java/dagger/producers", - "//third_party/java/auto:common", "//third_party/java/auto:value", "//third_party/java/error_prone:annotations", "//third_party/java/guava/base", diff --git a/java/dagger/internal/codegen/binding/BindingGraphFactory.java b/java/dagger/internal/codegen/binding/BindingGraphFactory.java index da7b1a3f8e1..fe59c19ab87 100644 --- a/java/dagger/internal/codegen/binding/BindingGraphFactory.java +++ b/java/dagger/internal/codegen/binding/BindingGraphFactory.java @@ -58,7 +58,6 @@ import dagger.internal.codegen.model.Key; import dagger.internal.codegen.model.Scope; import dagger.internal.codegen.xprocessing.XTypeElements; -import dagger.producers.internal.ProductionExecutorModule; import java.util.ArrayDeque; import java.util.Deque; import java.util.HashMap; @@ -292,7 +291,7 @@ private ModuleDescriptor descriptorForMonitoringModule(XTypeElement componentDef processingEnv, generatedMonitoringModuleName(componentDefinitionType))); } - /** Returns a descriptor {@link ProductionExecutorModule}. */ + /** Returns a descriptor {@code ProductionExecutorModule}. */ private ModuleDescriptor descriptorForProductionExecutorModule() { return moduleDescriptorFactory.create( processingEnv.findTypeElement(TypeNames.PRODUCTION_EXECTUTOR_MODULE)); diff --git a/java/dagger/internal/codegen/binding/DependencyRequestFormatter.java b/java/dagger/internal/codegen/binding/DependencyRequestFormatter.java index 80591b121ea..853ee994bd6 100644 --- a/java/dagger/internal/codegen/binding/DependencyRequestFormatter.java +++ b/java/dagger/internal/codegen/binding/DependencyRequestFormatter.java @@ -25,12 +25,10 @@ import androidx.room.compiler.processing.XElement; import androidx.room.compiler.processing.XProcessingEnv; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import dagger.Provides; import dagger.internal.codegen.base.Formatter; import dagger.internal.codegen.model.DaggerAnnotation; import dagger.internal.codegen.model.DependencyRequest; import dagger.internal.codegen.xprocessing.XTypes; -import dagger.producers.Produces; import java.util.Optional; import javax.inject.Inject; @@ -43,8 +41,7 @@ *
{@code @Qualifier SomeType is provided at\n ComponentType.method()} *
For component injection methods *
{@code SomeType is injected at\n ComponentType.method(foo)} - *
For parameters to {@link Provides @Provides}, {@link Produces @Produces}, or {@link - * Inject @Inject} methods: + *
For parameters to {@code @Provides}, {@code @Produces}, or {@code @Inject} methods: *
{@code @Qualified ResolvedType is injected at\n EnclosingType.method([…, ]param[, …])} *
For parameters to {@link Inject @Inject} constructors: *
{@code @Qualified ResolvedType is injected at\n EnclosingType([…, ]param[, …])} diff --git a/java/dagger/internal/codegen/binding/FrameworkTypeMapper.java b/java/dagger/internal/codegen/binding/FrameworkTypeMapper.java index 0e17d9687ca..bd439bf93eb 100644 --- a/java/dagger/internal/codegen/binding/FrameworkTypeMapper.java +++ b/java/dagger/internal/codegen/binding/FrameworkTypeMapper.java @@ -19,12 +19,10 @@ import static dagger.internal.codegen.binding.BindingType.PRODUCTION; import dagger.internal.codegen.model.RequestKind; -import dagger.producers.Producer; -import javax.inject.Provider; /** * A mapper for associating a {@link RequestKind} to a {@link FrameworkType}, dependent on the type - * of code to be generated (e.g., for {@link Provider} or {@link Producer}). + * of code to be generated (e.g., for {@code Provider} or {@code Producer}). */ public enum FrameworkTypeMapper { FOR_PROVIDER() { diff --git a/java/dagger/internal/codegen/javapoet/TypeNames.java b/java/dagger/internal/codegen/javapoet/TypeNames.java index 105394d42da..814022254e7 100644 --- a/java/dagger/internal/codegen/javapoet/TypeNames.java +++ b/java/dagger/internal/codegen/javapoet/TypeNames.java @@ -81,6 +81,8 @@ public final class TypeNames { // Dagger Producers classnames public static final ClassName ABSTRACT_PRODUCER = ClassName.get("dagger.producers.internal", "AbstractProducer"); + public static final ClassName ABSTRACT_PRODUCES_METHOD_PRODUCER = + ClassName.get("dagger.producers.internal", "AbstractProducesMethodProducer"); public static final ClassName CANCELLATION_LISTENER = ClassName.get("dagger.producers.internal", "CancellationListener"); public static final ClassName CANCELLATION_POLICY = diff --git a/java/dagger/internal/codegen/model/BUILD b/java/dagger/internal/codegen/model/BUILD index e6c944ba00c..f497f13c02b 100644 --- a/java/dagger/internal/codegen/model/BUILD +++ b/java/dagger/internal/codegen/model/BUILD @@ -27,8 +27,6 @@ java_library( "//java/dagger:core", "//java/dagger/internal/codegen/extension", "//java/dagger/internal/codegen/xprocessing", - "//java/dagger/producers", - "//java/dagger/spi", "//third_party/java/auto:common", "//third_party/java/auto:value", "//third_party/java/guava/base", diff --git a/java/dagger/internal/codegen/model/RequestKind.java b/java/dagger/internal/codegen/model/RequestKind.java index 581a829b354..d21a04a4160 100644 --- a/java/dagger/internal/codegen/model/RequestKind.java +++ b/java/dagger/internal/codegen/model/RequestKind.java @@ -19,11 +19,6 @@ import static com.google.common.base.CaseFormat.UPPER_CAMEL; import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; -import dagger.Lazy; -import dagger.producers.Produced; -import dagger.producers.Producer; -import javax.inject.Provider; - /** * Represents the different kinds of {@link javax.lang.model.type.TypeMirror types} that may be * requested as dependencies for the same key. For example, {@code String}, {@code @@ -35,13 +30,13 @@ public enum RequestKind { /** A default request for an instance. E.g.: {@code FooType} */ INSTANCE, - /** A request for a {@link Provider}. E.g.: {@code Provider} */ + /** A request for a {@code Provider}. E.g.: {@code Provider} */ PROVIDER, - /** A request for a {@link Lazy}. E.g.: {@code Lazy} */ + /** A request for a {@code Lazy}. E.g.: {@code Lazy} */ LAZY, - /** A request for a {@link Provider} of a {@link Lazy}. E.g.: {@code Provider>} */ + /** A request for a {@code Provider} of a {@code Lazy}. E.g.: {@code Provider>}. */ PROVIDER_OF_LAZY, /** @@ -50,10 +45,10 @@ public enum RequestKind { */ MEMBERS_INJECTION, - /** A request for a {@link Producer}. E.g.: {@code Producer} */ + /** A request for a {@code Producer}. E.g.: {@code Producer} */ PRODUCER, - /** A request for a {@link Produced}. E.g.: {@code Produced} */ + /** A request for a {@code Produced}. E.g.: {@code Produced} */ PRODUCED, /** diff --git a/java/dagger/internal/codegen/writing/BUILD b/java/dagger/internal/codegen/writing/BUILD index c8f9b61c2ae..3adeb66cdc7 100644 --- a/java/dagger/internal/codegen/writing/BUILD +++ b/java/dagger/internal/codegen/writing/BUILD @@ -31,11 +31,9 @@ java_library( "//java/dagger/internal/codegen/compileroption", "//java/dagger/internal/codegen/extension", "//java/dagger/internal/codegen/javapoet", - "//java/dagger/internal/codegen/kotlin", "//java/dagger/internal/codegen/langmodel", "//java/dagger/internal/codegen/model", "//java/dagger/internal/codegen/xprocessing", - "//java/dagger/producers", "//third_party/java/auto:common", "//third_party/java/auto:value", "//third_party/java/error_prone:annotations", diff --git a/java/dagger/internal/codegen/writing/OptionalFactories.java b/java/dagger/internal/codegen/writing/OptionalFactories.java index deb9dbfa83b..446f231e025 100644 --- a/java/dagger/internal/codegen/writing/OptionalFactories.java +++ b/java/dagger/internal/codegen/writing/OptionalFactories.java @@ -62,15 +62,12 @@ import dagger.internal.codegen.javapoet.AnnotationSpecs; import dagger.internal.codegen.javapoet.TypeNames; import dagger.internal.codegen.model.RequestKind; -import dagger.producers.Producer; -import dagger.producers.internal.Producers; import java.util.Comparator; import java.util.Map; import java.util.Optional; import java.util.TreeMap; import java.util.concurrent.Executor; import javax.inject.Inject; -import javax.inject.Provider; /** The nested class and static methods required by the component to implement optional bindings. */ // TODO(dpb): Name members simply if a component uses only one of Guava or JDK Optional. @@ -193,7 +190,7 @@ private FieldSpec absentOptionalProviderField(OptionalKind optionalKind) { /** Information about the type of a factory for present bindings. */ @AutoValue abstract static class PresentFactorySpec { - /** Whether the factory is a {@link Provider} or a {@link Producer}. */ + /** Whether the factory is a {@code Provider} or a {@code Producer}. */ abstract FrameworkType frameworkType(); /** What kind of {@code Optional} is returned. */ @@ -302,7 +299,7 @@ private static PresentFactorySpec of(ContributionBinding binding) { * {@code Producer>>}. * * - * @param delegateFactory an expression for a {@link Provider} or {@link Producer} of the + * @param delegateFactory an expression for a {@code Provider} or {@code Producer} of the * underlying type */ CodeBlock presentOptionalFactory(ContributionBinding binding, CodeBlock delegateFactory) { @@ -415,7 +412,9 @@ private MethodSpec presentOptionalFactoryGetMethod( spec.optionalKind(), spec.valueType(), CodeBlock.of( - "$T.createFutureProduced($N.get())", Producers.class, delegateField))) + "$T.createFutureProduced($N.get())", + TypeNames.PRODUCERS, + delegateField))) .build(); default: diff --git a/java/dagger/internal/codegen/writing/ProducerEntryPointView.java b/java/dagger/internal/codegen/writing/ProducerEntryPointView.java index 648e2537fef..34d54584d69 100644 --- a/java/dagger/internal/codegen/writing/ProducerEntryPointView.java +++ b/java/dagger/internal/codegen/writing/ProducerEntryPointView.java @@ -31,14 +31,11 @@ import dagger.internal.codegen.javapoet.TypeNames; import dagger.internal.codegen.model.RequestKind; import dagger.internal.codegen.writing.ComponentImplementation.ShardImplementation; -import dagger.producers.Producer; -import dagger.producers.internal.CancellationListener; -import dagger.producers.internal.Producers; import java.util.Optional; /** - * A factory of {@linkplain Producers#entryPointViewOf(Producer, CancellationListener) entry point - * views} of {@link Producer}s. + * A factory of {@code Producers#entryPointViewOf(Producer, CancellationListener)} of + * {@code Producer}s. */ final class ProducerEntryPointView { private final ShardImplementation shardImplementation; @@ -50,9 +47,8 @@ final class ProducerEntryPointView { } /** - * Returns an expression for an {@linkplain Producers#entryPointViewOf(Producer, - * CancellationListener) entry point view} of a producer if the component method returns a {@link - * Producer} or {@link com.google.common.util.concurrent.ListenableFuture}. + * Returns an expression for an {@code Producers#entryPointViewOf(Producer, CancellationListener)} + * of a producer if the component method returns a {@code Producer} or {@code ListenableFuture}. * *

This is intended to be a replacement implementation for {@link * dagger.internal.codegen.writing.RequestRepresentation#getDependencyExpressionForComponentMethod(ComponentMethodDescriptor, @@ -97,7 +93,7 @@ private MemberSelect createField( CodeBlock.of( "this.$N = $T.entryPointViewOf($L, $L);", field, - Producers.class, + TypeNames.PRODUCERS, producerExpression.getDependencyExpression(shardImplementation.name()).codeBlock(), // Always pass in the componentShard reference here rather than the owning shard for // this key because this needs to be the root CancellationListener. diff --git a/java/dagger/internal/codegen/writing/ProducerFactoryGenerator.java b/java/dagger/internal/codegen/writing/ProducerFactoryGenerator.java index e6c88a9c794..b68c1be51b4 100644 --- a/java/dagger/internal/codegen/writing/ProducerFactoryGenerator.java +++ b/java/dagger/internal/codegen/writing/ProducerFactoryGenerator.java @@ -77,16 +77,13 @@ import dagger.internal.codegen.model.DependencyRequest; import dagger.internal.codegen.model.Key; import dagger.internal.codegen.model.RequestKind; -import dagger.producers.Producer; -import dagger.producers.internal.AbstractProducesMethodProducer; -import dagger.producers.internal.Producers; import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; import java.util.Optional; import javax.inject.Inject; -/** Generates {@link Producer} implementations from {@link ProductionBinding} instances. */ +/** Generates {@code Producer} implementations from {@link ProductionBinding} instances. */ public final class ProducerFactoryGenerator extends SourceFileGenerator { private final CompilerOptions compilerOptions; private final KeyFactory keyFactory; @@ -219,7 +216,7 @@ public ImmutableList topLevelTypes(ProductionBinding binding) factoryBuilder .superclass( ParameterizedTypeName.get( - ClassName.get(AbstractProducesMethodProducer.class), + TypeNames.ABSTRACT_PRODUCES_METHOD_PRODUCER, futureTransform.applyArgType(), providedTypeName)) .addMethod(constructor) @@ -264,7 +261,7 @@ private static CodeBlock fieldAssignment(FieldSpec field, ParameterizedTypeName CodeBlock.Builder statement = CodeBlock.builder(); if (type != null && type.rawType.equals(TypeNames.PRODUCER)) { statement.addStatement( - "this.$1N = $2T.nonCancellationPropagatingViewOf($1N)", field, Producers.class); + "this.$1N = $2T.nonCancellationPropagatingViewOf($1N)", field, TypeNames.PRODUCERS); } else { statement.addStatement("this.$1N = $1N", field); } @@ -275,7 +272,7 @@ private static void assignField( MethodSpec.Builder constructorBuilder, FieldSpec field, ParameterizedTypeName type) { if (type != null && type.rawType.equals(TypeNames.PRODUCER)) { constructorBuilder.addStatement( - "this.$1N = $2T.nonCancellationPropagatingViewOf($1N)", field, Producers.class); + "this.$1N = $2T.nonCancellationPropagatingViewOf($1N)", field, TypeNames.PRODUCERS); } else { constructorBuilder.addStatement("this.$1N = $1N", field); } diff --git a/java/dagger/internal/codegen/writing/ProducerFromProviderCreationExpression.java b/java/dagger/internal/codegen/writing/ProducerFromProviderCreationExpression.java index 05dd50b2793..9d089567364 100644 --- a/java/dagger/internal/codegen/writing/ProducerFromProviderCreationExpression.java +++ b/java/dagger/internal/codegen/writing/ProducerFromProviderCreationExpression.java @@ -26,10 +26,9 @@ import dagger.internal.codegen.javapoet.TypeNames; import dagger.internal.codegen.model.RequestKind; import dagger.internal.codegen.writing.FrameworkFieldInitializer.FrameworkInstanceCreationExpression; -import dagger.producers.Producer; import java.util.Optional; -/** An {@link Producer} creation expression for provision bindings. */ +/** An {@code Producer} creation expression for provision bindings. */ final class ProducerFromProviderCreationExpression implements FrameworkInstanceCreationExpression { private final RequestRepresentation providerRequestRepresentation; private final ClassName requestingClass; diff --git a/java/dagger/internal/codegen/writing/ProducerNodeInstanceRequestRepresentation.java b/java/dagger/internal/codegen/writing/ProducerNodeInstanceRequestRepresentation.java index 813010cfd2e..cdcc3893314 100644 --- a/java/dagger/internal/codegen/writing/ProducerNodeInstanceRequestRepresentation.java +++ b/java/dagger/internal/codegen/writing/ProducerNodeInstanceRequestRepresentation.java @@ -26,9 +26,9 @@ import dagger.internal.codegen.binding.ContributionBinding; import dagger.internal.codegen.binding.FrameworkType; import dagger.internal.codegen.javapoet.Expression; +import dagger.internal.codegen.javapoet.TypeNames; import dagger.internal.codegen.model.Key; import dagger.internal.codegen.writing.ComponentImplementation.ShardImplementation; -import dagger.producers.internal.Producers; /** Binding expression for producer node instances. */ final class ProducerNodeInstanceRequestRepresentation @@ -61,7 +61,7 @@ Expression getDependencyExpression(ClassName requestingClass) { key, CodeBlock.of( "$T.cancel($L, $N);", - Producers.class, + TypeNames.PRODUCERS, result.codeBlock(), ComponentImplementation.MAY_INTERRUPT_IF_RUNNING_PARAM)); return result; diff --git a/java/dagger/model/BUILD b/java/dagger/model/BUILD index aaa8306017a..1a672dc0352 100644 --- a/java/dagger/model/BUILD +++ b/java/dagger/model/BUILD @@ -44,7 +44,6 @@ java_library( deps = [ "//java/dagger:core", "//java/dagger/internal/codegen/extension", - "//java/dagger/producers", "//third_party/java/auto:common", "//third_party/java/auto:value", "//third_party/java/error_prone:annotations", diff --git a/java/dagger/model/BindingGraph.java b/java/dagger/model/BindingGraph.java index 1ccba4326f0..d09bf02c106 100644 --- a/java/dagger/model/BindingGraph.java +++ b/java/dagger/model/BindingGraph.java @@ -43,14 +43,13 @@ *

A {@link BindingGraph} represents one of the following: * *

    - *
  • an entire component hierarchy rooted at a {@link dagger.Component} or {@link - * dagger.producers.ProductionComponent} - *
  • a partial component hierarchy rooted at a {@link dagger.Subcomponent} or {@link - * dagger.producers.ProductionSubcomponent} (only when the value of {@code - * -Adagger.fullBindingGraphValidation} is not {@code NONE}) - *
  • the bindings installed by a {@link Module} or {@link dagger.producers.ProducerModule}, - * including all subcomponents generated by {@link Module#subcomponents()} ()} and {@link - * dagger.producers.ProducerModule#subcomponents()} ()} + *
  • an entire component hierarchy rooted at a {@code Component} or {@code ProductionComponent} + *
  • a partial component hierarchy rooted at a {@code Subcomponent} or + * {@code ProductionSubcomponent} (only when the value of + * {@code -Adagger.fullBindingGraphValidation} is not {@code NONE}) + *
  • the bindings installed by a {@code Module} or {@code ProducerModule}, + * including all subcomponents generated by {@code Module#subcomponents()} and + * {@code ProducerModule#subcomponents()} *
* * In the case of a {@link BindingGraph} representing a module, the root {@link ComponentNode} will diff --git a/java/dagger/model/BindingKind.java b/java/dagger/model/BindingKind.java index 1bfb080981e..46d11309a0b 100644 --- a/java/dagger/model/BindingKind.java +++ b/java/dagger/model/BindingKind.java @@ -34,8 +34,7 @@ public enum BindingKind { ASSISTED_FACTORY, /** - * An implicit binding for a {@link dagger.Component}- or {@link - * dagger.producers.ProductionComponent}-annotated type. + * An implicit binding for a {@code Component}- or {@code ProductionComponent}-annotated type. */ COMPONENT, @@ -65,14 +64,13 @@ public enum BindingKind { /** A binding for a {@link dagger.BindsInstance}-annotated builder method. */ BOUND_INSTANCE, - /** A binding for a {@link dagger.producers.Produces}-annotated method. */ + /** A binding for a {@code Produces}-annotated method. */ PRODUCTION, /** - * A binding for a production method on a production component's {@linkplain - * dagger.producers.ProductionComponent#dependencies()} dependency} that returns a {@link - * com.google.common.util.concurrent.ListenableFuture} or {@link - * com.google.common.util.concurrent.FluentFuture}. Methods on production component dependencies + * A binding for a production method on a production component's + * {@code ProductionComponent#dependencies()} that returns a {@code ListenableFuture} or + * {@code FluentFuture}. Methods on production component dependencies * that don't return a future are considered {@linkplain #COMPONENT_PROVISION component provision * bindings}. */ diff --git a/java/dagger/model/ComponentPath.java b/java/dagger/model/ComponentPath.java index 5a74c7a5167..9dfdbf93e36 100644 --- a/java/dagger/model/ComponentPath.java +++ b/java/dagger/model/ComponentPath.java @@ -40,8 +40,7 @@ public static ComponentPath create(Iterable components) { public abstract ImmutableList components(); /** - * Returns the root {@link dagger.Component}- or {@link - * dagger.producers.ProductionComponent}-annotated type + * Returns the root {@code Component}- or {@code ProductionComponent}-annotated type */ public final TypeElement rootComponent() { return components().get(0); diff --git a/java/dagger/model/RequestKind.java b/java/dagger/model/RequestKind.java index 74a43463381..6a19b0a085b 100644 --- a/java/dagger/model/RequestKind.java +++ b/java/dagger/model/RequestKind.java @@ -19,11 +19,6 @@ import static com.google.common.base.CaseFormat.UPPER_CAMEL; import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; -import dagger.Lazy; -import dagger.producers.Produced; -import dagger.producers.Producer; -import javax.inject.Provider; - /** * Represents the different kinds of {@link javax.lang.model.type.TypeMirror types} that may be * requested as dependencies for the same key. For example, {@code String}, {@code @@ -35,13 +30,13 @@ public enum RequestKind { /** A default request for an instance. E.g.: {@code FooType} */ INSTANCE, - /** A request for a {@link Provider}. E.g.: {@code Provider} */ + /** A request for a {@code Provider}. E.g.: {@code Provider} */ PROVIDER, - /** A request for a {@link Lazy}. E.g.: {@code Lazy} */ + /** A request for a {@code Lazy}. E.g.: {@code Lazy} */ LAZY, - /** A request for a {@link Provider} of a {@link Lazy}. E.g.: {@code Provider>} */ + /** A request for a {@code Provider} of a {@code Lazy}. E.g.: {@code Provider>} */ PROVIDER_OF_LAZY, /** @@ -50,15 +45,15 @@ public enum RequestKind { */ MEMBERS_INJECTION, - /** A request for a {@link Producer}. E.g.: {@code Producer} */ + /** A request for a {@code Producer}. E.g.: {@code Producer} */ PRODUCER, - /** A request for a {@link Produced}. E.g.: {@code Produced} */ + /** A request for a {@code Produced}. E.g.: {@code Produced} */ PRODUCED, /** - * A request for a {@link com.google.common.util.concurrent.ListenableFuture}. E.g.: {@code - * ListenableFuture}. These can only be requested by component interfaces. + * A request for a {@code ListenableFuture}. E.g.: {@code ListenableFuture}. These can + * only be requested by component interfaces. */ FUTURE, ; diff --git a/java/dagger/model/Scope.java b/java/dagger/model/Scope.java index c7ebfa81171..fe64c86d436 100644 --- a/java/dagger/model/Scope.java +++ b/java/dagger/model/Scope.java @@ -26,7 +26,6 @@ import com.google.common.base.Equivalence; import com.squareup.javapoet.ClassName; import dagger.Reusable; -import dagger.producers.ProductionScope; import javax.inject.Singleton; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.TypeElement; @@ -88,7 +87,7 @@ public final boolean isReusable() { return isScope(REUSABLE); } - /** Returns {@code true} if this scope is the {@link ProductionScope @ProductionScope} scope. */ + /** Returns {@code true} if this scope is the {@code @ProductionScope} scope. */ public final boolean isProductionScope() { return isScope(PRODUCTION_SCOPE); } diff --git a/java/dagger/spi/BUILD b/java/dagger/spi/BUILD index 13428c1a4f9..8084e639669 100644 --- a/java/dagger/spi/BUILD +++ b/java/dagger/spi/BUILD @@ -63,7 +63,6 @@ gen_maven_artifact( ], artifact_target_maven_deps = [ "com.google.code.findbugs:jsr305", - "com.google.dagger:dagger-producers", "com.google.dagger:dagger", "com.google.devtools.ksp:symbol-processing-api", "com.google.guava:failureaccess", diff --git a/java/dagger/spi/model/BUILD b/java/dagger/spi/model/BUILD index e9346ddf674..e5af4e50bd4 100644 --- a/java/dagger/spi/model/BUILD +++ b/java/dagger/spi/model/BUILD @@ -40,7 +40,6 @@ kt_jvm_library( deps = [ "//java/dagger:core", "//java/dagger/internal/codegen/extension", - "//java/dagger/producers", "//third_party/java/auto:common", "//third_party/java/auto:value", "//third_party/java/error_prone:annotations", @@ -48,7 +47,6 @@ kt_jvm_library( "//third_party/java/guava/collect", "//third_party/java/guava/graph", "//third_party/java/javapoet", - "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", "@maven//:com_google_devtools_ksp_symbol_processing_api", ], diff --git a/java/dagger/spi/model/BindingGraph.java b/java/dagger/spi/model/BindingGraph.java index aab7c2a4b06..7f433a1e09b 100644 --- a/java/dagger/spi/model/BindingGraph.java +++ b/java/dagger/spi/model/BindingGraph.java @@ -41,14 +41,14 @@ *

A {@link BindingGraph} represents one of the following: * *

    - *
  • an entire component hierarchy rooted at a {@link dagger.Component} or {@link - * dagger.producers.ProductionComponent} - *
  • a partial component hierarchy rooted at a {@link dagger.Subcomponent} or {@link - * dagger.producers.ProductionSubcomponent} (only when the value of {@code - * -Adagger.fullBindingGraphValidation} is not {@code NONE}) - *
  • the bindings installed by a {@link Module} or {@link dagger.producers.ProducerModule}, - * including all subcomponents generated by {@link Module#subcomponents()} ()} and {@link - * dagger.producers.ProducerModule#subcomponents()} ()} + *
  • an entire component hierarchy rooted at a {@link dagger.Component} or + * {@code ProductionComponent} + *
  • a partial component hierarchy rooted at a {@link dagger.Subcomponent} or + * {@code ProductionSubcomponent} (only when the value of + * {@code -Adagger.fullBindingGraphValidation} is not {@code NONE}) + *
  • the bindings installed by a {@link Module} or {@code ProducerModule}, + * including all subcomponents generated by {@link Module#subcomponents()} ()} and + * {@code ProducerModule#subcomponents()} ()} *
* * In the case of a {@link BindingGraph} representing a module, the root {@link ComponentNode} will diff --git a/java/dagger/spi/model/BindingKind.java b/java/dagger/spi/model/BindingKind.java index b854b530043..eb1e8350179 100644 --- a/java/dagger/spi/model/BindingKind.java +++ b/java/dagger/spi/model/BindingKind.java @@ -34,8 +34,8 @@ public enum BindingKind { ASSISTED_FACTORY, /** - * An implicit binding for a {@link dagger.Component}- or {@link - * dagger.producers.ProductionComponent}-annotated type. + * An implicit binding for a {@link dagger.Component}- or {@code ProductionComponent}-annotated + * type. */ COMPONENT, @@ -65,16 +65,14 @@ public enum BindingKind { /** A binding for a {@link dagger.BindsInstance}-annotated builder method. */ BOUND_INSTANCE, - /** A binding for a {@link dagger.producers.Produces}-annotated method. */ + /** A binding for a {@code Produces}-annotated method. */ PRODUCTION, /** - * A binding for a production method on a production component's {@linkplain - * dagger.producers.ProductionComponent#dependencies()} dependency} that returns a {@link - * com.google.common.util.concurrent.ListenableFuture} or {@link - * com.google.common.util.concurrent.FluentFuture}. Methods on production component dependencies - * that don't return a future are considered {@linkplain #COMPONENT_PROVISION component provision - * bindings}. + * A binding for a production method on a production component's + * {@code ProductionComponent#dependencies()} that returns a {@code ListenableFuture} or + * {@code FluentFuture}. Methods on production component dependencies + * that don't return a future are considered component provision bindings. */ COMPONENT_PRODUCTION, diff --git a/java/dagger/spi/model/ComponentPath.java b/java/dagger/spi/model/ComponentPath.java index 57dcfe6617b..11c811e260c 100644 --- a/java/dagger/spi/model/ComponentPath.java +++ b/java/dagger/spi/model/ComponentPath.java @@ -39,8 +39,7 @@ public static ComponentPath create(Iterable components) { public abstract ImmutableList components(); /** - * Returns the root {@link dagger.Component}- or {@link - * dagger.producers.ProductionComponent}-annotated type + * Returns the root {@code Component}- or {@code ProductionComponent}-annotated type */ public final DaggerTypeElement rootComponent() { return components().get(0); diff --git a/java/dagger/spi/model/RequestKind.java b/java/dagger/spi/model/RequestKind.java index 62f46cd65ae..bcbe26d4fa4 100644 --- a/java/dagger/spi/model/RequestKind.java +++ b/java/dagger/spi/model/RequestKind.java @@ -19,11 +19,6 @@ import static com.google.common.base.CaseFormat.UPPER_CAMEL; import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; -import dagger.Lazy; -import dagger.producers.Produced; -import dagger.producers.Producer; -import javax.inject.Provider; - /** * Represents the different kinds of {@link javax.lang.model.type.TypeMirror types} that may be * requested as dependencies for the same key. For example, {@code String}, {@code @@ -35,13 +30,13 @@ public enum RequestKind { /** A default request for an instance. E.g.: {@code FooType} */ INSTANCE, - /** A request for a {@link Provider}. E.g.: {@code Provider} */ + /** A request for a {@code Provider}. E.g.: {@code Provider} */ PROVIDER, - /** A request for a {@link Lazy}. E.g.: {@code Lazy} */ + /** A request for a {@code Lazy}. E.g.: {@code Lazy} */ LAZY, - /** A request for a {@link Provider} of a {@link Lazy}. E.g.: {@code Provider>} */ + /** A request for a {@code Provider} of a {@code Lazy}. E.g.: {@code Provider>}. */ PROVIDER_OF_LAZY, /** @@ -50,15 +45,15 @@ public enum RequestKind { */ MEMBERS_INJECTION, - /** A request for a {@link Producer}. E.g.: {@code Producer} */ + /** A request for a {@code Producer}. E.g.: {@code Producer} */ PRODUCER, - /** A request for a {@link Produced}. E.g.: {@code Produced} */ + /** A request for a {@code Produced}. E.g.: {@code Produced} */ PRODUCED, /** - * A request for a {@link com.google.common.util.concurrent.ListenableFuture}. E.g.: {@code - * ListenableFuture}. These can only be requested by component interfaces. + * A request for a {@code ListenableFuture}. E.g.: {@code ListenableFuture}. These can + * only be requested by component interfaces. */ FUTURE, ; diff --git a/java/dagger/spi/model/Scope.java b/java/dagger/spi/model/Scope.java index 0b058c3b24a..2d86101f199 100644 --- a/java/dagger/spi/model/Scope.java +++ b/java/dagger/spi/model/Scope.java @@ -80,8 +80,7 @@ public final boolean isReusable() { } /** - * Returns {@code true} if this scope is the {@link - * dagger.producers.ProductionScope @ProductionScope} scope. + * Returns {@code true} if this scope is the {@code @ProductionScope} scope. */ public final boolean isProductionScope() { return isScope(PRODUCTION_SCOPE);