camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [1/2] camel git commit: CAMEL-10150: Camel-Apt: Check for empty lines in parseAsMap method of EndpointAnnotationProcessor
Date Mon, 18 Jul 2016 11:05:41 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x a49494b4a -> b8564967b


CAMEL-10150: Camel-Apt: Check for empty lines in parseAsMap method of EndpointAnnotationProcessor


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/14f413f9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/14f413f9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/14f413f9

Branch: refs/heads/camel-2.17.x
Commit: 14f413f9a8f7f9f517b064208e33bd195e395f1e
Parents: a49494b
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Mon Jul 18 12:53:22 2016 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Mon Jul 18 12:57:53 2016 +0200

----------------------------------------------------------------------
 .../camel/tools/apt/EndpointAnnotationProcessor.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/14f413f9/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index e686f32..765eca5 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -811,12 +811,14 @@ public class EndpointAnnotationProcessor extends AbstractAnnotationProcessor
{
         Map<String, String> answer = new HashMap<String, String>();
         String[] lines = data.split("\n");
         for (String line : lines) {
-            int idx = line.indexOf('=');
-            String key = line.substring(0, idx);
-            String value = line.substring(idx + 1);
-            // remove ending line break for the values
-            value = value.trim().replaceAll("\n", "");
-            answer.put(key.trim(), value);
+        	if (!line.isEmpty()) {
+                int idx = line.indexOf('=');
+                String key = line.substring(0, idx);
+                String value = line.substring(idx + 1);
+                // remove ending line break for the values
+                value = value.trim().replaceAll("\n", "");
+                answer.put(key.trim(), value);
+        	}
         }
         return answer;
     }


Mime
View raw message