From d81895df772823f399901cbdbf63babce279661c Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Wed, 1 Apr 2015 01:06:29 +0300 Subject: [PATCH] Rename and deprecate ad-hoc IsNullOrEmpty. --- .../jetbrains/kotlin/idea/completion/smart/StaticMembers.kt | 2 +- idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/smart/StaticMembers.kt b/idea/src/org/jetbrains/kotlin/idea/completion/smart/StaticMembers.kt index ddf558d0bed..3f52e42141c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/smart/StaticMembers.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/smart/StaticMembers.kt @@ -122,7 +122,7 @@ class StaticMembers( presentation.setTailText(tailText, true) } - if (presentation.getTypeText().isNullOrEmpty()) { + if (presentation.getTypeText().isNullOrEmptyDeprecated()) { presentation.setTypeText(DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(classDescriptor.getDefaultType())) } } diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt b/idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt index 5ea0953493f..40be9144dea 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt @@ -261,7 +261,8 @@ fun LookupElementFactory.createLookupElement( fun T?.toList(): List = if (this != null) listOf(this) else listOf() fun T?.toSet(): Set = if (this != null) setOf(this) else setOf() -fun String?.isNullOrEmpty() = this == null || this.isEmpty() +deprecated("Use String?.isNullOrEmpty() from stdlib when available") +fun String?.isNullOrEmptyDeprecated() = this == null || this.isEmpty() enum class SmartCompletionItemPriority { IT