camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [camel] branch master updated: CAMEL-12847: IntrospectionSupport - Allow to use dash style naming
Date Mon, 01 Oct 2018 19:58:06 GMT
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 28658be  CAMEL-12847: IntrospectionSupport - Allow to use dash style naming
28658be is described below

commit 28658bea3e17890160624ee65a8e0296a908b026
Author: Claus Ibsen <claus.ibsen@gmail.com>
AuthorDate: Mon Oct 1 21:57:26 2018 +0200

    CAMEL-12847: IntrospectionSupport - Allow to use dash style naming
---
 camel-core/src/main/java/org/apache/camel/util/StringHelper.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/util/StringHelper.java b/camel-core/src/main/java/org/apache/camel/util/StringHelper.java
index c5731d1..887bd12 100644
--- a/camel-core/src/main/java/org/apache/camel/util/StringHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/StringHelper.java
@@ -428,13 +428,16 @@ public final class StringHelper {
         if (length == 0) {
             return text;
         }
+        if (text.indexOf('-') == -1) {
+            return text;
+        }
 
         StringBuilder sb = new StringBuilder();
 
-        for (int i = 0; i < text.length(); ++i) {
+        for (int i = 0; i < text.length(); i++) {
             char c = text.charAt(i);
             if (c == '-') {
-                ++i;
+                i++;
                 sb.append(Character.toUpperCase(text.charAt(i)));
             } else {
                 sb.append(c);


Mime
View raw message