am ff582a5e: am 424b079e: am c03fdbde: Merge "Fix ObjectInputStream proxy de-serialization"

* commit 'ff582a5e591946d1eb5d4ce238bf170c86d5e731':
  Fix ObjectInputStream proxy de-serialization
diff --git a/dalvik/src/main/java/dalvik/annotation/BrokenTest.java b/dalvik/src/main/java/dalvik/annotation/BrokenTest.java
index 401d652..16788d0 100644
--- a/dalvik/src/main/java/dalvik/annotation/BrokenTest.java
+++ b/dalvik/src/main/java/dalvik/annotation/BrokenTest.java
@@ -25,6 +25,8 @@
  * Marks a test case as broken. This means the test case should be fixed.
  *
  * @hide
+ *
+ * @deprecated - use expectations/brokentests.txt instead
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.METHOD })
diff --git a/dalvik/src/main/java/dalvik/annotation/SideEffect.java b/dalvik/src/main/java/dalvik/annotation/SideEffect.java
index b92e9bc..2d691e3 100644
--- a/dalvik/src/main/java/dalvik/annotation/SideEffect.java
+++ b/dalvik/src/main/java/dalvik/annotation/SideEffect.java
@@ -27,6 +27,8 @@
  * isolated manner.
  *
  * @hide
+ *
+ * @deprecated - use expectations/brokentests.txt instead
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.METHOD, ElementType.TYPE })
diff --git a/dex/src/main/java/com/android/dex/DexException.java b/dex/src/main/java/com/android/dex/DexException.java
index a30a46f..ee0af18 100644
--- a/dex/src/main/java/com/android/dex/DexException.java
+++ b/dex/src/main/java/com/android/dex/DexException.java
@@ -22,7 +22,7 @@
  * Thrown when there's a format problem reading, writing, or generally
  * processing a dex file.
  */
-public final class DexException extends ExceptionWithContext {
+public class DexException extends ExceptionWithContext {
     public DexException(String message) {
         super(message);
     }
diff --git a/dex/src/main/java/com/android/dex/DexIndexOverflowException.java b/dex/src/main/java/com/android/dex/DexIndexOverflowException.java
new file mode 100644
index 0000000..3226207
--- /dev/null
+++ b/dex/src/main/java/com/android/dex/DexIndexOverflowException.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.dex;
+
+/**
+ * Thrown when there's an index overflow writing a dex file.
+ */
+public final class DexIndexOverflowException extends DexException {
+    public DexIndexOverflowException(String message) {
+        super(message);
+    }
+
+    public DexIndexOverflowException(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/expectations/brokentests.txt b/expectations/brokentests.txt
index 4fd12d3..2a2e4c3 100644
--- a/expectations/brokentests.txt
+++ b/expectations/brokentests.txt
@@ -885,26 +885,77 @@
   ]
 },
 {
+  description: "Fails in CTS, passes in CoreTestRunner.",
+  result: EXEC_FAILED,
+  names: [
+      "org.apache.harmony.tests.java.net.URLConnection#test_getContentEncoding",
+      "libcore.java.text.OldNumberFormatTest#test_parseLjava_lang_String",
+      "libcore.java.nio.channels.OldSocketChannelTest#test_writeLjava_nio_ByteBuffer_Nonblocking_HugeData",
+      "org.apache.harmony.tests.java.lang.ProcessManagerTest#testSleep",
+      "libcore.java.security.cert.OldPKIXParametersTest#testPKIXParametersKeyStore04"
+  ]
+},
+{
+  description: "Suffers from DH slowness, disabling for now.",
+  result: EXEC_FAILED,
+  names: [
+      "libcore.java.security.OldDHTest#testDHGen",
+      "libcore.java.security.OldKeyPairGeneratorTestDH#testKeyPairGenerator",
+      "libcore.javax.crypto.spec.KeyPairGeneratorTestDH#testKeyPairGenerator",
+      "libcore.javax.crypto.spec.AlgorithmParametersTestDH#testAlgorithmParameters",
+      "libcore.javax.crypto.spec.AlgorithmParameterGeneratorTestDH#testAlgorithmParameterGenerator"
+  ]
+},
+{
+  description: "Destroys MD5 provider, hurts succeeding tests",
+  result: EXEC_FAILED,
+  names: [
+      "tests.api.javax.security.cert.X509CertificateTest#testVerifyPublicKey",
+      "tests.api.javax.security.cert.X509CertificateTest#testVerifyPublicKeyString"
+  ]
+},
+{
+  description: "Suffers from side effect of other, currently unknown test",
+  result: EXEC_FAILED,
+  names: [
+      "org.apache.harmony.luni.tests.internal.net.www.protocol.http.HttpURLConnectionTest#testProxyAuthorization"
+  ]
+},
+{
+  description: "Support_TestWebServer requires isolation.",
+  result: EXEC_FAILED,
+  names: [
+      "libcore.java.net.OldURLClassLoaderTest#test_findResourceLjava_lang_String"
+  ]
+},
+{
+  description: "This test affects tests that are run after this one due to caching in URLConnection.",
+  result: EXEC_FAILED,
+  names: [
+      "org.apache.harmony.luni.tests.java.net.ContentHandlerFactoryTest#test_createContentHandler"
+  ]
+},
+{
+  description: "Causes OutOfMemoryError to test finalization",
+  result: EXEC_FAILED,
+  names: [
+      "org.apache.harmony.tests.java.lang.ref.SoftReferenceTest#test_get_SoftReference",
+      "org.apache.harmony.crypto.tests.javax.crypto#ExemptionMechanismTest#test_finalize"
+  ]
+},
+{
+  description: "Causes open dex file error",
+  result: EXEC_FAILED,
+  names: [
+      "org.apache.harmony.tests.java.lang.reflect.GenericSignatureFormatErrorTest#test_signatureFormatError"
+  ]
+},
+{
   description: "The ResourceBundle code under test is probably not used much on Android and needs a lot of attention.",
   bug: 13747957,
   result: EXEC_FAILED,
   names: [
       "org.apache.harmony.tests.java.util.ControlTest#test_needsReload_LStringLLocaleLStringLClassLoaderResourceBundleJ"
   ]
-},
-{
-  description: "Some DecimalFormat tests fail, treating tests as broken while investigate further.",
-  bug: 12781028,
-  result: EXEC_FAILED,
-  names: [
-      "org.apache.harmony.tests.java.text.DecimalFormatTest#testSerializationSelf",
-      "org.apache.harmony.tests.java.text.DecimalFormatTest#test_formatD",
-      "org.apache.harmony.tests.java.text.DecimalFormatTest#test_formatDLjava_lang_StringBufferLjava_text_FieldPosition",
-      "org.apache.harmony.tests.java.text.DecimalFormatTest#test_formatDLjava_lang_StringBufferLjava_text_FieldPosition_problem_cases",
-      "org.apache.harmony.tests.java.text.DecimalFormatTest#test_formatD_2",
-      "org.apache.harmony.tests.java.text.DecimalFormatTest#test_formatJLjava_lang_StringBufferLjava_text_FieldPosition",
-      "org.apache.harmony.tests.java.text.DecimalFormatTest#test_formatToCharacterIterator_very_large",
-      "org.apache.harmony.tests.java.text.DecimalFormatTest#test_format_minus_zero"
-  ]
 }
 ]
diff --git a/expectations/knownfailures.txt b/expectations/knownfailures.txt
index 6b550a2..1c3ccec 100644
--- a/expectations/knownfailures.txt
+++ b/expectations/knownfailures.txt
@@ -1601,7 +1601,6 @@
     "libcore.java.security.cert.X509CertificateNistPkitsTest#testDeltaCRLs_InvaliddeltaCRLTest4",
     "libcore.java.security.cert.X509CertificateNistPkitsTest#testDeltaCRLs_InvaliddeltaCRLTest6",
     "libcore.java.security.cert.X509CertificateNistPkitsTest#testDeltaCRLs_InvaliddeltaCRLTest9",
-    "libcore.java.security.cert.X509CertificateNistPkitsTest#testDeltaCRLs_ValiddeltaCRLTest5",
     "libcore.java.security.cert.X509CertificateNistPkitsTest#testDistributionPoints_InvalidIDPwithindirectCRLTest23",
     "libcore.java.security.cert.X509CertificateNistPkitsTest#testDistributionPoints_InvalidcRLIssuerTest34",
     "libcore.java.security.cert.X509CertificateNistPkitsTest#testDistributionPoints_InvaliddistributionPointTest2",
@@ -1657,53 +1656,8 @@
   ]
 },
 {
-  description: "Known failures in klp-modular-dev branch being suppressed for dory / molly.",
-  bug: 14674275,
-  names: [
-    "libcore.java.lang.reflect.ClassLoaderReflectionTest#testConstructorsOfDifferentClassLoadersAreNotEqual",
-    "libcore.java.lang.reflect.ClassLoaderReflectionTest#testFieldsOfDifferentClassLoadersAreNotEqual",
-    "libcore.java.lang.reflect.MethodTest#testEqualMethodEqualsAndHashCode",
-    "libcore.java.lang.reflect.MethodTest#testHashCodeSpec",
-    "libcore.java.lang.reflect.ProxyTest#testDeclaredExceptionIntersectedByExactReturnTypes",
-    "libcore.java.lang.reflect.ProxyTest#testReturnTypeDoesNotSatisfyAllConstraintsWithLenientCaller",
-    "libcore.java.net.ConcurrentCloseTest#test_connect",
-    "libcore.java.net.ConcurrentCloseTest#test_connect_nonBlocking",
-    "libcore.java.net.ConcurrentCloseTest#test_connect_timeout",
-    "libcore.java.net.InetAddressTest#test_isReachable",
-    "libcore.java.net.OldSocketTest#test_ConstructorLjava_lang_StringILjava_net_InetAddressI2",
-    "libcore.java.net.OldSocketTest#test_connectLjava_net_SocketAddressI",
-    "libcore.java.net.URLConnectionTest#testConnectViaHttpProxyToHttpsUsingBadProxyAndHttpResponseCache",
-    "org.apache.harmony.luni.tests.java.net.URLConnectionTest#test_getLastModified",
-    "org.apache.harmony.tests.java.io.SerializationStressTest4#test_writeObject_Proxy",
-    "org.apache.harmony.tests.java.lang.reflect.FieldTest#testProtectedFieldAccess",
-    "org.apache.harmony.tests.java.net.DatagramSocketTest#test_setBroadcastZ",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_joinGroupLjava_net_InetAddress_IPv4",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_joinGroupLjava_net_InetAddress_IPv6",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface_IPv4",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface_IPv6",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface_multiple_joins_IPv4",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface_multiple_joins_IPv6",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_leaveGroupLjava_net_InetAddress_IPv4",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_leaveGroupLjava_net_InetAddress_IPv6",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_leaveGroupLjava_net_SocketAddressLjava_net_NetworkInterface_IPv4",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_leaveGroupLjava_net_SocketAddressLjava_net_NetworkInterface_IPv6",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_sendLjava_net_DatagramPacketB_IPv4",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_sendLjava_net_DatagramPacketB_IPv6",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_setLoopbackModeSendReceive_IPv4",
-    "org.apache.harmony.tests.java.net.MulticastSocketTest#test_setLoopbackModeSendReceive_IPv6",
-    "tests.api.internal.net.www.protocol.file.FileURLConnectionTest#testGetContentType",
-    "tests.api.internal.net.www.protocol.file.FileURLConnectionTest#testGetInputStream",
-    "tests.api.internal.net.www.protocol.file.FileURLConnectionTest#testHeaderFunctions"
-  ]
-},
-{
   description: "Known failure in GregorianCalendarTest",
   bug: 12778197,
   name: "org.apache.harmony.tests.java.util.GregorianCalendarTest#test_computeTime"
-},
-{
-  description: "Environment specific Console test suppressed for dory / molly",
-  bug: 12491103,
-  name: "org.apache.harmony.tests.java.io.ConsoleTest#test_readPassword_LString_LObject"
 }
 ]
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessManagerTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessManagerTest.java
index 3930b59..9f7474a 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessManagerTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessManagerTest.java
@@ -16,8 +16,6 @@
 
 package org.apache.harmony.tests.java.lang;
 
-import dalvik.annotation.BrokenTest;
-
 import junit.framework.TestCase;
 
 import java.io.BufferedReader;
@@ -47,7 +45,7 @@
         assertEquals(greeting, readLine(process));
     }
 
-    @BrokenTest("Sporadic failures in CTS, but not in CoreTestRunner")
+    // BrokenTest: Sporadic failures in CTS, but not in CoreTestRunner
     public void testSleep() throws IOException {
         String[] commands = { "sleep", "1" };
         process = Runtime.getRuntime().exec(commands, null, null);
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/SoftReferenceTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/SoftReferenceTest.java
index cfc5d0d..f66cbbf 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/SoftReferenceTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/SoftReferenceTest.java
@@ -16,8 +16,6 @@
  */
 package org.apache.harmony.tests.java.lang.ref;
 
-import dalvik.annotation.SideEffect;
-
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.SoftReference;
@@ -79,7 +77,7 @@
         assertTrue("Same object not returned.", bool == sr.get());
     }
 
