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:04:59 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x c84a0d8ee -> fca57bd33


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/f6ce0085
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f6ce0085
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f6ce0085

Branch: refs/heads/camel-2.16.x
Commit: f6ce00854af80b1007c5b6421a407a473574b0e0
Parents: c84a0d8
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:59:00 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/f6ce0085/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 3202e51..ce242ef 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
@@ -801,12 +801,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