>>}.
*
*
- * @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);