aboutsummaryrefslogtreecommitdiffhomepage
path: root/java/src/test/java/com/google/protobuf/TestUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/test/java/com/google/protobuf/TestUtil.java')
-rw-r--r--java/src/test/java/com/google/protobuf/TestUtil.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/java/src/test/java/com/google/protobuf/TestUtil.java b/java/src/test/java/com/google/protobuf/TestUtil.java
index 135a1174..19a96d0e 100644
--- a/java/src/test/java/com/google/protobuf/TestUtil.java
+++ b/java/src/test/java/com/google/protobuf/TestUtil.java
@@ -276,11 +276,7 @@ public final class TestUtil {
/** Helper to convert a String to ByteString. */
static ByteString toBytes(String str) {
- try {
- return ByteString.copyFrom(str.getBytes("UTF-8"));
- } catch(java.io.UnsupportedEncodingException e) {
- throw new RuntimeException("UTF-8 not supported.", e);
- }
+ return ByteString.copyFrom(str.getBytes(Internal.UTF_8));
}
/**