This is an automated email from the ASF dual-hosted git repository. alexvanboxel pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push: new 589d274 [BEAM-9453] Changed new string creation to use StandardCharsets.UTF_8 new 2085f1b Merge pull request #11017 from [BEAM-9453] Fix potential UnsupportedEncodingException 589d274 is described below commit 589d274145690cfbee695f9d0c6dbee208193f43 Author: Hk-tang <hkt...@ualberta.ca> AuthorDate: Mon Mar 2 13:44:20 2020 -0700 [BEAM-9453] Changed new string creation to use StandardCharsets.UTF_8 --- .../src/main/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqMessage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdks/java/io/rabbitmq/src/main/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqMessage.java b/sdks/java/io/rabbitmq/src/main/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqMessage.java index 6028839..bffce77 100644 --- a/sdks/java/io/rabbitmq/src/main/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqMessage.java +++ b/sdks/java/io/rabbitmq/src/main/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqMessage.java @@ -28,6 +28,7 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.nio.charset.StandardCharsets; import javax.annotation.Nullable; /** @@ -79,7 +80,7 @@ public class RabbitMqMessage implements Serializable { if (value instanceof LongString) { LongString longString = (LongString) value; byte[] bytes = longString.getBytes(); - String s = new String(bytes, "UTF-8"); + String s = new String(bytes, StandardCharsets.UTF_8); value = s; } else { throw new RuntimeException(String.format("no transformation defined for %s", value));