From 3b5ca3b5bd83b2ea15d89f4d2bcedf6d69e8b4d3 Mon Sep 17 00:00:00 2001 From: Guillaume Le Floch Date: Thu, 23 Dec 2021 16:51:02 +0100 Subject: [PATCH] Remove unsafe cast to mutable extension catalog --- .../src/main/java/io/quarkus/platform/tools/ToolsUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools/ToolsUtils.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools/ToolsUtils.java index 9266dc758bf2c..92867577a8d39 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools/ToolsUtils.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools/ToolsUtils.java @@ -155,8 +155,9 @@ public static ExtensionCatalog resolvePlatformDescriptorDirectly(String bomGroup final OriginPreference originPreference = new OriginPreference(1, 1, 1, ++memberIndex, 1); Map metadata = new HashMap<>(memberCatalog.getMetadata()); metadata.put("origin-preference", originPreference); - ((ExtensionCatalog.Mutable) memberCatalog).setMetadata(metadata); - catalogs.add(memberCatalog); + ExtensionCatalog.Mutable mutableMemberCatalog = memberCatalog.mutable(); + mutableMemberCatalog.setMetadata(metadata); + catalogs.add(mutableMemberCatalog.build()); } catalog = CatalogMergeUtility.merge(catalogs); }