From 6a949cda379c0ee38cce1a926e2982d45f53dfce Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Wed, 3 Dec 2014 18:23:49 -0800 Subject: Remove usage of features not supported in Java 1.6. --- java/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/java/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java b/java/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java index 6372b7a7..cec3da1e 100644 --- a/java/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java +++ b/java/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java @@ -38,7 +38,6 @@ import junit.framework.TestCase; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.nio.charset.StandardCharsets; /** * Tests for {@link UnknownFieldSetLite}. @@ -228,9 +227,9 @@ public class UnknownFieldSetLiteTest extends TestCase { assertEquals(foo, copyOfCopy); } - public void testMalformedBytes() { + public void testMalformedBytes() throws Exception { try { - Foo.parseFrom("this is a malformed protocol buffer".getBytes(StandardCharsets.UTF_8)); + Foo.parseFrom("this is a malformed protocol buffer".getBytes("UTF-8")); fail(); } catch (InvalidProtocolBufferException e) { // Expected. -- cgit v1.2.3