This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 39f984e5463 (chores) core/camel-util: avoid unnecessary autoboxing
39f984e5463 is described below
commit 39f984e5463893b1efab21f350f51bc2e03d7d2d
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Wed Aug 28 08:49:50 2024 +0200
(chores) core/camel-util: avoid unnecessary autoboxing
---
.../src/main/java/org/apache/camel/util/StringHelper.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git
a/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
b/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
index 5dab4e1a350..280f79aa6a5 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
@@ -1192,7 +1192,7 @@ public final class StringHelper {
if (text == null || text.isEmpty()) {
return text;
}
- Character prev = null;
+ char prev = 0;
char[] arr = text.toCharArray();
StringBuilder answer = new StringBuilder(arr.length < 13 ? 16 :
arr.length + 8);
@@ -1203,16 +1203,16 @@ public final class StringHelper {
if (ch == '-' || ch == '_') {
answer.append("-");
} else {
- if (Character.isUpperCase(ch) && prev != null) {
- Character next;
+ if (Character.isUpperCase(ch) && prev != 0) {
+ char next;
if (i < arr.length - 1) {
next = arr[i + 1];
} else {
- next = null;
+ next = 0;
}
- if (!Character.isUpperCase(prev) || next != null &&
Character.isLowerCase(next)) {
+ if (!Character.isUpperCase(prev) || next != 0 &&
Character.isLowerCase(next)) {
applyDashPrefix(prev, answer, ch);
} else {
answer.append(Character.toLowerCase(ch));
@@ -1227,7 +1227,7 @@ public final class StringHelper {
return answer.toString();
}
- private static void applyDashPrefix(Character prev, StringBuilder answer,
char ch) {
+ private static void applyDashPrefix(char prev, StringBuilder answer, char
ch) {
if (prev != '-' && prev != '_') {
answer.append("-");
}