Merge pull request #462 from corda/mnesbit-tactical-patch-explorer

Tactical fix for Explorer crash issue under Kotlin 1.1.1
This commit is contained in:
Matthew Nesbit 2017-03-31 09:38:28 +01:00 committed by GitHub
commit b62f901892

View File

@ -111,8 +111,14 @@ fun <A> ObservableList<out A>.filter(predicate: ObservableValue<(A) -> Boolean>)
* val owners: ObservableList<Person> = dogs.map(Dog::owner).filterNotNull()
*/
fun <A> ObservableList<out A?>.filterNotNull(): ObservableList<A> {
//TODO This is a tactical work round for an issue with SAM conversion (https://youtrack.jetbrains.com/issue/ALL-1552) so that the M10 explorer works.
@Suppress("UNCHECKED_CAST")
return filtered { it != null } as ObservableList<A>
return (this as ObservableList<A?>).filtered(object : Predicate<A?> {
override fun test(t: A?): Boolean {
return t != null
}
}) as ObservableList<A>
}
/**