You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/06/09 17:13:22 UTC

[1/6] camel git commit: Actual number of bytes can be greater than the string length due to multibyte chars

Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 6ef2384e5 -> b21d06acd
  refs/heads/camel-2.19.x 2ba7fb43c -> 3990ebe4b
  refs/heads/master 22d5241b5 -> 3db951632


Actual number of bytes can be greater than the string length due to multibyte chars


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

Branch: refs/heads/master
Commit: 4b06e5fe5f0d4e4eba1de9c5f10eb65ef5b6bf74
Parents: 22d5241
Author: Bhun Kho <bh...@ictu.nl>
Authored: Fri Jun 9 18:22:45 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jun 9 19:09:29 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/converter/NIOConverter.java  | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4b06e5fe/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java b/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
index fbb573f..fabaa0d 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
@@ -84,7 +84,6 @@ public final class NIOConverter {
 
     @Converter
     public static ByteBuffer toByteBuffer(String value, Exchange exchange) {
-        ByteBuffer buf = ByteBuffer.allocate(value.length());
         byte[] bytes = null;
         if (exchange != null) {
             String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
@@ -99,9 +98,7 @@ public final class NIOConverter {
         if (bytes == null) {
             bytes = value.getBytes();
         }
-        buf.put(bytes);
-        buf.flip();
-        return buf;
+        return ByteBuffer.wrap(bytes);
     }
 
     @Converter


[5/6] camel git commit: Actual number of bytes can be greater than the string length due to multibyte chars

Posted by da...@apache.org.
Actual number of bytes can be greater than the string length due to multibyte chars


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

Branch: refs/heads/camel-2.18.x
Commit: 81baf0ebf672a5e1e59fd68bdf61115c27b23aca
Parents: 6ef2384
Author: Bhun Kho <bh...@ictu.nl>
Authored: Fri Jun 9 18:22:45 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jun 9 19:13:05 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/converter/NIOConverter.java  | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/81baf0eb/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java b/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
index fbb573f..fabaa0d 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
@@ -84,7 +84,6 @@ public final class NIOConverter {
 
     @Converter
     public static ByteBuffer toByteBuffer(String value, Exchange exchange) {
-        ByteBuffer buf = ByteBuffer.allocate(value.length());
         byte[] bytes = null;
         if (exchange != null) {
             String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
@@ -99,9 +98,7 @@ public final class NIOConverter {
         if (bytes == null) {
             bytes = value.getBytes();
         }
-        buf.put(bytes);
-        buf.flip();
-        return buf;
+        return ByteBuffer.wrap(bytes);
     }
 
     @Converter


[2/6] camel git commit: Polished. This closes #1748

Posted by da...@apache.org.
Polished. This closes #1748


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

Branch: refs/heads/master
Commit: 3db951632ac83c0f23093b5f5c37ae6e9e7d8650
Parents: 4b06e5f
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jun 9 19:12:07 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jun 9 19:12:07 2017 +0200

----------------------------------------------------------------------
 .../src/test/java/org/apache/camel/converter/NIOConverterTest.java  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3db95163/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java b/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
index 8e02529..386435f 100644
--- a/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
@@ -68,7 +68,6 @@ public class NIOConverterTest extends ContextTestSupport {
         String out = NIOConverter.toString(buffer, null);
         assertEquals(str, out);
     }
-    
 
     public void testToByteBuffer() {
         ByteBuffer bb = NIOConverter.toByteBuffer("Hello".getBytes());


[6/6] camel git commit: Polished. This closes #1748

Posted by da...@apache.org.
Polished. This closes #1748


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

Branch: refs/heads/camel-2.18.x
Commit: b21d06acd2db4ba8e0dc631b39999853bf532f0d
Parents: 81baf0e
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jun 9 19:12:07 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jun 9 19:13:13 2017 +0200

----------------------------------------------------------------------
 .../src/test/java/org/apache/camel/converter/NIOConverterTest.java  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b21d06ac/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java b/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
index 8e02529..386435f 100644
--- a/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
@@ -68,7 +68,6 @@ public class NIOConverterTest extends ContextTestSupport {
         String out = NIOConverter.toString(buffer, null);
         assertEquals(str, out);
     }
-    
 
     public void testToByteBuffer() {
         ByteBuffer bb = NIOConverter.toByteBuffer("Hello".getBytes());


[3/6] camel git commit: Actual number of bytes can be greater than the string length due to multibyte chars

Posted by da...@apache.org.
Actual number of bytes can be greater than the string length due to multibyte chars


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

Branch: refs/heads/camel-2.19.x
Commit: 8af8af5487bac55935a4ceec8e811a88cfa14eb7
Parents: 2ba7fb4
Author: Bhun Kho <bh...@ictu.nl>
Authored: Fri Jun 9 18:22:45 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jun 9 19:12:39 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/converter/NIOConverter.java  | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8af8af54/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java b/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
index fbb573f..fabaa0d 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
@@ -84,7 +84,6 @@ public final class NIOConverter {
 
     @Converter
     public static ByteBuffer toByteBuffer(String value, Exchange exchange) {
-        ByteBuffer buf = ByteBuffer.allocate(value.length());
         byte[] bytes = null;
         if (exchange != null) {
             String charsetName = exchange.getProperty(Exchange.CHARSET_NAME, String.class);
@@ -99,9 +98,7 @@ public final class NIOConverter {
         if (bytes == null) {
             bytes = value.getBytes();
         }
-        buf.put(bytes);
-        buf.flip();
-        return buf;
+        return ByteBuffer.wrap(bytes);
     }
 
     @Converter


[4/6] camel git commit: Polished. This closes #1748

Posted by da...@apache.org.
Polished. This closes #1748


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

Branch: refs/heads/camel-2.19.x
Commit: 3990ebe4b8380a9b7abc2ee27c43bd94dd28bc41
Parents: 8af8af5
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jun 9 19:12:07 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jun 9 19:12:46 2017 +0200

----------------------------------------------------------------------
 .../src/test/java/org/apache/camel/converter/NIOConverterTest.java  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3990ebe4/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java b/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
index 8e02529..386435f 100644
--- a/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/converter/NIOConverterTest.java
@@ -68,7 +68,6 @@ public class NIOConverterTest extends ContextTestSupport {
         String out = NIOConverter.toString(buffer, null);
         assertEquals(str, out);
     }
-    
 
     public void testToByteBuffer() {
         ByteBuffer bb = NIOConverter.toByteBuffer("Hello".getBytes());