Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Nov 16, 2023
1 parent 707d88d commit 07dac91
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/main/kotlin/com/slack/auto/value/kotlin/AvkBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ public data class AvkBuilder(
propertyBuilder
.toBuilder()
.beginControlFlow("if (%N == null)", builderPropSpec)
.addStatement("%N = %T.builder()", builderPropSpec, propSpec.type.copy(nullable = false))
.addStatement(
"%N = %T.builder()",
builderPropSpec,
propSpec.type.copy(nullable = false)
)
.endControlFlow()
.addStatement("return %N", builderPropSpec)
.build()
Expand Down Expand Up @@ -155,11 +159,12 @@ public data class AvkBuilder(
addStatement("this.%N = %N.build()", builderProp.name, builderProp.builderPropName)
// property builders can never be nullable
nextControlFlow("else if (this.%N == null)", builderProp.name)
val rawType = if (builderProp.type is ParameterizedTypeName) {
builderProp.type.rawType
} else {
builderProp.type
}
val rawType =
if (builderProp.type is ParameterizedTypeName) {
builderProp.type.rawType
} else {
builderProp.type
}
addStatement("this.%N = %T.of()", builderProp.name, rawType)
endControlFlow()
}
Expand Down

0 comments on commit 07dac91

Please sign in to comment.