From bf5e18fd1694882a318e204be6a31bc1757db72d Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 15 Oct 2020 09:40:09 +0200 Subject: IsException should also be true when class inherits from Exception (#1558) --- core/src/main/kotlin/model/documentableProperties.kt | 9 +++++++++ core/src/main/kotlin/model/properties/PropertyContainer.kt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'core/src') diff --git a/core/src/main/kotlin/model/documentableProperties.kt b/core/src/main/kotlin/model/documentableProperties.kt index 2845c7fc..991f5311 100644 --- a/core/src/main/kotlin/model/documentableProperties.kt +++ b/core/src/main/kotlin/model/documentableProperties.kt @@ -25,3 +25,12 @@ data class ImplementedInterfaces(val interfaces: SourceSetDependent = ImplementedInterfaces } + +data class ExceptionInSupertypes(val exceptions: SourceSetDependent>): ExtraProperty { + companion object : ExtraProperty.Key { + override fun mergeStrategyFor(left: ExceptionInSupertypes, right: ExceptionInSupertypes) = + MergeStrategy.Replace(ExceptionInSupertypes(left.exceptions + right.exceptions)) + } + + override val key: ExtraProperty.Key = ExceptionInSupertypes +} \ No newline at end of file diff --git a/core/src/main/kotlin/model/properties/PropertyContainer.kt b/core/src/main/kotlin/model/properties/PropertyContainer.kt index 19189b39..162f1bc8 100644 --- a/core/src/main/kotlin/model/properties/PropertyContainer.kt +++ b/core/src/main/kotlin/model/properties/PropertyContainer.kt @@ -18,7 +18,7 @@ data class PropertyContainer internal constructor( companion object { fun empty(): PropertyContainer = PropertyContainer(emptyMap()) - fun withAll(vararg extras: ExtraProperty) = empty().addAll(extras.toList()) + fun withAll(vararg extras: ExtraProperty?) = empty().addAll(extras.filterNotNull()) fun withAll(extras: Collection>) = empty().addAll(extras) } } -- cgit