--- old/test/java/util/Base64/TestBase64.java 2014-08-04 14:51:53.000000000 +0800 +++ new/test/java/util/Base64/TestBase64.java 2014-08-04 14:51:53.000000000 +0800 @@ -114,8 +114,6 @@ testDecodeIgnoredAfterPadding(); } - private static sun.misc.BASE64Encoder sunmisc = new sun.misc.BASE64Encoder(); - private static void test(Base64.Encoder enc, Base64.Decoder dec, int numRuns, int numBytes) throws Throwable { Random rnd = new java.util.Random(); @@ -143,21 +141,6 @@ throw new RuntimeException( "Base64 enc.encode().withoutPadding() has padding!"); } - // compare to sun.misc.BASE64Encoder - - byte[] encoded2 = sunmisc.encode(orig).getBytes("ASCII"); - if (!withoutPadding) { // don't test for withoutPadding() - checkEqual(normalize(encoded), normalize(encoded2), - "Base64 enc.encode() does not match sun.misc.base64!"); - } - // remove padding '=' to test non-padding decoding case - if (encoded[encoded.length -2] == '=') - encoded2 = Arrays.copyOf(encoded, encoded.length -2); - else if (encoded[encoded.length -1] == '=') - encoded2 = Arrays.copyOf(encoded, encoded.length -1); - else - encoded2 = null; - // --------testing encodetoString(byte[])/decode(String)-------- String str = enc.encodeToString(orig); if (!Arrays.equals(str.getBytes("ASCII"), encoded)) { @@ -167,11 +150,6 @@ byte[] buf = dec.decode(new String(encoded, "ASCII")); checkEqual(buf, orig, "Base64 decoding(String) failed!"); - if (encoded2 != null) { - buf = dec.decode(new String(encoded2, "ASCII")); - checkEqual(buf, orig, "Base64 decoding(String) failed!"); - } - //-------- testing encode/decode(Buffer)-------- testEncode(enc, ByteBuffer.wrap(orig), encoded); ByteBuffer bin = ByteBuffer.allocateDirect(orig.length); @@ -183,9 +161,6 @@ bin.put(encoded).flip(); testDecode(dec, bin, orig); - if (encoded2 != null) - testDecode(dec, ByteBuffer.wrap(encoded2), orig); - // --------testing decode.wrap(input stream)-------- // 1) random buf length ByteArrayInputStream bais = new ByteArrayInputStream(encoded);