Skip to content

Commit

Permalink
Change generated assisted factory class to be final.
Browse files Browse the repository at this point in the history
This was accidentally non-final in the initial release.

RELNOTES=Change generated assisted factory class to be final.
PiperOrigin-RevId: 352627729
  • Loading branch information
bcorso authored and Dagger Team committed Jan 19, 2021
1 parent 0acad9a commit 6c11a60
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import static dagger.internal.codegen.javapoet.TypeNames.providerOf;
import static java.util.stream.Collectors.joining;
import static javax.lang.model.element.Modifier.ABSTRACT;
import static javax.lang.model.element.Modifier.FINAL;
import static javax.lang.model.element.Modifier.PRIVATE;
import static javax.lang.model.element.Modifier.PUBLIC;
import static javax.lang.model.element.Modifier.STATIC;

Expand Down Expand Up @@ -68,7 +70,6 @@
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.DeclaredType;
Expand Down Expand Up @@ -307,7 +308,7 @@ public Optional<TypeSpec.Builder> write(ProvisionBinding binding) {
ParameterSpec.builder(delegateFactoryTypeName(returnElement), "delegateFactory").build();
TypeSpec.Builder builder =
TypeSpec.classBuilder(nameGeneratedType(binding))
.addModifiers(PUBLIC)
.addModifiers(PUBLIC, FINAL)
.addTypeVariables(
factory.getTypeParameters().stream()
.map(TypeVariableName::get)
Expand All @@ -322,7 +323,7 @@ public Optional<TypeSpec.Builder> write(ProvisionBinding binding) {
builder
.addField(
FieldSpec.builder(delegateFactoryParam.type, delegateFactoryParam.name)
.addModifiers(Modifier.PRIVATE, Modifier.FINAL)
.addModifiers(PRIVATE, FINAL)
.build())
.addMethod(
MethodSpec.constructorBuilder()
Expand All @@ -340,7 +341,7 @@ public Optional<TypeSpec.Builder> write(ProvisionBinding binding) {
.build())
.addMethod(
MethodSpec.methodBuilder("create")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.addModifiers(PUBLIC, STATIC)
.addParameter(delegateFactoryParam)
.addTypeVariables(
returnElement.getTypeParameters().stream()
Expand Down

0 comments on commit 6c11a60

Please sign in to comment.