From ac05b9953ca3c8ebdb2073f73f4ff5b9d391709b Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Wed, 22 Jan 2025 10:43:42 +0100 Subject: [PATCH] Drop public usage of StringUtil#join, deprecated since 2019 Only one class used this method, other classes are using String.join already Also checked apache/camel-quarkus, apache/incubator-kie-kogito-runtimes, apache/incubator-kie-drools --- .../src/main/java/io/quarkus/runtime/util/StringUtil.java | 6 +++--- .../ConfigurationPropertiesMetadataBuildItem.java | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/runtime/src/main/java/io/quarkus/runtime/util/StringUtil.java b/core/runtime/src/main/java/io/quarkus/runtime/util/StringUtil.java index e3bb032289536..52e33c76b2d50 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/util/StringUtil.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/util/StringUtil.java @@ -112,13 +112,13 @@ public String next() { } /** - * @deprecated Use {@link String#join} instead. + * Dropped for public usage, kept in place for usage by hyphenate method to avoid need for lambda + * * @param delim delimiter * @param it iterator * @return the joined string */ - @Deprecated - public static String join(String delim, Iterator it) { + private static String join(String delim, Iterator it) { final StringBuilder b = new StringBuilder(); if (it.hasNext()) { b.append(it.next()); diff --git a/extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ConfigurationPropertiesMetadataBuildItem.java b/extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ConfigurationPropertiesMetadataBuildItem.java index a7c67705c86e4..4e1549f6be0ca 100644 --- a/extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ConfigurationPropertiesMetadataBuildItem.java +++ b/extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ConfigurationPropertiesMetadataBuildItem.java @@ -1,7 +1,6 @@ package io.quarkus.spring.boot.properties.deployment; import static io.quarkus.runtime.util.StringUtil.camelHumpsIterator; -import static io.quarkus.runtime.util.StringUtil.join; import static io.quarkus.runtime.util.StringUtil.lowerCase; import static io.quarkus.runtime.util.StringUtil.withoutSuffix; @@ -67,11 +66,10 @@ private String sanitisePrefix(String prefix) { return prefix; } - @SuppressWarnings("deprecation") private String getPrefixFromClassName(DotName className) { String simpleName = className.isInner() ? className.local() : className.withoutPackagePrefix(); - return join("-", - withoutSuffix(lowerCase(camelHumpsIterator(simpleName)), "config", "configuration", + return String.join("-", + (Iterable) () -> withoutSuffix(lowerCase(camelHumpsIterator(simpleName)), "config", "configuration", "properties", "props")); }