@@ -14,31 +14,31 @@ import com.squareup.kotlinpoet.PropertySpec
1414import com.squareup.kotlinpoet.TypeSpec
1515
1616internal fun TypeSpec.Builder.maybeAddDescription (description : String? ): TypeSpec .Builder {
17- if (description.isNullOrBlank() ) {
17+ if (description == null ) {
1818 return this
1919 }
2020
2121 return addKdoc(" %L" , description.replace(' ' , ' ♢' ))
2222}
2323
2424internal fun PropertySpec.Builder.maybeAddDescription (description : String? ): PropertySpec .Builder {
25- if (description.isNullOrBlank() ) {
25+ if (description == null ) {
2626 return this
2727 }
2828
2929 return addKdoc(" %L" , description.replace(' ' , ' ♢' ))
3030}
3131
3232internal fun ParameterSpec.Builder.maybeAddDescription (description : String? ): ParameterSpec .Builder {
33- if (description.isNullOrBlank() ) {
33+ if (description == null ) {
3434 return this
3535 }
3636
3737 return addKdoc(" %L" , description.replace(' ' , ' ♢' ))
3838}
3939
4040internal fun FunSpec.Builder.maybeAddDescription (description : String? ): FunSpec .Builder {
41- if (description.isNullOrBlank() ) {
41+ if (description == null ) {
4242 return this
4343 }
4444
@@ -47,39 +47,39 @@ internal fun FunSpec.Builder.maybeAddDescription(description: String?): FunSpec.
4747
4848
4949internal fun TypeSpec.Builder.maybeAddDeprecation (deprecationReason : String? ): TypeSpec .Builder {
50- if (deprecationReason.isNullOrBlank() ) {
50+ if (deprecationReason == null ) {
5151 return this
5252 }
5353
5454 return addAnnotation(deprecatedAnnotation(deprecationReason))
5555}
5656
5757internal fun PropertySpec.Builder.maybeAddDeprecation (deprecationReason : String? ): PropertySpec .Builder {
58- if (deprecationReason.isNullOrBlank() ) {
58+ if (deprecationReason == null ) {
5959 return this
6060 }
6161
6262 return addAnnotation(deprecatedAnnotation(deprecationReason))
6363}
6464
6565internal fun ParameterSpec.Builder.maybeAddDeprecation (deprecationReason : String? ): ParameterSpec .Builder {
66- if (deprecationReason.isNullOrBlank() ) {
66+ if (deprecationReason == null ) {
6767 return this
6868 }
6969
7070 return addAnnotation(deprecatedAnnotation(deprecationReason))
7171}
7272
7373internal fun FunSpec.Builder.maybeAddDeprecation (deprecationReason : String? ): FunSpec .Builder {
74- if (deprecationReason.isNullOrBlank() ) {
74+ if (deprecationReason == null ) {
7575 return this
7676 }
7777
7878 return addAnnotation(deprecatedAnnotation(deprecationReason))
7979}
8080
8181internal fun TypeSpec.Builder.maybeAddRequiresOptIn (resolver : KotlinResolver , optInFeature : String? ): TypeSpec .Builder {
82- if (optInFeature.isNullOrBlank() ) {
82+ if (optInFeature == null ) {
8383 return this
8484 }
8585
@@ -88,7 +88,7 @@ internal fun TypeSpec.Builder.maybeAddRequiresOptIn(resolver: KotlinResolver, op
8888}
8989
9090internal fun PropertySpec.Builder.maybeAddRequiresOptIn (resolver : KotlinResolver , optInFeature : String? ): PropertySpec .Builder {
91- if (optInFeature.isNullOrBlank() ) {
91+ if (optInFeature == null ) {
9292 return this
9393 }
9494
@@ -97,7 +97,7 @@ internal fun PropertySpec.Builder.maybeAddRequiresOptIn(resolver: KotlinResolver
9797}
9898
9999internal fun ParameterSpec.Builder.maybeAddRequiresOptIn (resolver : KotlinResolver , optInFeature : String? ): ParameterSpec .Builder {
100- if (optInFeature.isNullOrBlank() ) {
100+ if (optInFeature == null ) {
101101 return this
102102 }
103103
@@ -106,7 +106,7 @@ internal fun ParameterSpec.Builder.maybeAddRequiresOptIn(resolver: KotlinResolve
106106}
107107
108108internal fun FunSpec.Builder.maybeAddRequiresOptIn (resolver : KotlinResolver , optInFeature : String? ): FunSpec .Builder {
109- if (optInFeature.isNullOrBlank() ) {
109+ if (optInFeature == null ) {
110110 return this
111111 }
112112
@@ -123,7 +123,7 @@ internal fun requiresOptInAnnotation(annotation: ClassName): AnnotationSpec {
123123internal fun <T : Annotatable .Builder <* >> T.maybeAddOptIn (
124124 resolver : KotlinResolver ,
125125 enumValues : List <IrEnum .Value >,
126- ): T = applyIf(enumValues.any { ! it.optInFeature.isNullOrBlank() }) {
126+ ): T = applyIf(enumValues.any { it.optInFeature != null }) {
127127 val annotation = resolver.resolveRequiresOptInAnnotation() ? : return @applyIf
128128 addAnnotation(requiresOptInAnnotation(annotation))
129129}
0 commit comments