KT-3715 make Collection.notEmpty a property
Renamed "notEmpty()" methods to "isNotEmpty()" in following classes:
- Collection
- String
- Array
Added "notEmpty" property to Collection class
This commit is contained in:
@@ -298,7 +298,7 @@ class KModel(val context: BindingContext, val config: KDocConfig, val sourceDirs
|
||||
val scope = descriptor.getMemberScope()
|
||||
addFunctions(pkg, scope)
|
||||
pkg.local = isLocal(descriptor)
|
||||
pkg.useExternalLink = pkg.model.config.resolveLink(pkg.name, false).notEmpty()
|
||||
pkg.useExternalLink = pkg.model.config.resolveLink(pkg.name, false).isNotEmpty()
|
||||
|
||||
if (pkg.wikiDescription.isEmpty()) {
|
||||
// lets try find a custom doc
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@ abstract class KDocTemplate() : TextTemplate() {
|
||||
return if (c != null) {
|
||||
val prefix = if (c.isAnnotation()) "@" else ""
|
||||
val cname = c.name
|
||||
if ((cname.startsWith("jet.Function") || cname.startsWith("jet.ExtensionFunction")) && arguments.notEmpty()) {
|
||||
if ((cname.startsWith("jet.Function") || cname.startsWith("jet.ExtensionFunction")) && arguments.isNotEmpty()) {
|
||||
val rt = arguments.last()
|
||||
// TODO use drop()
|
||||
val rest = arguments.subList(0, arguments.size - 1).orEmpty()
|
||||
|
||||
Vendored
+1
-1
@@ -103,7 +103,7 @@ ${stylesheets()}
|
||||
}
|
||||
protected fun printPackageProperties(): Unit {
|
||||
val list = pkg.packageProperties()
|
||||
if (list.notEmpty()) {
|
||||
if (list.isNotEmpty()) {
|
||||
println("""<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">Properties</FONT>
|
||||
|
||||
Vendored
+3
-3
@@ -17,7 +17,7 @@ abstract class PackageTemplateSupport(open val pkg: KPackage) : KDocTemplate() {
|
||||
protected fun keyword(name: String): String = "<B>$name</B>"
|
||||
|
||||
fun printFunctionSummary(functions: Collection<KFunction>): Unit {
|
||||
if (functions.notEmpty()) {
|
||||
if (functions.isNotEmpty()) {
|
||||
println("""<!-- ========== FUNCTION SUMMARY =========== -->
|
||||
|
||||
<A NAME="method_summary"><!-- --></A>
|
||||
@@ -90,7 +90,7 @@ abstract class PackageTemplateSupport(open val pkg: KPackage) : KDocTemplate() {
|
||||
}
|
||||
|
||||
fun printFunctionDetail(functions: Collection<KFunction>): Unit {
|
||||
if (functions.notEmpty()) {
|
||||
if (functions.isNotEmpty()) {
|
||||
println("""
|
||||
|
||||
<!-- ============ FUNCTION DETAIL ========== -->
|
||||
@@ -159,7 +159,7 @@ abstract class PackageTemplateSupport(open val pkg: KPackage) : KDocTemplate() {
|
||||
}
|
||||
|
||||
fun printPropertySummary(properties: Collection<KProperty>): Unit {
|
||||
if (properties.notEmpty()) {
|
||||
if (properties.isNotEmpty()) {
|
||||
println("""<!-- ========== PROPERTY SUMMARY =========== -->
|
||||
|
||||
<A NAME="method_summary"><!-- --></A>
|
||||
|
||||
Reference in New Issue
Block a user