From f7927f0f3eb557c6cfe73d37893367720ad4db40 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Thu, 16 Nov 2023 14:01:46 -0500 Subject: [PATCH] Required bangs --- src/main/kotlin/com/slack/auto/value/kotlin/AvkBuilder.kt | 4 ++-- .../slack/auto/value/kotlin/AutoValueKotlinExtensionTest.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/slack/auto/value/kotlin/AvkBuilder.kt b/src/main/kotlin/com/slack/auto/value/kotlin/AvkBuilder.kt index e65042a..26cd74a 100644 --- a/src/main/kotlin/com/slack/auto/value/kotlin/AvkBuilder.kt +++ b/src/main/kotlin/com/slack/auto/value/kotlin/AvkBuilder.kt @@ -133,13 +133,13 @@ public data class AvkBuilder( } else { "addAll" } - addStatement("%N.$addMethod(%N)", builderPropSpec, propSpec) + addStatement("%N!!.$addMethod(%N)", builderPropSpec, propSpec) addStatement("%N = null", propSpec) endControlFlow() } } .endControlFlow() - .addStatement("returnĀ·%N", builderPropSpec) + .addStatement("returnĀ·%N!!", builderPropSpec) .build() builder.addFunction(funSpec) } diff --git a/src/test/kotlin/com/slack/auto/value/kotlin/AutoValueKotlinExtensionTest.kt b/src/test/kotlin/com/slack/auto/value/kotlin/AutoValueKotlinExtensionTest.kt index a4ad1d3..9976aa0 100644 --- a/src/test/kotlin/com/slack/auto/value/kotlin/AutoValueKotlinExtensionTest.kt +++ b/src/test/kotlin/com/slack/auto/value/kotlin/AutoValueKotlinExtensionTest.kt @@ -383,11 +383,11 @@ class AutoValueKotlinExtensionTest { if (requiredBuildableCollectionBuilder == null) { requiredBuildableCollectionBuilder = ImmutableList.builder() if (requiredBuildableCollection != null) { - requiredBuildableCollectionBuilder.addAll(requiredBuildableCollection) + requiredBuildableCollectionBuilder!!.addAll(requiredBuildableCollection) requiredBuildableCollection = null } } - return requiredBuildableCollectionBuilder + return requiredBuildableCollectionBuilder!! } internal fun requiredBuildableCollection(`value`: ImmutableList): Builder {