From b121d314d33b6e723a6f9b350efdedd985817eb4 Mon Sep 17 00:00:00 2001 From: alexcrea Date: Thu, 10 Jul 2025 04:00:18 +0200 Subject: [PATCH] do not cast immutable set as unmodifiable set --- .../xyz/alexcrea/cuanvil/group/AbstractMaterialGroup.kt | 2 +- src/main/kotlin/xyz/alexcrea/cuanvil/group/ExcludeGroup.kt | 4 ++-- src/main/kotlin/xyz/alexcrea/cuanvil/group/IncludeGroup.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/group/AbstractMaterialGroup.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/group/AbstractMaterialGroup.kt index 937dad7..20dff07 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/group/AbstractMaterialGroup.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/group/AbstractMaterialGroup.kt @@ -65,7 +65,7 @@ abstract class AbstractMaterialGroup(private val name: String) { /** * Get the group contained item as a set */ - abstract fun getItemTypes(): ImmutableSet + abstract fun getItemTypes(): Set /** * Get the group non-inherited items as a set diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/group/ExcludeGroup.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/group/ExcludeGroup.kt index 1e2c1e4..6184922 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/group/ExcludeGroup.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/group/ExcludeGroup.kt @@ -69,8 +69,8 @@ class ExcludeGroup(name: String) : AbstractMaterialGroup(name) { } } - override fun getItemTypes(): ImmutableSet { - return Collections.unmodifiableSet(groupItems) as ImmutableSet + override fun getItemTypes(): Set { + return Collections.unmodifiableSet(groupItems) } diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/group/IncludeGroup.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/group/IncludeGroup.kt index 5528ad1..9d9108e 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/group/IncludeGroup.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/group/IncludeGroup.kt @@ -68,8 +68,8 @@ class IncludeGroup(name: String) : AbstractMaterialGroup(name) { } } - override fun getItemTypes(): ImmutableSet { - return Collections.unmodifiableSet(groupItems) as ImmutableSet + override fun getItemTypes(): Set { + return Collections.unmodifiableSet(groupItems) }