compilation fix
This commit is contained in:
@@ -67,3 +67,16 @@ public inline fun <T> List<T>.reduceRight(operation: (T, T) -> T) : T {
|
|||||||
|
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a original Iterable containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements
|
||||||
|
*/
|
||||||
|
public inline fun <T:Any> List<T?>.requireNoNulls() : List<T> {
|
||||||
|
for (element in this) {
|
||||||
|
if (element == null) {
|
||||||
|
throw IllegalArgumentException("null element found in $this")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this as List<T>
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package org.jetbrains.kotlin.doc
|
package org.jetbrains.kotlin.doc
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.doc.model.KPackage
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The configuration used with KDoc
|
* The configuration used with KDoc
|
||||||
@@ -114,7 +113,7 @@ class KDocConfig() {
|
|||||||
|
|
||||||
private class LongestFirstStringComparator() : Comparator<String> {
|
private class LongestFirstStringComparator() : Comparator<String> {
|
||||||
public override fun compare(s1: String, s2: String): Int {
|
public override fun compare(s1: String, s2: String): Int {
|
||||||
return compareBy(s1, s2, { length() }, { this })
|
return compareBy<String>(s1, s2, { length() }, { this })
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun equals(obj : Any?) : Boolean {
|
public override fun equals(obj : Any?) : Boolean {
|
||||||
|
|||||||
+1
-2
@@ -3,7 +3,6 @@ package org.jetbrains.kotlin.doc.model
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import org.jetbrains.jet.cli.common.CompilerPlugin
|
import org.jetbrains.jet.cli.common.CompilerPlugin
|
||||||
import org.jetbrains.jet.cli.common.CompilerPluginContext
|
import org.jetbrains.jet.cli.common.CompilerPluginContext
|
||||||
import org.jetbrains.kotlin.doc.KDocArguments
|
|
||||||
|
|
||||||
/** Base class for any compiler plugin which needs to process a KModel */
|
/** Base class for any compiler plugin which needs to process a KModel */
|
||||||
abstract class KModelCompilerPlugin(
|
abstract class KModelCompilerPlugin(
|
||||||
@@ -17,7 +16,7 @@ abstract class KModelCompilerPlugin(
|
|||||||
val bindingContext = context.getContext()
|
val bindingContext = context.getContext()
|
||||||
val sources = context.getFiles()
|
val sources = context.getFiles()
|
||||||
val sourceDirs: List<File> = arguments.getSourceDirs().orEmpty().requireNoNulls().map { path -> File(path) }
|
val sourceDirs: List<File> = arguments.getSourceDirs().orEmpty().requireNoNulls().map { path -> File(path) }
|
||||||
val model = KModel(bindingContext, arguments.apply(), sourceDirs, sources.orEmpty().requireNoNulls())
|
val model = KModel(bindingContext, arguments.apply(), sourceDirs, sources.requireNoNulls())
|
||||||
|
|
||||||
processModel(model)
|
processModel(model)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user