-    @SideEffect("Causes OutOfMemoryError to test finalization")
+    // SideEffect: Causes OutOfMemoryError to test finalization
     public void test_get_SoftReference() {
 
         class TestObject {
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/reflect/GenericSignatureFormatErrorTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/reflect/GenericSignatureFormatErrorTest.java
index 9cd4947..0cad681 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/reflect/GenericSignatureFormatErrorTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/reflect/GenericSignatureFormatErrorTest.java
@@ -1,7 +1,6 @@
 package org.apache.harmony.tests.java.lang.reflect;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.SideEffect;
 import dalvik.system.DexFile;
 
 import junit.framework.TestCase;
@@ -34,9 +33,9 @@
 
     @AndroidOnly("Uses Android specific class dalvik.system.DexFile " +
             "for loading classes.")
-    @SideEffect("strange issue (exception: 'could not open dex file', " +
-            "dalvikvm: 'waitpid failed' log msg  - only occurs when @SideEffect is removed " +
-            "and this test is run via running tests.luni.AllTestsLang TestSuite")
+    // SideEffect: strange issue (exception: 'could not open dex file', 
+    //  dalvikvm: 'waitpid failed' log msg  - only occurs when @SideEffect is removed 
+    // and this test is run via running tests.luni.AllTestsLang TestSuite
     public void test_signatureFormatError() throws Exception {
         /*
          * dex1.bytes is a jar file with a classes.dex in it.
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java
index 740340e..d5d8191 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java
@@ -23,6 +23,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.security.CodeSigner;
 import java.security.Permission;
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
@@ -98,6 +99,8 @@
 
     private static final String INVALID_CHAIN_JAR = "hyts_signed_invalidChain.jar";
 
+    private static final String AMBIGUOUS_SIGNERS_JAR = "hyts_signed_ambiguousSignerArray.jar";
+
     private File resources;
 
     // custom security manager
@@ -647,13 +650,18 @@
                         + jarName + "\"", foundCerts);
     }
 
-    private Certificate[] getSignedJarCerts(String jarName, boolean chainCheck) throws Exception {
+    private static class Results {
+        public Certificate[] certificates;
+        public CodeSigner[] signers;
+    }
+
+    private Results getSignedJarCerts(String jarName) throws Exception {
         Support_Resources.copyFile(resources, null, jarName);
 
         File file = new File(resources, jarName);
-        Certificate[] foundCerts = null;
+        Results results = new Results();
 
-        JarFile jarFile = new JarFile(file, true, ZipFile.OPEN_READ, chainCheck);
+        JarFile jarFile = new JarFile(file, true, ZipFile.OPEN_READ);
         try {
 
             Enumeration<JarEntry> e = jarFile.entries();
@@ -664,8 +672,10 @@
                 is.skip(entry.getSize());
                 is.close();
                 Certificate[] certs = entry.getCertificates();
+                CodeSigner[] signers = entry.getCodeSigners();
                 if (certs != null && certs.length > 0) {
-                    foundCerts = certs;
+                    results.certificates = certs;
+                    results.signers = signers;
                     break;
                 }
             }
@@ -673,42 +683,38 @@
             jarFile.close();
         }
 
-        return foundCerts;
+        return results;
     }
 
-    public void testJarFile_Signed_ValidChain_NoCheck() throws Exception {
-        Certificate[] certs = getSignedJarCerts(VALID_CHAIN_JAR, false);
-        assertNotNull(certs);
-        assertEquals(Arrays.deepToString(certs), 3, certs.length);
-        assertEquals("CN=fake-chain", ((X509Certificate) certs[0]).getSubjectDN().toString());
-        assertEquals("CN=intermediate1", ((X509Certificate) certs[1]).getSubjectDN().toString());
-        assertEquals("CN=root1", ((X509Certificate) certs[2]).getSubjectDN().toString());
+    public void testJarFile_Signed_ValidChain() throws Exception {
+        Results result = getSignedJarCerts(VALID_CHAIN_JAR);
+        assertNotNull(result);
+        assertEquals(Arrays.deepToString(result.certificates), 3, result.certificates.length);
+        assertEquals(Arrays.deepToString(result.signers), 1, result.signers.length);
+        assertEquals(3, result.signers[0].getSignerCertPath().getCertificates().size());
+        assertEquals("CN=fake-chain", ((X509Certificate) result.certificates[0]).getSubjectDN().toString());
+        assertEquals("CN=intermediate1", ((X509Certificate) result.certificates[1]).getSubjectDN().toString());
+        assertEquals("CN=root1", ((X509Certificate) result.certificates[2]).getSubjectDN().toString());
     }
 
-    public void testJarFile_Signed_ValidChain_Check() throws Exception {
-        Certificate[] certs = getSignedJarCerts(VALID_CHAIN_JAR, true);
-        assertNotNull(certs);
-        assertEquals(Arrays.deepToString(certs), 3, certs.length);
-        assertEquals("CN=fake-chain", ((X509Certificate) certs[0]).getSubjectDN().toString());
-        assertEquals("CN=intermediate1", ((X509Certificate) certs[1]).getSubjectDN().toString());
-        assertEquals("CN=root1", ((X509Certificate) certs[2]).getSubjectDN().toString());
+    public void testJarFile_Signed_InvalidChain() throws Exception {
+        Results result = getSignedJarCerts(INVALID_CHAIN_JAR);
+        assertNotNull(result);
+        assertEquals(Arrays.deepToString(result.certificates), 3, result.certificates.length);
+        assertEquals(Arrays.deepToString(result.signers), 1, result.signers.length);
+        assertEquals(3, result.signers[0].getSignerCertPath().getCertificates().size());
+        assertEquals("CN=fake-chain", ((X509Certificate) result.certificates[0]).getSubjectDN().toString());
+        assertEquals("CN=intermediate1", ((X509Certificate) result.certificates[1]).getSubjectDN().toString());
+        assertEquals("CN=root1", ((X509Certificate) result.certificates[2]).getSubjectDN().toString());
     }
 
-    public void testJarFile_Signed_InvalidChain_NoCheck() throws Exception {
-        Certificate[] certs = getSignedJarCerts(INVALID_CHAIN_JAR, false);
-        assertNotNull(certs);
-        assertEquals(Arrays.deepToString(certs), 3, certs.length);
-        assertEquals("CN=fake-chain", ((X509Certificate) certs[0]).getSubjectDN().toString());
-        assertEquals("CN=intermediate1", ((X509Certificate) certs[1]).getSubjectDN().toString());
-        assertEquals("CN=root1", ((X509Certificate) certs[2]).getSubjectDN().toString());
-    }
-
-    public void testJarFile_Signed_InvalidChain_Check() throws Exception {
-        Certificate[] certs = getSignedJarCerts(INVALID_CHAIN_JAR, true);
-        assertNotNull(certs);
-        assertEquals(Arrays.deepToString(certs), 2, certs.length);
-        assertEquals("CN=fake-chain", ((X509Certificate) certs[0]).getSubjectDN().toString());
-        assertEquals("CN=intermediate1", ((X509Certificate) certs[1]).getSubjectDN().toString());
+    public void testJarFile_Signed_AmbiguousSigners() throws Exception {
+        Results result = getSignedJarCerts(AMBIGUOUS_SIGNERS_JAR);
+        assertNotNull(result);
+        assertEquals(Arrays.deepToString(result.certificates), 2, result.certificates.length);
+        assertEquals(Arrays.deepToString(result.signers), 2, result.signers.length);
+        assertEquals(1, result.signers[0].getSignerCertPath().getCertificates().size());
+        assertEquals(1, result.signers[1].getSignerCertPath().getCertificates().size());
     }
 
     /*
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java
index e937db9..64bfbb3 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java
@@ -22,9 +22,6 @@
 
 package tests.api.javax.security.cert;
 
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.SideEffect;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -661,7 +658,7 @@
      * @throws CertificateException
      * {@link Certificate#verify(PublicKey)}
      */
-    @SideEffect("Destroys MD5 provider, hurts succeeding tests")
+    // Side Effect: Destroys MD5 provider, hurts succeeding tests
     public void testVerifyPublicKey() throws InvalidKeyException,
             NoSuchAlgorithmException, NoSuchProviderException,
             SignatureException, CertificateException {
@@ -744,7 +741,7 @@
      * @throws CertificateException
      * {@link Certificate#verify(PublicKey, String)}
      */
-    @SideEffect("Destroys MD5 provider, hurts succeeding tests")
+    // SideEffect: Destroys MD5 provider, hurts succeeding tests
     public void testVerifyPublicKeyString() throws InvalidKeyException,
             java.security.cert.CertificateException, NoSuchAlgorithmException,
             NoSuchProviderException, SignatureException, IOException,
diff --git a/luni/src/main/java/android/system/ErrnoException.java b/luni/src/main/java/android/system/ErrnoException.java
index 134d6a0..90155c8 100644
--- a/luni/src/main/java/android/system/ErrnoException.java
+++ b/luni/src/main/java/android/system/ErrnoException.java
@@ -24,8 +24,6 @@
  * A checked exception thrown when {@link Os} methods fail. This exception contains the native
  * errno value, for comparison against the constants in {@link OsConstants}, should sophisticated
  * callers need to adjust their behavior based on the exact failure.
- *
- * @hide
  */
 public final class ErrnoException extends Exception {
   private final String functionName;
diff --git a/luni/src/main/java/android/system/Os.java b/luni/src/main/java/android/system/Os.java
index e7613df..beb785f 100644
--- a/luni/src/main/java/android/system/Os.java
+++ b/luni/src/main/java/android/system/Os.java
@@ -47,8 +47,6 @@
  * primitives used to implement the higher-level APIs.
  *
  * <p>The corresponding constants can be found in {@link OsConstants}.
- *
- * @hide
  */
 public final class Os {
   private Os() {}
diff --git a/luni/src/main/java/android/system/OsConstants.java b/luni/src/main/java/android/system/OsConstants.java
index cfed2f6..4166325 100644
--- a/luni/src/main/java/android/system/OsConstants.java
+++ b/luni/src/main/java/android/system/OsConstants.java
@@ -18,7 +18,6 @@
 
 /**
  * Constants and helper functions for use with {@link Os}.
- * @hide
  */
 public final class OsConstants {
     private OsConstants() {
diff --git a/luni/src/main/java/android/system/StructPollfd.java b/luni/src/main/java/android/system/StructPollfd.java
index 8bdecb2..b812612 100644
--- a/luni/src/main/java/android/system/StructPollfd.java
+++ b/luni/src/main/java/android/system/StructPollfd.java
@@ -22,8 +22,6 @@
 /**
  * Used as an in/out parameter to {@link Os#poll}.
  * Corresponds to C's {@code struct pollfd} from {@code &lt;poll.h&gt;}.
- *
- * @hide
  */
 public final class StructPollfd {
   /** The file descriptor to poll. */
diff --git a/luni/src/main/java/android/system/StructStat.java b/luni/src/main/java/android/system/StructStat.java
index 87bd50c..a6958c1 100644
--- a/luni/src/main/java/android/system/StructStat.java
+++ b/luni/src/main/java/android/system/StructStat.java
@@ -21,8 +21,6 @@
 /**
  * File information returned by {@link Os#fstat}, {@link Os#lstat}, and {@link Os#stat}.
  * Corresponds to C's {@code struct stat} from {@code &lt;stat.h&gt;}.
- *
- * @hide
  */
 public final class StructStat {
   /** Device ID of device containing file. */
diff --git a/luni/src/main/java/android/system/StructStatVfs.java b/luni/src/main/java/android/system/StructStatVfs.java
index b0b7802..942a39a 100644
--- a/luni/src/main/java/android/system/StructStatVfs.java
+++ b/luni/src/main/java/android/system/StructStatVfs.java
@@ -20,8 +20,6 @@
 
 /**
  * File information returned by {@link Os#fstatvfs} and {@link Os#statvfs}.
- *
- * @hide
  */
 public final class StructStatVfs {
   /** File system block size (used for block counts). */
diff --git a/luni/src/main/java/android/system/StructUtsname.java b/luni/src/main/java/android/system/StructUtsname.java
index c62dbfa..5d9127b 100644
--- a/luni/src/main/java/android/system/StructUtsname.java
+++ b/luni/src/main/java/android/system/StructUtsname.java
@@ -21,8 +21,6 @@
 /**
  * Information returned by {@link Os#uname}.
  * Corresponds to C's {@code struct utsname} from {@code &lt;sys/utsname.h&gt;}.
- *
- * @hide
  */
 public final class StructUtsname {
   /** The OS name, such as "Linux". */
diff --git a/luni/src/main/java/android/util/MutableBoolean.java b/luni/src/main/java/android/util/MutableBoolean.java
index 90bf68c..5a8a200 100644
--- a/luni/src/main/java/android/util/MutableBoolean.java
+++ b/luni/src/main/java/android/util/MutableBoolean.java
@@ -17,7 +17,6 @@
 package android.util;
 
 /**
- * @hide
  */
 public final class MutableBoolean {
   public boolean value;
diff --git a/luni/src/main/java/android/util/MutableByte.java b/luni/src/main/java/android/util/MutableByte.java
index 65738b9..7397ba4 100644
--- a/luni/src/main/java/android/util/MutableByte.java
+++ b/luni/src/main/java/android/util/MutableByte.java
@@ -17,7 +17,6 @@
 package android.util;
 
 /**
- * @hide
  */
 public final class MutableByte {
   public byte value;
diff --git a/luni/src/main/java/android/util/MutableChar.java b/luni/src/main/java/android/util/MutableChar.java
index b59bab3..f435331 100644
--- a/luni/src/main/java/android/util/MutableChar.java
+++ b/luni/src/main/java/android/util/MutableChar.java
@@ -17,7 +17,6 @@
 package android.util;
 
 /**
- * @hide
  */
 public final class MutableChar {
   public char value;
diff --git a/luni/src/main/java/android/util/MutableDouble.java b/luni/src/main/java/android/util/MutableDouble.java
index 3e2cc3a..f62f47e 100644
--- a/luni/src/main/java/android/util/MutableDouble.java
+++ b/luni/src/main/java/android/util/MutableDouble.java
@@ -17,7 +17,6 @@
 package android.util;
 
 /**
- * @hide
  */
 public final class MutableDouble {
   public double value;
diff --git a/luni/src/main/java/android/util/MutableFloat.java b/luni/src/main/java/android/util/MutableFloat.java
index 6e30501..6b5441c 100644
--- a/luni/src/main/java/android/util/MutableFloat.java
+++ b/luni/src/main/java/android/util/MutableFloat.java
@@ -17,7 +17,6 @@
 package android.util;
 
 /**
- * @hide
  */
 public final class MutableFloat {
   public float value;
diff --git a/luni/src/main/java/android/util/MutableInt.java b/luni/src/main/java/android/util/MutableInt.java
index 8220c44..2f93030 100644
--- a/luni/src/main/java/android/util/MutableInt.java
+++ b/luni/src/main/java/android/util/MutableInt.java
@@ -17,7 +17,6 @@
 package android.util;
 
 /**
- * @hide
  */
 public final class MutableInt {
   public int value;
diff --git a/luni/src/main/java/android/util/MutableLong.java b/luni/src/main/java/android/util/MutableLong.java
index 5df6a0d..94beab5 100644
--- a/luni/src/main/java/android/util/MutableLong.java
+++ b/luni/src/main/java/android/util/MutableLong.java
@@ -17,7 +17,6 @@
 package android.util;
 
 /**
- * @hide
  */
 public final class MutableLong {
   public long value;
diff --git a/luni/src/main/java/android/util/MutableShort.java b/luni/src/main/java/android/util/MutableShort.java
index 3880fef..cdd9923 100644
--- a/luni/src/main/java/android/util/MutableShort.java
+++ b/luni/src/main/java/android/util/MutableShort.java
@@ -17,7 +17,6 @@
 package android.util;
 
 /**
- * @hide
  */
 public final class MutableShort {
   public short value;
diff --git a/luni/src/main/java/java/lang/Character.java b/luni/src/main/java/java/lang/Character.java
index 2bf3a89..59931f6 100644
--- a/luni/src/main/java/java/lang/Character.java
+++ b/luni/src/main/java/java/lang/Character.java
@@ -1535,7 +1535,6 @@
      * don't have a corresponding {@code UnicodeScript} will be in {@code UNKNOWN}.
      *
      * @since 1.7
-     * @hide
      */
     public static enum UnicodeScript {
         /** ISO 15924 English name "Arabic" */
diff --git a/luni/src/main/java/java/net/HttpCookie.java b/luni/src/main/java/java/net/HttpCookie.java
index 04121f7..1d8a8cc 100644
--- a/luni/src/main/java/java/net/HttpCookie.java
+++ b/luni/src/main/java/java/net/HttpCookie.java
@@ -564,7 +564,6 @@
      * to scripts in a browser.
      *
      * @since 1.7
-     * @hide Until ready for an API update
      */
     public boolean isHttpOnly() {
         return httpOnly;
@@ -575,7 +574,6 @@
      * to scripts in a browser.
      *
      * @since 1.7
-     * @hide Until ready for an API update
      */
     public void setHttpOnly(boolean httpOnly) {
         this.httpOnly = httpOnly;
diff --git a/luni/src/main/java/java/net/SocketOption.java b/luni/src/main/java/java/net/SocketOption.java
index 3f65494..bc3e101 100644
--- a/luni/src/main/java/java/net/SocketOption.java
+++ b/luni/src/main/java/java/net/SocketOption.java
@@ -27,7 +27,6 @@
  *
  * @param <T> the type of the value
  * @since 1.7
- * @hide Until ready for a public API change
  */
 public interface SocketOption<T> {
 
diff --git a/luni/src/main/java/java/net/StandardSocketOptions.java b/luni/src/main/java/java/net/StandardSocketOptions.java
index 3d10caf..a793f66 100644
--- a/luni/src/main/java/java/net/StandardSocketOptions.java
+++ b/luni/src/main/java/java/net/StandardSocketOptions.java
@@ -32,7 +32,6 @@
  * for each type of socket.
  *
  * @since 1.7
- * @hide Until ready for a public API change
  */
 public final class StandardSocketOptions {
 
diff --git a/luni/src/main/java/java/net/URLConnection.java b/luni/src/main/java/java/net/URLConnection.java
index cc7de90..d24e273 100644
--- a/luni/src/main/java/java/net/URLConnection.java
+++ b/luni/src/main/java/java/net/URLConnection.java
@@ -320,7 +320,6 @@
      * {@code content-length} or {@code -1} if this field is not set.
      *
      * @since 1.7
-     * @hide Until ready for a public API change
      */
     public long getContentLengthLong() {
         return getHeaderFieldLong("Content-Length", -1);
@@ -568,7 +567,6 @@
      *            the default value if no field has been found.
      * @return the value of the specified header field as a number.
      * @since 1.7
-     * @hide Until ready for a public API change
      */
     public long getHeaderFieldLong(String field, long defaultValue) {
         try {
diff --git a/luni/src/main/java/java/nio/DatagramChannelImpl.java b/luni/src/main/java/java/nio/DatagramChannelImpl.java
index 8a5dbb6..343ef00 100644
--- a/luni/src/main/java/java/nio/DatagramChannelImpl.java
+++ b/luni/src/main/java/java/nio/DatagramChannelImpl.java
@@ -112,7 +112,6 @@
         return socket;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     synchronized public DatagramChannel bind(SocketAddress local) throws IOException {
         checkOpen();
@@ -160,21 +159,18 @@
         }
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     synchronized public SocketAddress getLocalAddress() throws IOException {
         checkOpen();
         return isBound ? new InetSocketAddress(localAddress, localPort) : null;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> T getOption(SocketOption<T> option) throws IOException {
         return NioUtils.getSocketOption(
                 this, StandardSocketOptions.DATAGRAM_SOCKET_OPTIONS, option);
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> DatagramChannel setOption(SocketOption<T> option, T value) throws IOException {
         checkOpen();
@@ -183,7 +179,6 @@
         return this;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public Set<SocketOption<?>> supportedOptions() {
         return StandardSocketOptions.DATAGRAM_SOCKET_OPTIONS;
diff --git a/luni/src/main/java/java/nio/ServerSocketChannelImpl.java b/luni/src/main/java/java/nio/ServerSocketChannelImpl.java
index d2cbf36..1b84797 100644
--- a/luni/src/main/java/java/nio/ServerSocketChannelImpl.java
+++ b/luni/src/main/java/java/nio/ServerSocketChannelImpl.java
@@ -58,7 +58,6 @@
         return socket;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public final ServerSocketChannel bind(SocketAddress localAddr, int backlog) throws IOException {
         if (!isOpen()) {
@@ -81,7 +80,6 @@
         return this;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public SocketAddress getLocalAddress() throws IOException {
         if (!isOpen()) {
@@ -90,20 +88,17 @@
         return socket.getLocalSocketAddress();
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> T getOption(SocketOption<T> option) throws IOException {
         return NioUtils.getSocketOption(this, StandardSocketOptions.SERVER_SOCKET_OPTIONS, option);
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> ServerSocketChannel setOption(SocketOption<T> option, T value) throws IOException {
         NioUtils.setSocketOption(this, StandardSocketOptions.SERVER_SOCKET_OPTIONS, option, value);
         return this;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public Set<SocketOption<?>> supportedOptions() {
         return StandardSocketOptions.SERVER_SOCKET_OPTIONS;
diff --git a/luni/src/main/java/java/nio/SocketChannelImpl.java b/luni/src/main/java/java/nio/SocketChannelImpl.java
index 7c3cd78..9064f29 100644
--- a/luni/src/main/java/java/nio/SocketChannelImpl.java
+++ b/luni/src/main/java/java/nio/SocketChannelImpl.java
@@ -139,7 +139,6 @@
         return socket;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     synchronized public final SocketChannel bind(SocketAddress local) throws IOException {
         if (!isOpen()) {
@@ -189,7 +188,6 @@
         }
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     synchronized public SocketAddress getLocalAddress() throws IOException {
         if (!isOpen()) {
@@ -198,20 +196,17 @@
         return isBound ? new InetSocketAddress(localAddress, localPort) : null;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> T getOption(SocketOption<T> option) throws IOException {
         return NioUtils.getSocketOption(this, StandardSocketOptions.SOCKET_OPTIONS, option);
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> SocketChannel setOption(SocketOption<T> option, T value) throws IOException {
         NioUtils.setSocketOption(this, StandardSocketOptions.SOCKET_OPTIONS, option, value);
         return this;
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public Set<SocketOption<?>> supportedOptions() {
         return StandardSocketOptions.SOCKET_OPTIONS;
diff --git a/luni/src/main/java/java/nio/channels/AlreadyBoundException.java b/luni/src/main/java/java/nio/channels/AlreadyBoundException.java
index 0a35fc3..70c70ac 100644
--- a/luni/src/main/java/java/nio/channels/AlreadyBoundException.java
+++ b/luni/src/main/java/java/nio/channels/AlreadyBoundException.java
@@ -19,8 +19,6 @@
 /**
  * An {@code AlreadyBoundException} is thrown when an attempt is made to bind a NetworkChannel that
  * is already bound.
- *
- * @hide Until ready for a public API change
  */
 public class AlreadyBoundException extends IllegalStateException {
 
diff --git a/luni/src/main/java/java/nio/channels/DatagramChannel.java b/luni/src/main/java/java/nio/channels/DatagramChannel.java
index 3a5d1cc..b0cc2ac 100644
--- a/luni/src/main/java/java/nio/channels/DatagramChannel.java
+++ b/luni/src/main/java/java/nio/channels/DatagramChannel.java
@@ -92,7 +92,6 @@
      */
     public abstract DatagramSocket socket();
 
-    /** @hide Until ready for a public API change */
     @Override
     public DatagramChannel bind(SocketAddress local) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -100,7 +99,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public SocketAddress getLocalAddress() throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -108,7 +106,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> T getOption(SocketOption<T> option) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -116,7 +113,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> DatagramChannel setOption(SocketOption<T> option, T value) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -124,7 +120,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public Set<SocketOption<?>> supportedOptions() {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -132,7 +127,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public MembershipKey join(InetAddress groupAddress, NetworkInterface networkInterface)
             throws IOException {
@@ -141,7 +135,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public MembershipKey join(InetAddress groupAddress, NetworkInterface networkInterface,
             InetAddress sourceAddress) throws IOException {
diff --git a/luni/src/main/java/java/nio/channels/FileChannel.java b/luni/src/main/java/java/nio/channels/FileChannel.java
index e5f2862c..3989167 100644
--- a/luni/src/main/java/java/nio/channels/FileChannel.java
+++ b/luni/src/main/java/java/nio/channels/FileChannel.java
@@ -76,9 +76,8 @@
  * stream and vice versa; this includes modifications to the file position,
  * content, size, etc.
  */
-// TODO: Remove ByteChannel when SeekableByteChannel is unhidden.
 public abstract class FileChannel extends AbstractInterruptibleChannel
-        implements GatheringByteChannel, ScatteringByteChannel, ByteChannel, SeekableByteChannel {
+        implements GatheringByteChannel, ScatteringByteChannel, SeekableByteChannel {
 
     /**
      * {@code MapMode} defines file mapping mode constants.
diff --git a/luni/src/main/java/java/nio/channels/FileLock.java b/luni/src/main/java/java/nio/channels/FileLock.java
index 037537c..d1ba872 100644
--- a/luni/src/main/java/java/nio/channels/FileLock.java
+++ b/luni/src/main/java/java/nio/channels/FileLock.java
@@ -107,7 +107,7 @@
     }
 
     /**
-     * Returns the lock's {@link FileChannel}.
+     * Returns the lock's {@link FileChannel}. This method has been superseded by {@link #acquiredBy()}.
      */
     public final FileChannel channel() {
         return channel;
@@ -117,9 +117,7 @@
      * Returns the {@link Channel} that holds this lock.
      *
      * @since 1.7
-     * @hide Until ready for an API update
      */
-    // TODO: unhiding, add to channel():  This method has been superseded by {@link #acquiredBy()}.
     public Channel acquiredBy() {
         return channel;
     }
diff --git a/luni/src/main/java/java/nio/channels/MembershipKey.java b/luni/src/main/java/java/nio/channels/MembershipKey.java
index 18ff92d..a7eecac 100644
--- a/luni/src/main/java/java/nio/channels/MembershipKey.java
+++ b/luni/src/main/java/java/nio/channels/MembershipKey.java
@@ -36,7 +36,6 @@
  * Multicast Source Filters</a> for concepts and terminology associated with multicast membership.
  *
  * @since 1.7
- * @hide Until ready for a public API change
  */
 public abstract class MembershipKey {
 
diff --git a/luni/src/main/java/java/nio/channels/MulticastChannel.java b/luni/src/main/java/java/nio/channels/MulticastChannel.java
index 41ef501..47433d0 100644
--- a/luni/src/main/java/java/nio/channels/MulticastChannel.java
+++ b/luni/src/main/java/java/nio/channels/MulticastChannel.java
@@ -69,17 +69,15 @@
  * information.
  *
  * @since 1.7
- * @hide Until ready for a public API change
  */
 public interface MulticastChannel extends NetworkChannel {
 
-  // @hide Until ready for a public API change
-  // /**
-  //  * {@inheritDoc}
-  //  *
-  //  * If the channel is currently part of one or more multicast groups then the memberships are
-  // * dropped and any associated {@code MembershipKey} objects are invalidated.
-  // */
+  /**
+   * {@inheritDoc}
+   *
+   * If the channel is currently part of one or more multicast groups then the memberships are
+   * dropped and any associated {@code MembershipKey} objects are invalidated.
+   */
   void close() throws IOException;
 
   /**
@@ -112,7 +110,6 @@
    *         if the channel is closed
    * @throws IOException
    *         if some other I/O error occurs
-   * @hide Until ready for a public API change
    */
   MembershipKey join(InetAddress groupAddress, NetworkInterface networkInterface)
       throws IOException;
@@ -151,7 +148,6 @@
    *         if the channel is closed
    * @throws IOException
    *         if some other I/O error occurs
-   * @hide Until ready for a public API change
    */
   MembershipKey join(
       InetAddress groupAddress, NetworkInterface networkInterface, InetAddress sourceAddress)
diff --git a/luni/src/main/java/java/nio/channels/NetworkChannel.java b/luni/src/main/java/java/nio/channels/NetworkChannel.java
index 9b46e30..3ae1e6b 100644
--- a/luni/src/main/java/java/nio/channels/NetworkChannel.java
+++ b/luni/src/main/java/java/nio/channels/NetworkChannel.java
@@ -26,7 +26,6 @@
  * A common interface for channels that are backed by network sockets.
  *
  * @since 1.7
- * @hide Until ready for a public API change
  */
 public interface NetworkChannel extends AutoCloseable, Channel, Closeable {
 
@@ -46,7 +45,6 @@
    *     if the channel is already bound.
    * @throws IOException
    *     if another I/O error occurs.
-   * @hide Until ready for a public API change
    */
   NetworkChannel bind(SocketAddress local) throws IOException;
 
@@ -64,7 +62,6 @@
    *     if the channel is closed.
    * @throws IOException
    *     if another I/O error occurs.
-   * @hide Until ready for a public API change
    */
   SocketAddress getLocalAddress() throws IOException;
 
@@ -77,7 +74,6 @@
    *     if the socket is closed
    * @throws IOException
    *     if the value cannot be read.
-   * @hide Until ready for a public API change
    * @see java.net.StandardSocketOptions
    */
   <T> T getOption(SocketOption<T> option) throws IOException;
@@ -94,15 +90,12 @@
    *     if the socket is closed
    * @throws IOException
    *     if the value cannot be written.
-   * @hide Until ready for a public API change
    * @see java.net.StandardSocketOptions
    */
   <T> NetworkChannel setOption(SocketOption<T> option, T value) throws IOException;
 
   /**
    * Returns the set of socket options supported by this channel.
-   *
-   * @hide Until ready for a public API change
    */
   Set<SocketOption<?>> supportedOptions();
 }
diff --git a/luni/src/main/java/java/nio/channels/SeekableByteChannel.java b/luni/src/main/java/java/nio/channels/SeekableByteChannel.java
index f4d6beb..da4671d 100644
--- a/luni/src/main/java/java/nio/channels/SeekableByteChannel.java
+++ b/luni/src/main/java/java/nio/channels/SeekableByteChannel.java
@@ -33,7 +33,6 @@
  * {@link #truncate}, {@link #position} and {@link #write} for details. The current size can also
  * be queried.
  *
- * @hide Until ready for a public API change
  * @since 1.7
  */
 public interface SeekableByteChannel extends ByteChannel {
diff --git a/luni/src/main/java/java/nio/channels/ServerSocketChannel.java b/luni/src/main/java/java/nio/channels/ServerSocketChannel.java
index c720451..790344b 100644
--- a/luni/src/main/java/java/nio/channels/ServerSocketChannel.java
+++ b/luni/src/main/java/java/nio/channels/ServerSocketChannel.java
@@ -89,7 +89,6 @@
      * {@inheritDoc}
      *
      * <p>This is equivalent to {@code bind(local, 0)}.
-     * @hide Until ready for a public API change
      */
     @Override
     public final ServerSocketChannel bind(SocketAddress local) throws IOException {
@@ -115,7 +114,6 @@
      * @throws IOException
      *             if another I/O error occurs.
      * @since 1.7
-     * @hide Until ready for a public API change
      */
     public ServerSocketChannel bind(SocketAddress localAddr, int backlog) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -123,15 +121,13 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
-     @Override
+    @Override
     public SocketAddress getLocalAddress() throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
         // concrete here to avoid breaking existing Android applications that extend this class.
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> T getOption(SocketOption<T> option) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -139,7 +135,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> ServerSocketChannel setOption(SocketOption<T> option, T value) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -147,7 +142,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public Set<SocketOption<?>> supportedOptions() {
         // This method was added for interoperability with Java 7, where it is abstract. It is
diff --git a/luni/src/main/java/java/nio/channels/SocketChannel.java b/luni/src/main/java/java/nio/channels/SocketChannel.java
index a6d1551..e96c6a1 100644
--- a/luni/src/main/java/java/nio/channels/SocketChannel.java
+++ b/luni/src/main/java/java/nio/channels/SocketChannel.java
@@ -142,7 +142,6 @@
      */
     public abstract Socket socket();
 
-    /** @hide Until ready for a public API change */
     @Override
     public SocketChannel bind(SocketAddress local) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -150,7 +149,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public SocketAddress getLocalAddress() throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -158,7 +156,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> T getOption(SocketOption<T> option) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -166,7 +163,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public <T> SocketChannel setOption(SocketOption<T> option, T value) throws IOException {
         // This method was added for interoperability with Java 7, where it is abstract. It is
@@ -174,7 +170,6 @@
         throw new UnsupportedOperationException("Subclasses must override this method");
     }
 
-    /** @hide Until ready for a public API change */
     @Override
     public Set<SocketOption<?>> supportedOptions() {
         // This method was added for interoperability with Java 7, where it is abstract. It is
diff --git a/luni/src/main/java/java/util/Currency.java b/luni/src/main/java/java/util/Currency.java
index e8ecdde..333ebc4 100644
--- a/luni/src/main/java/java/util/Currency.java
+++ b/luni/src/main/java/java/util/Currency.java
@@ -131,7 +131,6 @@
      * zero is returned.
      *
      * @since 1.7
-     * @hide Until ready for an API update
      */
     public int getNumericCode() {
         return ICU.getCurrencyNumericCode(currencyCode);
diff --git a/luni/src/main/java/java/util/IllformedLocaleException.java b/luni/src/main/java/java/util/IllformedLocaleException.java
index db1754e..3dec1cd 100644
--- a/luni/src/main/java/java/util/IllformedLocaleException.java
+++ b/luni/src/main/java/java/util/IllformedLocaleException.java
@@ -21,7 +21,6 @@
  *
  * See {@link Locale} and {@link Locale.Builder}.
  *
- * @hide
  * @since 1.7
  */
 public class IllformedLocaleException extends RuntimeException {
diff --git a/luni/src/main/java/java/util/Locale.java b/luni/src/main/java/java/util/Locale.java
index 163a627..16d7701 100644
--- a/luni/src/main/java/java/util/Locale.java
+++ b/luni/src/main/java/java/util/Locale.java
@@ -253,7 +253,6 @@
      *
      * See {@link #getExtension(char)} and {@link Builder#setExtension(char, String)}.
      *
-     * @hide
      * @since 1.7
      */
     public static final char PRIVATE_USE_EXTENSION = 'x';
@@ -264,7 +263,6 @@
      *
      * See {@link #getExtension(char)} and {@link Builder#setExtension(char, String)}.
      *
-     * @hide
      * @since 1.7
      */
     public static final char UNICODE_LOCALE_EXTENSION = 'u';
@@ -297,7 +295,6 @@
      * the structured state (keywords and attributes) specified therein.
      *
      * @since 1.7
-     * @hide
      */
     public static final class Builder {
         private String language;
@@ -777,7 +774,6 @@
      *
      * @throws NullPointerException if {@code languageTag} is {@code null}.
      *
-     * @hide
      * @since 1.7
      */
     public static Locale forLanguageTag(String languageTag) {
@@ -1184,7 +1180,6 @@
      * If set, the script code will be a title cased string of length 4, as per the ISO 15924
      * specification.
      *
-     * @hide
      * @since 1.7
      */
     public String getScript() {
@@ -1194,7 +1189,6 @@
     /**
      * Equivalent to {@code getDisplayScript(Locale.getDefault()))}
      *
-     * @hide
      * @since 1.7
      */
     public String getDisplayScript() {
@@ -1206,7 +1200,6 @@
      * script code is unknown, the return value of this method is the same as that of
      * {@link #getScript()}.
      *
-     * @hide
      * @since 1.7
      */
     public String getDisplayScript(Locale locale) {
@@ -1243,7 +1236,6 @@
      * For example, we do not require scripts to be a registered ISO 15924 scripts or
      * languages to appear in the ISO-639-2 code list.
      *
-     * @hide
      * @since 1.7
      */
     public String toLanguageTag() {
@@ -1260,7 +1252,6 @@
      * See <a href="https://tools.ietf.org/html/bcp47#section-2.1">
      *     the IETF BCP-47 specification</a> (Section 2.2.6) for details.
      *
-     * @hide
      * @since 1.7
      */
     public Set<Character> getExtensionKeys() {
@@ -1275,7 +1266,6 @@
      * locale extension can be fetched using {@link #getUnicodeLocaleAttributes()},
      * {@link #getUnicodeLocaleKeys()}  and {@link #getUnicodeLocaleType}.
      *
-     * @hide
      * @since 1.7
      */
     public String getExtension(char extensionKey) {
@@ -1288,7 +1278,6 @@
      * For more information about types and keywords, see {@link Builder#setUnicodeLocaleKeyword}
      * and <a href="http://www.unicode.org/reports/tr35/#BCP47">Unicode Technical Standard #35</a>
      *
-     * @hide
      * @since 1.7
      */
     public String getUnicodeLocaleType(String keyWord) {
@@ -1301,7 +1290,6 @@
      * For more information about attributes, see {@link Builder#addUnicodeLocaleAttribute}
      * and <a href="http://www.unicode.org/reports/tr35/#BCP47">Unicode Technical Standard #35</a>
      *
-     * @hide
      * @since 1.7
      */
     public Set<String> getUnicodeLocaleAttributes() {
@@ -1314,7 +1302,6 @@
      * For more information about types and keywords, see {@link Builder#setUnicodeLocaleKeyword}
      * and <a href="http://www.unicode.org/reports/tr35/#BCP47">Unicode Technical Standard #35</a>
      *
-     * @hide
      * @since 1.7
      */
     public Set<String> getUnicodeLocaleKeys() {
diff --git a/luni/src/main/java/java/util/concurrent/ConcurrentLinkedDeque.java b/luni/src/main/java/java/util/concurrent/ConcurrentLinkedDeque.java
index 54b53ae..b38d6a5 100644
--- a/luni/src/main/java/java/util/concurrent/ConcurrentLinkedDeque.java
+++ b/luni/src/main/java/java/util/concurrent/ConcurrentLinkedDeque.java
@@ -56,8 +56,6 @@
  * actions subsequent to the access or removal of that element from
  * the {@code ConcurrentLinkedDeque} in another thread.
  *
- * @hide
- *
  * @since 1.7
  * @author Doug Lea
  * @author Martin Buchholz
diff --git a/luni/src/main/java/java/util/concurrent/ForkJoinPool.java b/luni/src/main/java/java/util/concurrent/ForkJoinPool.java
index 5ac01c8..9448616 100644
--- a/luni/src/main/java/java/util/concurrent/ForkJoinPool.java
+++ b/luni/src/main/java/java/util/concurrent/ForkJoinPool.java
@@ -39,7 +39,7 @@
  * ForkJoinPool}s may also be appropriate for use with event-style
  * tasks that are never joined.
  *
- * <p>A static {@link #commonPool()} is available and appropriate for
+ * <p>A static {@code commonPool()} is available and appropriate for
  * most applications. The common pool is used by any ForkJoinTask that
  * is not explicitly submitted to a specified pool. Using the common
  * pool normally reduces resource usage (its threads are slowly
@@ -127,7 +127,6 @@
  * or internal resources have been exhausted.
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  */
 public class ForkJoinPool extends AbstractExecutorService {
@@ -213,8 +212,7 @@
      * choosing existing queues, and may be randomly repositioned upon
      * contention with other submitters.  In essence, submitters act
      * like workers except that they are restricted to executing local
-     * tasks that they submitted (or in the case of CountedCompleters,
-     * others with the same root task).  However, because most
+     * tasks that they submitted. However, because most
      * shared/external queue operations are more expensive than
      * internal, and because, at steady state, external submitters
      * will compete for CPU with workers, ForkJoinTask.join and
@@ -419,12 +417,6 @@
      * to find work (see MAX_HELP) and fall back to suspending the
      * worker and if necessary replacing it with another.
      *
-     * Helping actions for CountedCompleters are much simpler: Method
-     * helpComplete can take and execute any task with the same root
-     * as the task being waited on. However, this still entails some
-     * traversal of completer chains, so is less efficient than using
-     * CountedCompleters without explicit joins.
-     *
      * It is impossible to keep exactly the target parallelism number
      * of threads running at any given time.  Determining the
      * existence of conservatively safe helping targets, the
@@ -2907,7 +2899,7 @@
      * Possibly initiates an orderly shutdown in which previously
      * submitted tasks are executed, but no new tasks will be
      * accepted. Invocation has no effect on execution state if this
-     * is the {@link #commonPool()}, and no additional effect if
+     * is the {@code commonPool()}, and no additional effect if
      * already shut down.  Tasks that are in the process of being
      * submitted concurrently during the course of this method may or
      * may not be rejected.
@@ -2920,7 +2912,7 @@
     /**
      * Possibly attempts to cancel and/or stop all tasks, and reject
      * all subsequently submitted tasks.  Invocation has no effect on
-     * execution state if this is the {@link #commonPool()}, and no
+     * execution state if this is the {@code commonPool()}, and no
      * additional effect if already shut down. Otherwise, tasks that
      * are in the process of being submitted or executed concurrently
      * during the course of this method may or may not be
@@ -2979,8 +2971,8 @@
     /**
      * Blocks until all tasks have completed execution after a
      * shutdown request, or the timeout occurs, or the current thread
-     * is interrupted, whichever happens first. Because the {@link
-     * #commonPool()} never terminates until program shutdown, when
+     * is interrupted, whichever happens first. Because the {@code
+     * commonPool()} never terminates until program shutdown, when
      * applied to the common pool, this method is equivalent to {@link
      * #awaitQuiescence(long, TimeUnit)} but always returns {@code false}.
      *
@@ -3064,7 +3056,7 @@
 
     /**
      * Waits and/or attempts to assist performing tasks indefinitely
-     * until the {@link #commonPool()} {@link #isQuiescent}.
+     * until the {@code commonPool()} {@link #isQuiescent}.
      */
     static void quiesceCommonPool() {
         common.awaitQuiescence(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
diff --git a/luni/src/main/java/java/util/concurrent/ForkJoinTask.java b/luni/src/main/java/java/util/concurrent/ForkJoinTask.java
index 6d25775..c6bc6de 100644
--- a/luni/src/main/java/java/util/concurrent/ForkJoinTask.java
+++ b/luni/src/main/java/java/util/concurrent/ForkJoinTask.java
@@ -32,8 +32,8 @@
  *
  * <p>A "main" {@code ForkJoinTask} begins execution when it is
  * explicitly submitted to a {@link ForkJoinPool}, or, if not already
- * engaged in a ForkJoin computation, commenced in the {@link
- * ForkJoinPool#commonPool()} via {@link #fork}, {@link #invoke}, or
+ * engaged in a ForkJoin computation, commenced in the {@code
+ * ForkJoinPool.commonPool()} via {@link #fork}, {@link #invoke}, or
  * related methods.  Once started, it will usually in turn start other
  * subtasks.  As indicated by the name of this class, many programs
  * using {@code ForkJoinTask} employ only methods {@link #fork} and
@@ -74,10 +74,9 @@
  * but doing do requires three further considerations: (1) Completion
  * of few if any <em>other</em> tasks should be dependent on a task
  * that blocks on external synchronization or I/O. Event-style async
- * tasks that are never joined (for example, those subclassing {@link
- * CountedCompleter}) often fall into this category.  (2) To minimize
- * resource impact, tasks should be small; ideally performing only the
- * (possibly) blocking action. (3) Unless the {@link
+ * tasks that are never joined often fall into this category.
+ * (2) To minimize resource impact, tasks should be small; ideally
+ * performing only the (possibly) blocking action. (3) Unless the {@link
  * ForkJoinPool.ManagedBlocker} API is used, or the number of possibly
  * blocked tasks is known to be less than the pool's {@link
  * ForkJoinPool#getParallelism} level, the pool cannot guarantee that
@@ -120,13 +119,11 @@
  * <p>The ForkJoinTask class is not usually directly subclassed.
  * Instead, you subclass one of the abstract classes that support a
  * particular style of fork/join processing, typically {@link
- * RecursiveAction} for most computations that do not return results,
- * {@link RecursiveTask} for those that do, and {@link
- * CountedCompleter} for those in which completed actions trigger
- * other actions.  Normally, a concrete ForkJoinTask subclass declares
- * fields comprising its parameters, established in a constructor, and
- * then defines a {@code compute} method that somehow uses the control
- * methods supplied by this base class.
+ * RecursiveAction} for most computations that do not return results
+ * and {@link RecursiveTask} for those that do. Normally, a concrete
+ * ForkJoinTask subclass declares fields comprising its parameters,
+ * established in a constructor, and then defines a {@code compute}
+ * method that somehow uses the control methods supplied by this base class.
  *
  * <p>Method {@link #join} and its variants are appropriate for use
  * only when completion dependencies are acyclic; that is, the
@@ -138,9 +135,9 @@
  * may be of use in constructing custom subclasses for problems that
  * are not statically structured as DAGs. To support such usages, a
  * ForkJoinTask may be atomically <em>tagged</em> with a {@code short}
- * value using {@link #setForkJoinTaskTag} or {@link
- * #compareAndSetForkJoinTaskTag} and checked using {@link
- * #getForkJoinTaskTag}. The ForkJoinTask implementation does not use
+ * value using {@code setForkJoinTaskTag} or {@code
+ * compareAndSetForkJoinTaskTag} and checked using {@code
+ * getForkJoinTaskTag}. The ForkJoinTask implementation does not use
  * these {@code protected} methods or tags for any purpose, but they
  * may be of use in the construction of specialized subclasses.  For
  * example, parallel graph traversals can use the supplied methods to
@@ -178,7 +175,6 @@
  * execution. Serialization is not relied on during execution itself.
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  */
 public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
@@ -645,8 +641,8 @@
 
     /**
      * Arranges to asynchronously execute this task in the pool the
-     * current task is running in, if applicable, or using the {@link
-     * ForkJoinPool#commonPool()} if not {@link #inForkJoinPool}.  While
+     * current task is running in, if applicable, or using the {@code
+     * ForkJoinPool.commonPool()} if not {@link #inForkJoinPool}.  While
      * it is not necessarily enforced, it is a usage error to fork a
      * task more than once unless it has completed and been
      * reinitialized.  Subsequent modifications to the state of this
diff --git a/luni/src/main/java/java/util/concurrent/ForkJoinWorkerThread.java b/luni/src/main/java/java/util/concurrent/ForkJoinWorkerThread.java
index 5f2799b..ae28700 100644
--- a/luni/src/main/java/java/util/concurrent/ForkJoinWorkerThread.java
+++ b/luni/src/main/java/java/util/concurrent/ForkJoinWorkerThread.java
@@ -18,7 +18,6 @@
  * {@linkplain ForkJoinPool#ForkJoinPool use it} in a {@code ForkJoinPool}.
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  */
 public class ForkJoinWorkerThread extends Thread {
diff --git a/luni/src/main/java/java/util/concurrent/LinkedTransferQueue.java b/luni/src/main/java/java/util/concurrent/LinkedTransferQueue.java
index cff5dbf..a041fb1 100644
--- a/luni/src/main/java/java/util/concurrent/LinkedTransferQueue.java
+++ b/luni/src/main/java/java/util/concurrent/LinkedTransferQueue.java
@@ -50,7 +50,6 @@
  * the {@code LinkedTransferQueue} in another thread.
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  * @param <E> the type of elements held in this collection
  */
diff --git a/luni/src/main/java/java/util/concurrent/Phaser.java b/luni/src/main/java/java/util/concurrent/Phaser.java
index a9adbe5..a97d187 100644
--- a/luni/src/main/java/java/util/concurrent/Phaser.java
+++ b/luni/src/main/java/java/util/concurrent/Phaser.java
@@ -227,7 +227,6 @@
  * of participants.
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  */
 public class Phaser {
diff --git a/luni/src/main/java/java/util/concurrent/RecursiveAction.java b/luni/src/main/java/java/util/concurrent/RecursiveAction.java
index 8d666f6..e3a6340 100644
--- a/luni/src/main/java/java/util/concurrent/RecursiveAction.java
+++ b/luni/src/main/java/java/util/concurrent/RecursiveAction.java
@@ -131,7 +131,6 @@
  * }}</pre>
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  */
 public abstract class RecursiveAction extends ForkJoinTask<Void> {
diff --git a/luni/src/main/java/java/util/concurrent/RecursiveTask.java b/luni/src/main/java/java/util/concurrent/RecursiveTask.java
index 421c9d3..80baa52 100644
--- a/luni/src/main/java/java/util/concurrent/RecursiveTask.java
+++ b/luni/src/main/java/java/util/concurrent/RecursiveTask.java
@@ -34,7 +34,6 @@
  * sequentially solve rather than subdividing.
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  */
 public abstract class RecursiveTask<V> extends ForkJoinTask<V> {
diff --git a/luni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java b/luni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
index a52351b..483981d 100644
--- a/luni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
+++ b/luni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
@@ -690,7 +690,6 @@
      * @param value if {@code true}, remove on cancellation, else don't
      * @see #getRemoveOnCancelPolicy
      * @since 1.7
-     * @hide
      */
     public void setRemoveOnCancelPolicy(boolean value) {
         removeOnCancel = value;
@@ -705,7 +704,6 @@
      *         from the queue
      * @see #setRemoveOnCancelPolicy
      * @since 1.7
-     * @hide
      */
     public boolean getRemoveOnCancelPolicy() {
         return removeOnCancel;
diff --git a/luni/src/main/java/java/util/concurrent/ThreadLocalRandom.java b/luni/src/main/java/java/util/concurrent/ThreadLocalRandom.java
index a559321..5baf75f 100644
--- a/luni/src/main/java/java/util/concurrent/ThreadLocalRandom.java
+++ b/luni/src/main/java/java/util/concurrent/ThreadLocalRandom.java
@@ -30,7 +30,6 @@
  * generation methods.
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  */
 public class ThreadLocalRandom extends Random {
diff --git a/luni/src/main/java/java/util/concurrent/TransferQueue.java b/luni/src/main/java/java/util/concurrent/TransferQueue.java
index 9cd5773..4c2be6f 100644
--- a/luni/src/main/java/java/util/concurrent/TransferQueue.java
+++ b/luni/src/main/java/java/util/concurrent/TransferQueue.java
@@ -33,7 +33,6 @@
  * and {@code transfer} are effectively synonymous.
  *
  * @since 1.7
- * @hide
  * @author Doug Lea
  * @param <E> the type of elements held in this collection
  */
diff --git a/luni/src/main/java/java/util/concurrent/atomic/Fences.java b/luni/src/main/java/java/util/concurrent/atomic/Fences.java
index 7ecf45a..5714ba0 100644
--- a/luni/src/main/java/java/util/concurrent/atomic/Fences.java
+++ b/luni/src/main/java/java/util/concurrent/atomic/Fences.java
@@ -453,7 +453,6 @@
  *
  * </dl>
  *
- * @since 1.7
  * @hide
  * @author Doug Lea
  */
diff --git a/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java b/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
index 4c5e280..37aa9d0 100644
--- a/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
+++ b/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
@@ -1255,7 +1255,6 @@
      *         current thread, and {@code false} if the current thread
      *         is at the head of the queue or the queue is empty
      * @since 1.7
-     * @hide
      */
     public final boolean hasQueuedPredecessors() {
         // The correctness of this depends on head being initialized
diff --git a/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java b/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
index 0350060..e711da5 100644
--- a/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
+++ b/luni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
@@ -1485,7 +1485,6 @@
      *         current thread, and {@code false} if the current thread
      *         is at the head of the queue or the queue is empty
      * @since 1.7
-     * @hide
      */
     public final boolean hasQueuedPredecessors() {
         // The correctness of this depends on head being initialized
diff --git a/luni/src/main/java/java/util/jar/JarEntry.java b/luni/src/main/java/java/util/jar/JarEntry.java
index 85c8678..bceef63 100644
--- a/luni/src/main/java/java/util/jar/JarEntry.java
+++ b/luni/src/main/java/java/util/jar/JarEntry.java
@@ -17,16 +17,16 @@
 
 package java.util.jar;
 
-import javax.security.auth.x500.X500Principal;
 import java.io.IOException;
 import java.security.CodeSigner;
 import java.security.cert.CertPath;
+import java.security.cert.CertPathValidator;
 import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
-import java.util.List;
+import java.util.Arrays;
 import java.util.zip.ZipEntry;
 
 /**
@@ -114,8 +114,12 @@
      * entry or {@code null} if none exists. Make sure that the everything is
      * read from the input stream before calling this method, or else the method
      * returns {@code null}.
+     * <p>
+     * This method returns all the signers' unverified chains concatenated
+     * together in one array. To know which certificates were tied to the
+     * private keys that made the signatures on this entry, see
+     * {@link #getCodeSigners()} instead.
      *
-     * @return the certificate for this entry.
      * @see java.security.cert.Certificate
      */
     public Certificate[] getCertificates() {
@@ -126,7 +130,27 @@
         if (jarVerifier == null) {
             return null;
         }
-        return jarVerifier.getCertificates(getName());
+
+        Certificate[][] certChains = jarVerifier.getCertificateChains(getName());
+        if (certChains == null) {
+            return null;
+        }
+
+        // Measure number of certs.
+        int count = 0;
+        for (Certificate[] chain : certChains) {
+            count += chain.length;
+        }
+
+        // Create new array and copy all the certs into it.
+        Certificate[] certs = new Certificate[count];
+        int i = 0;
+        for (Certificate[] chain : certChains) {
+            System.arraycopy(chain, 0, certs, i, chain.length);
+            i += chain.length;
+        }
+
+        return certs;
     }
 
     void setAttributes(Attributes attrib) {
@@ -138,68 +162,60 @@
      * JAR file. If there is no such code signer, it returns {@code null}. Make
      * sure that the everything is read from the input stream before calling
      * this method, or else the method returns {@code null}.
+     * <p>
+     * Only the digital signature on the entry is cryptographically verified.
+     * None of the certificates in the the {@link CertPath} returned from
+     * {@link CodeSigner#getSignerCertPath()} are verified and must be verified
+     * by the caller if needed. See {@link CertPathValidator} for more
+     * information.
      *
-     * @return the code signers for the JAR entry.
+     * @return an array of CodeSigner for this JAR entry.
      * @see CodeSigner
      */
     public CodeSigner[] getCodeSigners() {
+        if (parentJar == null) {
+            return null;
+        }
+
+        JarVerifier jarVerifier = parentJar.verifier;
+        if (jarVerifier == null) {
+            return null;
+        }
+
         if (signers == null) {
-            signers = getCodeSigners(getCertificates());
+            signers = getCodeSigners(jarVerifier.getCertificateChains(getName()));
         }
         if (signers == null) {
             return null;
         }
 
-        CodeSigner[] tmp = new CodeSigner[signers.length];
-        System.arraycopy(signers, 0, tmp, 0, tmp.length);
-        return tmp;
+        return signers.clone();
     }
 
-    private CodeSigner[] getCodeSigners(Certificate[] certs) {
-        if (certs == null) {
+    private CodeSigner[] getCodeSigners(Certificate[][] certChains) {
+        if (certChains == null) {
             return null;
         }
 
-        X500Principal prevIssuer = null;
-        ArrayList<Certificate> list = new ArrayList<Certificate>(certs.length);
-        ArrayList<CodeSigner> asigners = new ArrayList<CodeSigner>();
+        ArrayList<CodeSigner> asigners = new ArrayList<CodeSigner>(certChains.length);
 
-        for (Certificate element : certs) {
-            if (!(element instanceof X509Certificate)) {
-                // Only X509Certificate-s are taken into account - see API spec.
-                continue;
-            }
-            X509Certificate x509 = (X509Certificate) element;
-            if (prevIssuer != null) {
-                X500Principal subj = x509.getSubjectX500Principal();
-                if (!prevIssuer.equals(subj)) {
-                    // Ok, this ends the previous chain,
-                    // so transform this one into CertPath ...
-                    addCodeSigner(asigners, list);
-                    // ... and start a new one
-                    list.clear();
-                }// else { it's still the same chain }
-
-            }
-            prevIssuer = x509.getIssuerX500Principal();
-            list.add(x509);
-        }
-        if (!list.isEmpty()) {
-            addCodeSigner(asigners, list);
-        }
-        if (asigners.isEmpty()) {
-            // 'signers' is 'null' already
-            return null;
+        for (Certificate[] chain : certChains) {
+            addCodeSigner(asigners, chain);
         }
 
         CodeSigner[] tmp = new CodeSigner[asigners.size()];
         asigners.toArray(tmp);
         return tmp;
-
     }
 
-    private void addCodeSigner(ArrayList<CodeSigner> asigners,
-            List<Certificate> list) {
+    private void addCodeSigner(ArrayList<CodeSigner> asigners, Certificate[] certs) {
+        for (Certificate cert : certs) {
+            // Only X509Certificate instances are counted. See API spec.
+            if (!(cert instanceof X509Certificate)) {
+                return;
+            }
+        }
+
         CertPath certPath = null;
         if (!isFactoryChecked) {
             try {
@@ -214,7 +230,7 @@
             return;
         }
         try {
-            certPath = factory.generateCertPath(list);
+            certPath = factory.generateCertPath(Arrays.asList(certs));
         } catch (CertificateException ex) {
             // do nothing
         }
diff --git a/luni/src/main/java/java/util/jar/JarFile.java b/luni/src/main/java/java/util/jar/JarFile.java
index a089019..6b147f6 100644
--- a/luni/src/main/java/java/util/jar/JarFile.java
+++ b/luni/src/main/java/java/util/jar/JarFile.java
@@ -196,16 +196,6 @@
      *             If the file cannot be read.
      */
     public JarFile(File file, boolean verify, int mode) throws IOException {
-        this(file, verify, mode, false);
-    }
-
-    /**
-     * See previous constructor for other parameter definitions.
-     * @param chainCheck
-     *            whether or not to check certificate chain signatures
-     * @hide
-     */
-    public JarFile(File file, boolean verify, int mode, boolean chainCheck) throws IOException {
         super(file, mode);
 
         // Step 1: Scan the central directory for meta entries (MANIFEST.mf
@@ -225,7 +215,7 @@
             // We create the manifest straight away, so that we can create
             // the jar verifier as well.
             manifest = new Manifest(metaEntries.get(MANIFEST_NAME), true);
-            verifier = new JarVerifier(getName(), manifest, metaEntries, chainCheck);
+            verifier = new JarVerifier(getName(), manifest, metaEntries);
         } else {
             verifier = null;
             manifestBytes = metaEntries.get(MANIFEST_NAME);
@@ -257,17 +247,7 @@
      *             If file cannot be opened or read.
      */
     public JarFile(String filename, boolean verify) throws IOException {
-        this(filename, verify, false);
-    }
-
-    /**
-     * See previous constructor for other parameter definitions.
-     * @param chainCheck
-     *            whether or not to check certificate chain signatures
-     * @hide
-     */
-    public JarFile(String filename, boolean verify, boolean chainCheck) throws IOException {
-        this(new File(filename), verify, ZipFile.OPEN_READ, chainCheck);
+        this(new File(filename), verify, ZipFile.OPEN_READ);
     }
 
     /**
diff --git a/luni/src/main/java/java/util/jar/JarVerifier.java b/luni/src/main/java/java/util/jar/JarVerifier.java
index f78cbe8..467e298 100644
--- a/luni/src/main/java/java/util/jar/JarVerifier.java
+++ b/luni/src/main/java/java/util/jar/JarVerifier.java
@@ -27,7 +27,6 @@
 import java.security.NoSuchAlgorithmException;
 import java.security.cert.Certificate;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
@@ -72,11 +71,8 @@
     private final Hashtable<String, Certificate[]> certificates =
             new Hashtable<String, Certificate[]>(5);
 
-    private final Hashtable<String, Certificate[]> verifiedEntries =
-            new Hashtable<String, Certificate[]>();
-
-    /** Whether or not to check certificate chain signatures. */
-    private final boolean chainCheck;
+    private final Hashtable<String, Certificate[][]> verifiedEntries =
+            new Hashtable<String, Certificate[][]>();
 
     /**
      * Stores and a hash and a message digest and verifies that massage digest
@@ -90,16 +86,16 @@
 
         private final byte[] hash;
 
-        private final Certificate[] certificates;
+        private final Certificate[][] certChains;
 
-        private final Hashtable<String, Certificate[]> verifiedEntries;
+        private final Hashtable<String, Certificate[][]> verifiedEntries;
 
         VerifierEntry(String name, MessageDigest digest, byte[] hash,
-                Certificate[] certificates, Hashtable<String, Certificate[]> verifedEntries) {
+                Certificate[][] certChains, Hashtable<String, Certificate[][]> verifedEntries) {
             this.name = name;
             this.digest = digest;
             this.hash = hash;
-            this.certificates = certificates;
+            this.certChains = certChains;
             this.verifiedEntries = verifedEntries;
         }
 
@@ -135,7 +131,7 @@
             if (!MessageDigest.isEqual(d, Base64.decode(hash))) {
                 throw invalidDigest(JarFile.MANIFEST_NAME, name, name);
             }
-            verifiedEntries.put(name, certificates);
+            verifiedEntries.put(name, certChains);
         }
     }
 
@@ -150,27 +146,16 @@
     }
 
     /**
-     * Convenience constructor for backward compatibility.
-     */
-    JarVerifier(String name, Manifest manifest, HashMap<String, byte[]> metaEntries) {
-        this(name, manifest, metaEntries, false);
-    }
-
-    /**
      * Constructs and returns a new instance of {@code JarVerifier}.
      *
      * @param name
      *            the name of the JAR file being verified.
-     * @param chainCheck
-     *            whether to check the certificate chain signatures
      */
-    JarVerifier(String name, Manifest manifest, HashMap<String, byte[]> metaEntries,
-            boolean chainCheck) {
+    JarVerifier(String name, Manifest manifest, HashMap<String, byte[]> metaEntries) {
         jarName = name;
         this.manifest = manifest;
         this.metaEntries = metaEntries;
         this.mainAttributesEnd = manifest.getMainAttributesEnd();
-        this.chainCheck = chainCheck;
     }
 
     /**
@@ -199,7 +184,7 @@
             return null;
         }
 
-        ArrayList<Certificate> certs = new ArrayList<Certificate>();
+        ArrayList<Certificate[]> certChains = new ArrayList<Certificate[]>();
         Iterator<Map.Entry<String, HashMap<String, Attributes>>> it = signatures.entrySet().iterator();
         while (it.hasNext()) {
             Map.Entry<String, HashMap<String, Attributes>> entry = it.next();
@@ -209,16 +194,16 @@
                 String signatureFile = entry.getKey();
                 Certificate[] certChain = certificates.get(signatureFile);
                 if (certChain != null) {
-                    Collections.addAll(certs, certChain);
+                    certChains.add(certChain);
                 }
             }
         }
 
         // entry is not signed
-        if (certs.isEmpty()) {
+        if (certChains.isEmpty()) {
             return null;
         }
-        Certificate[] certificatesArray = certs.toArray(new Certificate[certs.size()]);
+        Certificate[][] certChainsArray = certChains.toArray(new Certificate[certChains.size()][]);
 
         for (int i = 0; i < DIGEST_ALGORITHMS.length; i++) {
             final String algorithm = DIGEST_ALGORITHMS[i];
@@ -230,9 +215,8 @@
 
             try {
                 return new VerifierEntry(name, MessageDigest.getInstance(algorithm), hashBytes,
-                        certificatesArray, verifiedEntries);
-            } catch (NoSuchAlgorithmException e) {
-                // ignored
+                        certChainsArray, verifiedEntries);
+            } catch (NoSuchAlgorithmException ignored) {
             }
         }
         return null;
@@ -309,15 +293,7 @@
         try {
             Certificate[] signerCertChain = JarUtils.verifySignature(
                     new ByteArrayInputStream(sfBytes),
-                    new ByteArrayInputStream(sBlockBytes),
-                    chainCheck);
-            /*
-             * Recursive call in loading security provider related class which
-             * is in a signed JAR.
-             */
-            if (metaEntries == null) {
-                return;
-            }
+                    new ByteArrayInputStream(sBlockBytes));
             if (signerCertChain != null) {
                 certificates.put(signatureFile, signerCertChain);
             }
@@ -418,20 +394,16 @@
     }
 
     /**
-     * Returns all of the {@link java.security.cert.Certificate} instances that
+     * Returns all of the {@link java.security.cert.Certificate} chains that
      * were used to verify the signature on the JAR entry called
-     * {@code name}.
+     * {@code name}. Callers must not modify the returned arrays.
      *
      * @param name
      *            the name of a JAR entry.
-     * @return an array of {@link java.security.cert.Certificate}.
+     * @return an array of {@link java.security.cert.Certificate} chains.
      */
-    Certificate[] getCertificates(String name) {
-        Certificate[] verifiedCerts = verifiedEntries.get(name);
-        if (verifiedCerts == null) {
-            return null;
-        }
-        return verifiedCerts.clone();
+    Certificate[][] getCertificateChains(String name) {
+        return verifiedEntries.get(name);
     }
 
     /**
diff --git a/luni/src/main/java/java/util/jar/StrictJarFile.java b/luni/src/main/java/java/util/jar/StrictJarFile.java
index 80b4fe9..4a8af5f 100644
--- a/luni/src/main/java/java/util/jar/StrictJarFile.java
+++ b/luni/src/main/java/java/util/jar/StrictJarFile.java
@@ -63,7 +63,7 @@
             // or manifests, so it's best to throw as early as possible.
             HashMap<String, byte[]> metaEntries = getMetaEntries();
             this.manifest = new Manifest(metaEntries.get(JarFile.MANIFEST_NAME), true);
-            this.verifier = new JarVerifier(fileName, manifest, metaEntries, true);
+            this.verifier = new JarVerifier(fileName, manifest, metaEntries);
 
             isSigned = verifier.readCertificates() && verifier.isSignedJar();
         } catch (IOException ioe) {
@@ -87,16 +87,51 @@
     }
 
     /**
-     * Return all certificates for a given {@link ZipEntry} belonging to this jar.
+     * Return all certificate chains for a given {@link ZipEntry} belonging to this jar.
      * This method MUST be called only after fully exhausting the InputStream belonging
      * to this entry.
      *
      * Returns {@code null} if this jar file isn't signed or if this method is
      * called before the stream is processed.
      */
+    public Certificate[][] getCertificateChains(ZipEntry ze) {
+        if (isSigned) {
+            return verifier.getCertificateChains(ze.getName());
+        }
+
+        return null;
+    }
+
+    /**
+     * Return all certificates for a given {@link ZipEntry} belonging to this jar.
+     * This method MUST be called only after fully exhausting the InputStream belonging
+     * to this entry.
+     *
+     * Returns {@code null} if this jar file isn't signed or if this method is
+     * called before the stream is processed.
+     *
+     * @deprecated Switch callers to use getCertificateChains instead
+     */
+    @Deprecated
     public Certificate[] getCertificates(ZipEntry ze) {
         if (isSigned) {
-            return verifier.getCertificates(ze.getName());
+            Certificate[][] certChains = verifier.getCertificateChains(ze.getName());
+
+            // Measure number of certs.
+            int count = 0;
+            for (Certificate[] chain : certChains) {
+                count += chain.length;
+            }
+
+            // Create new array and copy all the certs into it.
+            Certificate[] certs = new Certificate[count];
+            int i = 0;
+            for (Certificate[] chain : certChains) {
+                System.arraycopy(chain, 0, certs, i, chain.length);
+                i += chain.length;
+            }
+
+            return certs;
         }
 
         return null;
diff --git a/luni/src/main/java/java/util/zip/ZipFile.java b/luni/src/main/java/java/util/zip/ZipFile.java
index 43e8567..877e9ee 100644
--- a/luni/src/main/java/java/util/zip/ZipFile.java
+++ b/luni/src/main/java/java/util/zip/ZipFile.java
@@ -132,7 +132,6 @@
      * @throws ZipException if a zip error occurs.
      * @throws IOException if an {@code IOException} occurs.
      * @since 1.7
-     * @hide Until ready for an API update
      */
     public ZipFile(File file, Charset charset) throws ZipException, IOException {
         this(file, OPEN_READ, charset);
@@ -179,7 +178,6 @@
      *
      * @throws IOException if an {@code IOException} occurs.
      * @since 1.7
-     * @hide Until ready for an API update
      */
     public ZipFile(File file, int mode, Charset charset) throws IOException {
         filename = file.getPath();
diff --git a/luni/src/main/java/java/util/zip/ZipInputStream.java b/luni/src/main/java/java/util/zip/ZipInputStream.java
index 5a73619..402cd33 100644
--- a/luni/src/main/java/java/util/zip/ZipInputStream.java
+++ b/luni/src/main/java/java/util/zip/ZipInputStream.java
@@ -108,7 +108,6 @@
      * by the zip file then {@code charset} is used to decode them.
      *
      * @since 1.7
-     * @hide Until ready for an API update
      */
     public ZipInputStream(InputStream stream, Charset charset) {
         super(new PushbackInputStream(stream, BUF_SIZE), new Inflater(true));
diff --git a/luni/src/main/java/java/util/zip/ZipOutputStream.java b/luni/src/main/java/java/util/zip/ZipOutputStream.java
index ac6bdf2..77b00c9 100644
--- a/luni/src/main/java/java/util/zip/ZipOutputStream.java
+++ b/luni/src/main/java/java/util/zip/ZipOutputStream.java
@@ -114,7 +114,6 @@
      * comments.
      *
      * @since 1.7
-     * @hide Until ready for an API update
      */
     public ZipOutputStream(OutputStream os, Charset charset) {
         super(os, new Deflater(Deflater.DEFAULT_COMPRESSION, true));
diff --git a/luni/src/main/java/javax/net/ssl/SSLEngine.java b/luni/src/main/java/javax/net/ssl/SSLEngine.java
index 418dfa7..d1168d7 100644
--- a/luni/src/main/java/javax/net/ssl/SSLEngine.java
+++ b/luni/src/main/java/javax/net/ssl/SSLEngine.java
@@ -448,7 +448,6 @@
      *
      * @return the SSL session for this engine instance.
      * @since 1.7
-     * @hide
      */
     public SSLSession getHandshakeSession() {
         throw new UnsupportedOperationException();
diff --git a/luni/src/main/java/javax/net/ssl/SSLParameters.java b/luni/src/main/java/javax/net/ssl/SSLParameters.java
index b8fdc38..93e766f 100644
--- a/luni/src/main/java/javax/net/ssl/SSLParameters.java
+++ b/luni/src/main/java/javax/net/ssl/SSLParameters.java
@@ -146,7 +146,6 @@
      *
      * @see #setEndpointIdentificationAlgorithm(String)
      * @since 1.7
-     * @hide
      */
     public String getEndpointIdentificationAlgorithm() {
         return endpointIdentificationAlgorithm;
@@ -158,7 +157,6 @@
      *
      * @see #getEndpointIdentificationAlgorithm()
      * @since 1.7
-     * @hide
      */
     public void setEndpointIdentificationAlgorithm(String endpointIdentificationAlgorithm) {
         this.endpointIdentificationAlgorithm = endpointIdentificationAlgorithm;
diff --git a/luni/src/main/java/javax/net/ssl/SSLSocket.java b/luni/src/main/java/javax/net/ssl/SSLSocket.java
index 820b884..03655c6 100644
--- a/luni/src/main/java/javax/net/ssl/SSLSocket.java
+++ b/luni/src/main/java/javax/net/ssl/SSLSocket.java
@@ -865,7 +865,6 @@
      *
      * @return the session object.
      * @since 1.7
-     * @hide
      */
     public SSLSession getHandshakeSession() {
         throw new UnsupportedOperationException();
diff --git a/luni/src/main/java/javax/net/ssl/X509ExtendedTrustManager.java b/luni/src/main/java/javax/net/ssl/X509ExtendedTrustManager.java
index 8b398ce..2af1c11 100644
--- a/luni/src/main/java/javax/net/ssl/X509ExtendedTrustManager.java
+++ b/luni/src/main/java/javax/net/ssl/X509ExtendedTrustManager.java
@@ -27,7 +27,6 @@
  *
  * @see SSLParameters#setEndpointIdentificationAlgorithm(String)
  * @since 1.7
- * @hide
  */
 public abstract class X509ExtendedTrustManager implements X509TrustManager {
     /**
diff --git a/luni/src/main/java/libcore/net/url/FileURLConnection.java b/luni/src/main/java/libcore/net/url/FileURLConnection.java
index 94fe1d6..a6a575e 100644
--- a/luni/src/main/java/libcore/net/url/FileURLConnection.java
+++ b/luni/src/main/java/libcore/net/url/FileURLConnection.java
@@ -228,7 +228,6 @@
      *
      * @return the length of the file
      * @since 1.7
-     * @hide Until ready for a public API change
      */
     @Override
     public long getContentLengthLong() {
diff --git a/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java b/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
index e00bcab..231b078 100644
--- a/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
+++ b/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
@@ -273,8 +273,6 @@
      * Returns the content length of the resource. Test cases reveal that if the URL is referring to
      * a Jar file, this method answers a content-length returned by URLConnection. For a jar entry
      * it should return the entry's size. Otherwise, it will return -1.
-     *
-     * @hide Until ready for a public API change
      */
     @Override
     public long getContentLengthLong() {
diff --git a/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java b/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
index b9056353..d11c8dd 100644
--- a/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
+++ b/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
@@ -54,27 +54,18 @@
         new int[] {1, 2, 840, 113549, 1, 9, 4};
 
     /**
-     * @see #verifySignature(InputStream, InputStream, boolean)
-     */
-    public static Certificate[] verifySignature(InputStream signature, InputStream signatureBlock)
-            throws IOException, GeneralSecurityException {
-        return verifySignature(signature, signatureBlock, false);
-    }
-
-    /**
      * This method handle all the work with  PKCS7, ASN1 encoding, signature verifying,
      * and certification path building.
      * See also PKCS #7: Cryptographic Message Syntax Standard:
      * http://www.ietf.org/rfc/rfc2315.txt
      * @param signature - the input stream of signature file to be verified
      * @param signatureBlock - the input stream of corresponding signature block file
-     * @param chainCheck - whether to validate certificate chain signatures
      * @return array of certificates used to verify the signature file
      * @throws IOException - if some errors occurs during reading from the stream
      * @throws GeneralSecurityException - if signature verification process fails
      */
     public static Certificate[] verifySignature(InputStream signature, InputStream
-            signatureBlock, boolean chainCheck) throws IOException, GeneralSecurityException {
+            signatureBlock) throws IOException, GeneralSecurityException {
 
         BerInputStream bis = new BerInputStream(signatureBlock);
         ContentInfo info = (ContentInfo)ContentInfo.ASN1.decode(bis);
@@ -232,11 +223,11 @@
             throw new SecurityException("Incorrect signature");
         }
 
-        return createChain(certs[issuerSertIndex], certs, chainCheck);
+        return createChain(certs[issuerSertIndex], certs);
     }
 
     private static X509Certificate[] createChain(X509Certificate signer,
-            X509Certificate[] candidates, boolean chainCheck) {
+            X509Certificate[] candidates) {
         Principal issuer = signer.getIssuerDN();
 
         // Signer is self-signed
@@ -248,11 +239,10 @@
         chain.add(0, signer);
 
         X509Certificate issuerCert;
-        X509Certificate subjectCert = signer;
         int count = 1;
         while (true) {
-            issuerCert = findCert(issuer, candidates, subjectCert, chainCheck);
-            if( issuerCert == null) {
+            issuerCert = findCert(issuer, candidates);
+            if (issuerCert == null) {
                 break;
             }
             chain.add(issuerCert);
@@ -261,22 +251,13 @@
             if (issuerCert.getSubjectDN().equals(issuer)) {
                 break;
             }
-            subjectCert = issuerCert;
         }
         return chain.toArray(new X509Certificate[count]);
     }
 
-    private static X509Certificate findCert(Principal issuer, X509Certificate[] candidates,
-            X509Certificate subjectCert, boolean chainCheck) {
+    private static X509Certificate findCert(Principal issuer, X509Certificate[] candidates) {
         for (int i = 0; i < candidates.length; i++) {
             if (issuer.equals(candidates[i].getSubjectDN())) {
-                if (chainCheck) {
-                    try {
-                        subjectCert.verify(candidates[i].getPublicKey());
-                    } catch (Exception e) {
-                        continue;
-                    }
-                }
                 return candidates[i];
             }
         }
diff --git a/luni/src/test/java/com/android/org/bouncycastle/jce/provider/CertBlacklistTest.java b/luni/src/test/java/com/android/org/bouncycastle/jce/provider/CertBlacklistTest.java
index 6d033d3..1475a63 100644
--- a/luni/src/test/java/com/android/org/bouncycastle/jce/provider/CertBlacklistTest.java
+++ b/luni/src/test/java/com/android/org/bouncycastle/jce/provider/CertBlacklistTest.java
@@ -109,6 +109,24 @@
                     "3xQAyMuOHm72exJljYFqIsiNvGE0KufCqCuH1PD97IXMrLlwGmKKg5jP349lySBpJjm6RDqCTT+6" +
                     "dUl2jkVbeNmco99Y7AOdtLsOdXBMCo5x8lK8zwQWFrzEms0joHXCpWfGWA==";
 
+    public static final String ANSSI = "" +
+                    "MIIDbDCCAlSgAwIBAgIDAx2nMA0GCSqGSIb3DQEBBQUAMEsxCzAJBgNVBAYTAkZSMQ4wDAYDVQQK" +
+                    "EwVER1RQRTEsMCoGA1UEAxMjQUMgREdUUEUgU2lnbmF0dXJlIEF1dGhlbnRpZmljYXRpb24wHhcN" +
+                    "MTMwNzE4MTAwNTI4WhcNMTQwNzE4MTAwNTI4WjA+MQswCQYDVQQGEwJGUjETMBEGA1UECgwKREcg" +
+                    "VHLDqXNvcjEaMBgGA1UEAwwRQUMgREcgVHLDqXNvciBTU0wwggEiMA0GCSqGSIb3DQEBAQUAA4IB" +
+                    "DwAwggEKAoIBAQDI0WFSUyY+MmtFkqFjTefoFyDgh9b1C/2YvSIvT8oCH62JWT5rpeTCZwaXbqWc" +
+                    "jaNfzggqaFsokqfhBif43HNHNtNJmvKE32VcuLB0SpsLR/1VeTd9F99C1JeHVa+nelumOHEfouX8" +
+                    "rRFrxNXNIYTVeiENT8Y2YqRb/XAril9g7i674uFzLiNR/t/N/F8Exujv9U8m8rmgud/+tG9WDRaD" +
+                    "Jwoj3ZFCOnL5qLnSUEcS6TzWpozLmC2JVO5GZKGGd7qC9FjdBkVilkbVIEGSrYvz2Uz2v5IGqMBI" +
+                    "QaFL/kSYWxGTaedTOk2drFEApp9AEPTfv1NwCWBfegsGQrHUROM3AgMBAAGjZjBkMBIGA1UdEwEB" +
+                    "/wQIMAYBAf8CAQQwHQYDVR0OBBYEFAAMW8lJqJW0DtAv5p3Mjogxvh9lMB8GA1UdIwQYMBaAFOnb" +
+                    "kI/9W5nkFTvwYlyn5A1Y6IeZMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAtDfG" +
+                    "HkHOLW2d9fiMtwtkEwDauISJLJyCjoRmawzmQbIZXq7HaLliVfE0sdfKUm0iQ0im1/CpnJLPoTeK" +
+                    "yBHvNu1ubLc2m+9dabAYhF3pVdKC+gNaAzBXZ9Gt0p1CLk1lf8Hg+R10HN2IPCv7V/crz2Ga+c23" +
+                    "4P3pfwYW8+Nd7alGCuvqot6UYXOlheF7zWUkHn6z6tvY+9oMDHKSUAthhA/FB50JgJU89zyTv1eg" +
+                    "Y3ldKwvYBW3W3yNZdTHbPyNsPJdhqA55mDNsteE5YTp1PyySDb1MSVrbxDEruoH6ZE99Hob4Ih8A" +
+                    "mn7MHZatGClECgjXWFZ2Gxa7OUCaQpcH8g==";
+
     public CertBlacklistTest() throws IOException {
         tmpFile = File.createTempFile("test", "");
         DEFAULT_PUBKEYS = getDefaultPubkeys();
@@ -415,6 +433,20 @@
         assertEquals(bl.isPublicKeyBlackListed(pk), true);
     }
 
+    public void testANSSISerialBlacklist() throws Exception {
+        CertBlacklist bl = new CertBlacklist();
+        assertEquals(bl.isSerialNumberBlackListed(createSerialNumber(ANSSI)), true);
+    }
+
+    public void testANSSIIntermediatePubkeyBlacklist() throws Exception {
+        // build the public key
+        PublicKey pk = createPublicKey(ANSSI);
+        // set our blacklist path
+        CertBlacklist bl = new CertBlacklist();
+        // check to make sure it isn't blacklisted
+        assertEquals(bl.isPublicKeyBlackListed(pk), true);
+    }
+
     private static void printHash(String cert) throws Exception {
         System.out.println("CERTIFICATE PUBLIC KEY HASH: " + getHash(createPublicKey(cert)));
     }
diff --git a/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java b/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
index 3a5608c..38a0f95 100644
--- a/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
+++ b/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
@@ -17,7 +17,6 @@
 
 package libcore.java.net;
 
-import dalvik.annotation.SideEffect;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -207,7 +206,7 @@
         }
     }
 
-    @SideEffect("Support_TestWebServer requires isolation.")
+    // SideEffect: Support_TestWebServer requires isolation.
     public void test_findResourceLjava_lang_String() throws Exception {
         File tmp = File.createTempFile("test", ".txt");
 
@@ -232,7 +231,7 @@
     /**
      * Regression for Harmony-2237
      */
-    @SideEffect("Support_TestWebServer requires isolation.")
+    // SideEffect: Support_TestWebServer requires isolation.
     public void test_findResource_String() throws Exception {
         File tempFile1 = File.createTempFile("textFile", ".txt");
         tempFile1.createNewFile();
diff --git a/luni/src/test/java/libcore/java/nio/channels/OldSocketChannelTest.java b/luni/src/test/java/libcore/java/nio/channels/OldSocketChannelTest.java
index 0d0c69f..f849c33 100644
--- a/luni/src/test/java/libcore/java/nio/channels/OldSocketChannelTest.java
+++ b/luni/src/test/java/libcore/java/nio/channels/OldSocketChannelTest.java
@@ -17,7 +17,6 @@
 
 package libcore.java.nio.channels;
 
-import dalvik.annotation.BrokenTest;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
@@ -235,7 +234,7 @@
         return connected;
     }
 
-    @BrokenTest("Occasionally fail in CTS, but works in CoreTestRunner")
+    // Broken Test: Occasionally fail in CTS, but works in CoreTestRunner
     public void test_writeLjava_nio_ByteBuffer_Nonblocking_HugeData() throws IOException {
         // initialize write content
         ByteBuffer writeContent = ByteBuffer.allocate(CAPACITY_HUGE);
diff --git a/luni/src/test/java/libcore/java/security/OldDHTest.java b/luni/src/test/java/libcore/java/security/OldDHTest.java
index 421d153..58d96ed 100644
--- a/luni/src/test/java/libcore/java/security/OldDHTest.java
+++ b/luni/src/test/java/libcore/java/security/OldDHTest.java
@@ -15,7 +15,6 @@
  */
 package libcore.java.security;
 
-import dalvik.annotation.BrokenTest;
 import java.security.AlgorithmParameterGenerator;
 import java.security.AlgorithmParameters;
 import java.security.KeyPair;
@@ -27,7 +26,7 @@
 
 public class OldDHTest extends TestCase {
 
-    @BrokenTest("Suffers from DH slowness, disabling for now")
+    // BrokenTest Suffers from DH slowness, disabling for now
     public void testDHGen() throws Exception {
         KeyPairGenerator gen = null;
         try {
diff --git a/luni/src/test/java/libcore/java/security/OldKeyPairGeneratorTestDH.java b/luni/src/test/java/libcore/java/security/OldKeyPairGeneratorTestDH.java
index f39705b..9be282d 100644
--- a/luni/src/test/java/libcore/java/security/OldKeyPairGeneratorTestDH.java
+++ b/luni/src/test/java/libcore/java/security/OldKeyPairGeneratorTestDH.java
@@ -15,7 +15,6 @@
  */
 package libcore.java.security;
 
-import dalvik.annotation.BrokenTest;
 import java.security.KeyPair;
 import java.security.KeyPairGenerator;
 import java.security.NoSuchAlgorithmException;
@@ -24,7 +23,7 @@
 
 public class OldKeyPairGeneratorTestDH extends TestCase {
 
-    @BrokenTest("Takes ages due to DH computations. Disabling for now.")
+    // Broken Test: Takes ages due to DH computations. Disabling for now.
     public void testKeyPairGenerator() throws NoSuchAlgorithmException {
         KeyPairGenerator generator = KeyPairGenerator.getInstance("DH");
 
diff --git a/luni/src/test/java/libcore/java/security/cert/OldPKIXParametersTest.java b/luni/src/test/java/libcore/java/security/cert/OldPKIXParametersTest.java
index d69e0e2..0832dae 100644
--- a/luni/src/test/java/libcore/java/security/cert/OldPKIXParametersTest.java
+++ b/luni/src/test/java/libcore/java/security/cert/OldPKIXParametersTest.java
@@ -22,7 +22,6 @@
 
 package libcore.java.security.cert;
 
-import dalvik.annotation.BrokenTest;
 import java.io.ByteArrayInputStream;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
@@ -176,7 +175,7 @@
      * @throws InvalidAlgorithmParameterException
      * @throws KeyStoreException
      */
-    @BrokenTest("Fails in CTS environment, but passes in CoreTestRunner")
+    // Broken Test: Fails in CTS environment, but passes in CoreTestRunner
     public final void testPKIXParametersKeyStore04() throws Exception {
 
 
diff --git a/luni/src/test/java/libcore/java/text/OldNumberFormatTest.java b/luni/src/test/java/libcore/java/text/OldNumberFormatTest.java
index 356d0a9..d281a91 100644
--- a/luni/src/test/java/libcore/java/text/OldNumberFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/OldNumberFormatTest.java
@@ -16,7 +16,6 @@
  */
 package libcore.java.text;
 
-import dalvik.annotation.BrokenTest;
 import java.text.ChoiceFormat;
 import java.text.DecimalFormat;
 import java.text.FieldPosition;
@@ -733,7 +732,7 @@
                 + " instead of Integer.MIN_VALUE", result == 0);
     }
 
-    @BrokenTest("Fails in CTS, passes in CoreTestRunner")
+    // Broken Test: Fails in CTS, passes in CoreTestRunner
     public void test_parseLjava_lang_String() {
         NumberFormat nf1 = NumberFormat.getInstance();
         try {
diff --git a/luni/src/test/java/libcore/java/util/jar/StrictJarFileTest.java b/luni/src/test/java/libcore/java/util/jar/StrictJarFileTest.java
index 0b194f5..e5a6cd8 100644
--- a/luni/src/test/java/libcore/java/util/jar/StrictJarFileTest.java
+++ b/luni/src/test/java/libcore/java/util/jar/StrictJarFileTest.java
@@ -122,6 +122,7 @@
             jarFile.getInputStream(zipEntry).skip(Long.MAX_VALUE);
             if ("Test.class".equals(zipEntry.getName())) {
                 assertNotNull(jarFile.getCertificates(zipEntry));
+                assertNotNull(jarFile.getCertificateChains(zipEntry));
             }
         }
     }
diff --git a/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java b/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java
index 578ee6b..e64fb9e 100644
--- a/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java
+++ b/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java
@@ -26,7 +26,7 @@
         super("DH", new AlgorithmParameterKeyAgreementHelper("DH"));
     }
 
-    @BrokenTest("Suffers from DH slowness, disabling for now")
+    // Broken Test: Suffers from DH slowness, disabling for now
     public void testAlgorithmParameterGenerator() {
         super.testAlgorithmParameterGenerator();
     }
diff --git a/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java b/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java
index 165daa1..897e62b 100644
--- a/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java
+++ b/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java
@@ -15,7 +15,6 @@
  */
 package libcore.javax.crypto.spec;
 
-import dalvik.annotation.BrokenTest;
 import java.math.BigInteger;
 import javax.crypto.spec.DHParameterSpec;
 import tests.security.AlgorithmParameterKeyAgreementHelper;
@@ -61,7 +60,7 @@
 
     }
 
-    @BrokenTest("Suffers from DH slowness, disabling for now")
+    // Broken Test: Suffers from DH slowness, disabling for now
     public void testAlgorithmParameters() {
         super.testAlgorithmParameters();
     }
diff --git a/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java b/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java
index c4322ff..8e500e1 100644
--- a/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java
+++ b/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java
@@ -15,7 +15,6 @@
  */
 package libcore.javax.crypto.spec;
 
-import dalvik.annotation.BrokenTest;
 import java.security.NoSuchAlgorithmException;
 import tests.security.KeyAgreementHelper;
 import tests.security.KeyPairGeneratorTest;
@@ -26,7 +25,7 @@
         super("DH", new KeyAgreementHelper("DH"));
     }
 
-    @BrokenTest("Takes ages due to DH computations. Disabling for now.")
+    // Broken Test: Takes ages due to DH computations. Disabling for now.
     public void testKeyPairGenerator() throws NoSuchAlgorithmException {
         super.testKeyPairGenerator();
     }
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java
index f617adb..87b2913 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java
@@ -17,8 +17,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.SideEffect;
-
 import java.math.BigInteger;
 import java.security.AlgorithmParameters;
 import java.security.InvalidAlgorithmParameterException;
@@ -186,7 +184,7 @@
         }
     }
 
-    @SideEffect("Causes OutOfMemoryError to test finalization")
+    // Side Effect: Causes OutOfMemoryError to test finalization
     public void test_finalize () {
         Mock_ExemptionMechanism mem = new Mock_ExemptionMechanism(null, null, "Name");
         assertNotNull(mem);
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
index 5d8c621..290ae9a 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
@@ -17,8 +17,6 @@
 
 package org.apache.harmony.luni.tests.internal.net.www.protocol.http;
 
-import dalvik.annotation.SideEffect;
-
 import java.io.IOException;
 import java.net.Authenticator;
 import java.net.HttpURLConnection;
@@ -270,7 +268,7 @@
             ProxySelector.setDefault(defPS);
         }
     }
-    @SideEffect("Suffers from side effect of other, currently unknown test")
+    // SideEffect: Suffers from side effect of other, currently unknown test
     public void testProxyAuthorization() throws Exception {
         // Set up test Authenticator
         Authenticator.setDefault(new Authenticator() {
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerFactoryTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerFactoryTest.java
index 74b2276..f3d5518 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerFactoryTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerFactoryTest.java
@@ -1,7 +1,5 @@
 package org.apache.harmony.luni.tests.java.net;
 
-import dalvik.annotation.SideEffect;
-
 import junit.framework.TestCase;
 
 import tests.support.Support_Configuration;
@@ -24,9 +22,9 @@
     boolean isGetContentCalled = false;
     boolean isCreateContentHandlerCalled = false;
 
-    @SideEffect("This test affects tests that are run after this one." +
-            " The reason are side effects due to caching in URLConnection." +
-            " Maybe this test needs to be run in isolation.")
+    // SideEffect: This test affects tests that are run after this one.
+    // The reason are side effects due to caching in URLConnection.
+    // Maybe this test needs to be run in isolation.
     public void test_createContentHandler() throws IOException {
 
         TestContentHandlerFactory factory =  new TestContentHandlerFactory();
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
index e2a3a47..d3da174 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
@@ -16,7 +16,6 @@
 
 package org.apache.harmony.luni.tests.java.net;
 
-import dalvik.annotation.BrokenTest;
 import junit.framework.TestCase;
 import tests.support.Support_Configuration;
 import tests.support.Support_TestWebData;
@@ -442,7 +441,7 @@
      * @throws IOException
      * {@link java.net.URLConnection#getContentEncoding()}
      */
-    @BrokenTest("Fails in CTS, passes in CoreTestRunner")
+    // broken test - Fails in CTS, passes in CoreTestRunner
     public void test_getContentEncoding() throws IOException {
         // faulty setup
         try {
diff --git a/support/src/test/java/tests/resources/hyts_signed_ambiguousSignerArray.jar b/support/src/test/java/tests/resources/hyts_signed_ambiguousSignerArray.jar
new file mode 100644
index 0000000..7da4b59
--- /dev/null
+++ b/support/src/test/java/tests/resources/hyts_signed_ambiguousSignerArray.jar
Binary files differ