Skip to content

Commit 4f486de

Browse files
authored
Sonar: StringUtils.containsAny is deprecated (#32065)
1 parent bf339c3 commit 4f486de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

generators/spring-boot/templates/src/main/java/_package_/web/rest/errors/ExceptionTranslator.java.ejs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import tech.jhipster.config.JHipsterConstants;
2424
import tech.jhipster.web.util.HeaderUtil;
2525

2626
import org.apache.commons.lang3.StringUtils;
27+
<%_ if (springBoot4) { _%>
28+
import org.apache.commons.lang3.Strings;
29+
<%_ } _%>
2730
import org.jspecify.annotations.Nullable;
2831
import org.slf4j.Logger;
2932
import org.slf4j.LoggerFactory;
@@ -351,7 +354,7 @@ _%>
351354
private boolean containsPackageName(String message) {
352355

353356
// This list is for sure not complete
354-
return StringUtils.containsAny(message, "org.", "java.", "net.", "jakarta.", "javax.", "com.", "io.", "de.", "<%= packageName %>");
357+
return <% if (springBoot4) { %> Strings.CS<% } else { %> StringUtils<% } %>.containsAny(message, "org.", "java.", "net.", "jakarta.", "javax.", "com.", "io.", "de.", "<%= packageName %>");
355358
}
356359

357360
}

0 commit comments

Comments
 (0)