Merge "Provider: add warm up method"
diff --git a/benchmarks/src/benchmarks/regression/JarFileBenchmark.java b/benchmarks/src/benchmarks/regression/JarFileBenchmark.java
index 6e0cb57..1eff10b 100644
--- a/benchmarks/src/benchmarks/regression/JarFileBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/JarFileBenchmark.java
@@ -23,9 +23,8 @@
 
 public class JarFileBenchmark {
     @Param({
-        "/system/framework/bouncycastle.jar",
-        "/system/framework/core.jar",
-        "/system/framework/framework.jar"
+        "/system/framework/core-oj.jar",
+        "/system/priv-app/Phonesky/Phonesky.apk"
     })
     private String filename;
 
diff --git a/luni/src/main/java/java/math/BigInt.java b/luni/src/main/java/java/math/BigInt.java
index 8a30d2b..2cffee6 100644
--- a/luni/src/main/java/java/math/BigInt.java
+++ b/luni/src/main/java/java/math/BigInt.java
@@ -26,7 +26,7 @@
 final class BigInt {
 
     private static NativeAllocationRegistry registry = new NativeAllocationRegistry(
-            NativeBN.getNativeFinalizer(), NativeBN.size());
+            BigInt.class.getClassLoader(), NativeBN.getNativeFinalizer(), NativeBN.size());
 
     /* Fields used for the internal representation. */
     transient long bignum = 0;
diff --git a/luni/src/main/java/java/util/concurrent/BlockingDeque.java b/luni/src/main/java/java/util/concurrent/BlockingDeque.java
index b52f719..45cb6ce 100644
--- a/luni/src/main/java/java/util/concurrent/BlockingDeque.java
+++ b/luni/src/main/java/java/util/concurrent/BlockingDeque.java
@@ -168,7 +168,7 @@
  * the {@code BlockingDeque} in another thread.
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @since 1.6
diff --git a/luni/src/main/java/libcore/icu/NativeConverter.java b/luni/src/main/java/libcore/icu/NativeConverter.java
index a2b5798..956c701 100644
--- a/luni/src/main/java/libcore/icu/NativeConverter.java
+++ b/luni/src/main/java/libcore/icu/NativeConverter.java
@@ -18,7 +18,7 @@
 
 public final class NativeConverter {
     private static final NativeAllocationRegistry registry = new NativeAllocationRegistry(
-            getNativeFinalizer(), getNativeSize());
+            NativeConverter.class.getClassLoader(), getNativeFinalizer(), getNativeSize());
 
     public static native int decode(long converterHandle, byte[] input, int inEnd,
             char[] output, int outEnd, int[] data, boolean flush);
diff --git a/luni/src/main/java/libcore/util/NativeAllocationRegistry.java b/luni/src/main/java/libcore/util/NativeAllocationRegistry.java
index 7f96dd1..ce11a96 100644
--- a/luni/src/main/java/libcore/util/NativeAllocationRegistry.java
+++ b/luni/src/main/java/libcore/util/NativeAllocationRegistry.java
@@ -40,6 +40,7 @@
  */
 public class NativeAllocationRegistry {
 
+    private final ClassLoader classLoader;
     private final long freeFunction;
     private final long size;
 
@@ -54,23 +55,30 @@
      *    void f(void* nativePtr);
      * </pre>
      * <p>
+     * The <code>classLoader</code> argument should be the class loader used
+     * to load the native library that freeFunction belongs to. This is needed
+     * to ensure the native library doesn't get unloaded before freeFunction
+     * is called.
+     * <p>
      * The <code>size</code> should be an estimate of the total number of
      * native bytes this kind of native allocation takes up. Different
      * NativeAllocationRegistrys must be used to register native allocations
      * with different estimated sizes, even if they use the same
      * <code>freeFunction</code>.
-     *
+     * @param classLoader  ClassLoader that was used to load the native
+     *                     library freeFunction belongs to.
      * @param freeFunction address of a native function used to free this
      *                     kind of native allocation
      * @param size         estimated size in bytes of this kind of native
      *                     allocation
      * @throws IllegalArgumentException If <code>size</code> is negative
      */
-    public NativeAllocationRegistry(long freeFunction, long size) {
+    public NativeAllocationRegistry(ClassLoader classLoader, long freeFunction, long size) {
         if (size < 0) {
             throw new IllegalArgumentException("Invalid native allocation size: " + size);
         }
 
+        this.classLoader = classLoader;
         this.freeFunction = freeFunction;
         this.size = size;
     }
diff --git a/luni/src/main/java/org/apache/harmony/security/PrivateKeyImpl.java b/luni/src/main/java/org/apache/harmony/security/PrivateKeyImpl.java
new file mode 100644
index 0000000..47aceb3
--- /dev/null
+++ b/luni/src/main/java/org/apache/harmony/security/PrivateKeyImpl.java
@@ -0,0 +1,66 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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 org.apache.harmony.security;
+
+import java.security.PrivateKey;
+
+/**
+ * PrivateKeyImpl
+ */
+public class PrivateKeyImpl implements PrivateKey {
+
+    /*
+     * @serial
+     */
+    private static final long serialVersionUID = 7776497482533790279L;
+
+    private String algorithm;
+
+    private byte[] encoding;
+
+    public PrivateKeyImpl(String algorithm) {
+        this.algorithm = algorithm;
+    }
+
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public String getFormat() {
+        return "PKCS#8";
+    }
+
+    public byte[] getEncoded() {
+
+        byte[] toReturn = new byte[encoding.length];
+        System.arraycopy(encoding, 0, toReturn, 0, encoding.length);
+
+        return toReturn;
+    }
+
+    public void setAlgorithm(String algorithm) {
+        this.algorithm = algorithm;
+    }
+
+    public void setEncoding(byte[] encoding) {
+        this.encoding = new byte[encoding.length];
+        System.arraycopy(encoding, 0, this.encoding, 0, encoding.length);
+    }
+
+}
diff --git a/luni/src/main/java/org/apache/harmony/security/PublicKeyImpl.java b/luni/src/main/java/org/apache/harmony/security/PublicKeyImpl.java
new file mode 100644
index 0000000..dccc72d
--- /dev/null
+++ b/luni/src/main/java/org/apache/harmony/security/PublicKeyImpl.java
@@ -0,0 +1,72 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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 org.apache.harmony.security;
+
+import java.security.PublicKey;
+
+
+/**
+ * PublicKeyImpl
+ */
+public class PublicKeyImpl implements PublicKey {
+
+    /**
+     * @serial
+     */
+    private static final long serialVersionUID = 7179022516819534075L;
+
+
+    private byte[] encoding;
+
+    private String algorithm;
+
+
+    public PublicKeyImpl(String algorithm) {
+        this.algorithm = algorithm;
+    }
+
+
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+
+    public String getFormat() {
+        return "X.509";
+    }
+
+
+    public byte[] getEncoded() {
+        byte[] result = new byte[encoding.length];
+        System.arraycopy(encoding, 0, result, 0, encoding.length);
+        return result;
+    }
+
+
+    public void setAlgorithm(String algorithm) {
+        this.algorithm = algorithm;
+    }
+
+
+    public void setEncoding(byte[] encoding) {
+        this.encoding = new byte[encoding.length];
+        System.arraycopy(encoding, 0, this.encoding, 0, encoding.length);
+    }
+}
+
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/CryptoProvider.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/CryptoProvider.java
new file mode 100644
index 0000000..ad5ac7d
--- /dev/null
+++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/CryptoProvider.java
@@ -0,0 +1,42 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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 org.apache.harmony.security.provider.crypto;
+
+import java.security.Provider;
+
+/**
+ * Implementation of Provider for SecureRandom. The implementation supports the
+ * "SHA1PRNG" algorithm described in JavaTM Cryptography Architecture, API
+ * Specification & Reference
+ */
+
+public final class CryptoProvider extends Provider {
+
+    private static final long serialVersionUID = 7991202868423459598L;
+
+    /**
+     * Creates a Provider and puts parameters
+     */
+    public CryptoProvider() {
+        super("Crypto", 1.0, "HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)");
+
+        put("SecureRandom.SHA1PRNG",
+                "org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl");
+        put("SecureRandom.SHA1PRNG ImplementedIn", "Software");
+    }
+}
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1Constants.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1Constants.java
new file mode 100644
index 0000000..fc6a847
--- /dev/null
+++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1Constants.java
@@ -0,0 +1,82 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+/**
+* @author Yuri A. Kropachev
+* @version $Revision$
+*/
+
+
+package org.apache.harmony.security.provider.crypto;
+
+
+/**
+ * This interface contains : <BR>
+ * - a set of constant values, H0-H4, defined in "SECURE HASH STANDARD", FIPS PUB 180-2 ;<BR>
+ * - implementation constant values to use in classes using SHA-1 algorithm.    <BR>
+ */
+public final class SHA1Constants {
+    private SHA1Constants() {
+    }
+
+    /**
+     *  constant defined in "SECURE HASH STANDARD"
+     */
+    public static final int H0 = 0x67452301;
+
+
+    /**
+     *  constant defined in "SECURE HASH STANDARD"
+     */
+    public static final int H1 = 0xEFCDAB89;
+
+
+    /**
+     *  constant defined in "SECURE HASH STANDARD"
+     */
+    public static final int H2 = 0x98BADCFE;
+
+
+    /**
+     *  constant defined in "SECURE HASH STANDARD"
+     */
+    public static final int H3 = 0x10325476;
+
+
+    /**
+     *  constant defined in "SECURE HASH STANDARD"
+     */
+    public static final int H4 = 0xC3D2E1F0;
+
+
+    /**
+     * offset in buffer to store number of bytes in 0-15 word frame
+     */
+    public static final int BYTES_OFFSET = 81;
+
+
+    /**
+     * offset in buffer to store current hash value
+     */
+    public static final int HASH_OFFSET = 82;
+
+
+    /**
+     * # of bytes in H0-H4 words; <BR>
+     * in this implementation # is set to 20 (in general # varies from 1 to 20)
+     */
+    public static final int DIGEST_LENGTH = 20;
+}
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1Impl.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1Impl.java
new file mode 100644
index 0000000..57b9005
--- /dev/null
+++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1Impl.java
@@ -0,0 +1,246 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+/**
+* @author Yuri A. Kropachev
+* @version $Revision$
+*/
+
+
+package org.apache.harmony.security.provider.crypto;
+
+import static org.apache.harmony.security.provider.crypto.SHA1Constants.*;
+
+/**
+ * This class contains methods providing SHA-1 functionality to use in classes. <BR>
+ * The methods support the algorithm described in "SECURE HASH STANDARD", FIPS PUB 180-2, <BR>
+ * "http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf"      <BR>
+ * <BR>
+ * The class contains two package level access methods, -
+ * "void updateHash(int[], byte[], int, int)" and "void computeHash(int[])", -
+ * performing the following operations. <BR>
+ * <BR>
+ * The "updateHash(..)" method appends new bytes to existing ones
+ * within limit of a frame of 64 bytes (16 words).
+ * Once a length of accumulated bytes reaches the limit
+ * the "computeHash(int[])" method is invoked on the frame to compute updated hash,
+ * and the number of bytes in the frame is set to 0.
+ * Thus, after appending all bytes, the frame contain only those bytes
+ * that were not used in computing final hash value yet. <BR>
+ * <BR>
+ * The "computeHash(..)" method generates a 160 bit hash value using
+ * a 512 bit message stored in first 16 words of int[] array argument and
+ * current hash value stored in five words, beginning HASH_OFFSET, of the array argument.
+ * Computation is done according to SHA-1 algorithm. <BR>
+ * <BR>
+ * The resulting hash value replaces the previous hash value in the array;
+ * original bits of the message are not preserved.
+ */
+public class SHA1Impl {
+
+
+    /**
+     * The method generates a 160 bit hash value using
+     * a 512 bit message stored in first 16 words of int[] array argument and
+     * current hash value stored in five words, beginning OFFSET+1, of the array argument.
+     * Computation is done according to SHA-1 algorithm.
+     *
+     * The resulting hash value replaces the previous hash value in the array;
+     * original bits of the message are not preserved.
+     *
+     * No checks on argument supplied, that is,
+     * a calling method is responsible for such checks.
+     * In case of incorrect array passed to the method
+     * either NPE or IndexOutOfBoundException gets thrown by JVM.
+     *
+     * @params
+     *        arrW - integer array; arrW.length >= (BYTES_OFFSET+6); <BR>
+     *               only first (BYTES_OFFSET+6) words are used
+     */
+    static void computeHash(int[] arrW) {
+
+        int  a = arrW[HASH_OFFSET   ];
+        int  b = arrW[HASH_OFFSET +1];
+        int  c = arrW[HASH_OFFSET +2];
+        int  d = arrW[HASH_OFFSET +3];
+        int  e = arrW[HASH_OFFSET +4];
+
+        int temp;
+
+        // In this implementation the "d. For t = 0 to 79 do" loop
+        // is split into four loops. The following constants:
+        //     K = 5A827999   0 <= t <= 19
+        //     K = 6ED9EBA1  20 <= t <= 39
+        //     K = 8F1BBCDC  40 <= t <= 59
+        //     K = CA62C1D6  60 <= t <= 79
+        // are hex literals in the loops.
+
+        for ( int t = 16; t < 80 ; t++ ) {
+
+            temp  = arrW[t-3] ^ arrW[t-8] ^ arrW[t-14] ^ arrW[t-16];
+            arrW[t] = ( temp<<1 ) | ( temp>>>31 );
+        }
+
+        for ( int t = 0 ; t < 20 ; t++ ) {
+
+            temp = ( ( a<<5 ) | ( a>>>27 )   ) +
+                   ( ( b & c) | ((~b) & d)   ) +
+                   ( e + arrW[t] + 0x5A827999 ) ;
+            e = d;
+            d = c;
+            c = ( b<<30 ) | ( b>>>2 ) ;
+            b = a;
+            a = temp;
+        }
+        for ( int t = 20 ; t < 40 ; t++ ) {
+
+            temp = ((( a<<5 ) | ( a>>>27 ))) + (b ^ c ^ d) + (e + arrW[t] + 0x6ED9EBA1) ;
+            e = d;
+            d = c;
+            c = ( b<<30 ) | ( b>>>2 ) ;
+            b = a;
+            a = temp;
+        }
+        for ( int t = 40 ; t < 60 ; t++ ) {
+
+            temp = (( a<<5 ) | ( a>>>27 )) + ((b & c) | (b & d) | (c & d)) +
+                                                             (e + arrW[t] + 0x8F1BBCDC) ;
+            e = d;
+            d = c;
+            c = ( b<<30 ) | ( b>>>2 ) ;
+            b = a;
+            a = temp;
+        }
+        for ( int t = 60 ; t < 80 ; t++ ) {
+
+            temp = ((( a<<5 ) | ( a>>>27 ))) + (b ^ c ^ d) + (e + arrW[t] + 0xCA62C1D6) ;
+            e = d;
+            d = c;
+            c = ( b<<30 ) | ( b>>>2 ) ;
+            b = a;
+            a = temp;
+        }
+
+        arrW[HASH_OFFSET   ] += a;
+        arrW[HASH_OFFSET +1] += b;
+        arrW[HASH_OFFSET +2] += c;
+        arrW[HASH_OFFSET +3] += d;
+        arrW[HASH_OFFSET +4] += e;
+    }
+
+    /**
+     * The method appends new bytes to existing ones
+     * within limit of a frame of 64 bytes (16 words).
+     *
+     * Once a length of accumulated bytes reaches the limit
+     * the "computeHash(int[])" method is invoked on the array to compute updated hash,
+     * and the number of bytes in the frame is set to 0.
+     * Thus, after appending all bytes, the array contain only those bytes
+     * that were not used in computing final hash value yet.
+     *
+     * No checks on arguments passed to the method, that is,
+     * a calling method is responsible for such checks.
+     *
+     * @params
+     *        intArray  - int array containing bytes to which to append;
+     *                    intArray.length >= (BYTES_OFFSET+6)
+     * @params
+     *        byteInput - array of bytes to use for the update
+     * @params
+     *        from      - the offset to start in the "byteInput" array
+     * @params
+     *        to        - a number of the last byte in the input array to use,
+     *                that is, for first byte "to"==0, for last byte "to"==input.length-1
+     */
+    static void updateHash(int[] intArray, byte[] byteInput, int fromByte, int toByte) {
+
+        // As intArray contains a packed bytes
+        // the buffer's index is in the intArray[BYTES_OFFSET] element
+
+        int index = intArray[BYTES_OFFSET];
+        int i = fromByte;
+        int maxWord;
+        int nBytes;
+
+        int wordIndex = index >>2;
+        int byteIndex = index & 0x03;
+
+        intArray[BYTES_OFFSET] = ( index + toByte - fromByte + 1 ) & 077 ;
+
+        // In general case there are 3 stages :
+        // - appending bytes to non-full word,
+        // - writing 4 bytes into empty words,
+        // - writing less than 4 bytes in last word
+
+        if ( byteIndex != 0 ) {       // appending bytes in non-full word (as if)
+
+            for ( ; ( i <= toByte ) && ( byteIndex < 4 ) ; i++ ) {
+                intArray[wordIndex] |= ( byteInput[i] & 0xFF ) << ((3 - byteIndex)<<3) ;
+                byteIndex++;
+            }
+            if ( byteIndex == 4 ) {
+                wordIndex++;
+                if ( wordIndex == 16 ) {          // intArray is full, computing hash
+
+                    computeHash(intArray);
+                    wordIndex = 0;
+                }
+            }
+            if ( i > toByte ) {                 // all input bytes appended
+                return ;
+            }
+        }
+
+        // writing full words
+
+        maxWord = (toByte - i + 1) >> 2;           // # of remaining full words, may be "0"
+        for ( int k = 0; k < maxWord ; k++ ) {
+
+            intArray[wordIndex] = ( ((int) byteInput[i   ] & 0xFF) <<24 ) |
+                                  ( ((int) byteInput[i +1] & 0xFF) <<16 ) |
+                                  ( ((int) byteInput[i +2] & 0xFF) <<8  ) |
+                                  ( ((int) byteInput[i +3] & 0xFF)      )  ;
+            i += 4;
+            wordIndex++;
+
+            if ( wordIndex < 16 ) {     // buffer is not full yet
+                continue;
+            }
+            computeHash(intArray);      // buffer is full, computing hash
+            wordIndex = 0;
+        }
+
+        // writing last incomplete word
+        // after writing free byte positions are set to "0"s
+
+        nBytes = toByte - i +1;
+        if ( nBytes != 0 ) {
+
+            int w =  ((int) byteInput[i] & 0xFF) <<24 ;
+
+            if ( nBytes != 1 ) {
+                w |= ((int) byteInput[i +1] & 0xFF) <<16 ;
+                if ( nBytes != 2) {
+                    w |= ((int) byteInput[i +2] & 0xFF) <<8 ;
+                }
+            }
+            intArray[wordIndex] = w;
+        }
+
+        return ;
+    }
+
+}
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java
new file mode 100644
index 0000000..5c0e328
--- /dev/null
+++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java
@@ -0,0 +1,564 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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 org.apache.harmony.security.provider.crypto;
+
+import dalvik.system.BlockGuard;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.security.InvalidParameterException;
+import java.security.ProviderException;
+import java.security.SecureRandomSpi;
+import libcore.io.Streams;
+import libcore.util.EmptyArray;
+
+import static org.apache.harmony.security.provider.crypto.SHA1Constants.*;
+
+/**
+ * This class extends the SecureRandomSpi class implementing all its abstract methods.
+ *
+ * <p>To generate pseudo-random bits, the implementation uses technique described in
+ * the "Random Number Generator (RNG) algorithms" section, Appendix A,
+ * JavaTM Cryptography Architecture, API Specification & Reference.
+ */
+public class SHA1PRNG_SecureRandomImpl extends SecureRandomSpi implements Serializable {
+
+    private static final long serialVersionUID = 283736797212159675L;
+
+    private static FileInputStream devURandom;
+    static {
+        try {
+            devURandom = new FileInputStream(new File("/dev/urandom"));
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    // constants to use in expressions operating on bytes in int and long variables:
+    // END_FLAGS - final bytes in words to append to message;
+    //             see "ch.5.1 Padding the Message, FIPS 180-2"
+    // RIGHT1    - shifts to right for left half of long
+    // RIGHT2    - shifts to right for right half of long
+    // LEFT      - shifts to left for bytes
+    // MASK      - mask to select counter's bytes after shift to right
+
+    private static final int[] END_FLAGS = { 0x80000000, 0x800000, 0x8000, 0x80 };
+
+    private static final int[] RIGHT1 = { 0, 40, 48, 56 };
+
+    private static final int[] RIGHT2 = { 0, 8, 16, 24 };
+
+    private static final int[] LEFT = { 0, 24, 16, 8 };
+
+    private static final int[] MASK = { 0xFFFFFFFF, 0x00FFFFFF, 0x0000FFFF,
+            0x000000FF };
+
+    // HASHBYTES_TO_USE defines # of bytes returned by "computeHash(byte[])"
+    // to use to form byte array returning by the "nextBytes(byte[])" method
+    // Note, that this implementation uses more bytes than it is defined
+    // in the above specification.
+    private static final int HASHBYTES_TO_USE = 20;
+
+    // value of 16 defined in the "SECURE HASH STANDARD", FIPS PUB 180-2
+    private static final int FRAME_LENGTH = 16;
+
+    // miscellaneous constants defined in this implementation:
+    // COUNTER_BASE - initial value to set to "counter" before computing "nextBytes(..)";
+    //                note, that the exact value is not defined in STANDARD
+    // HASHCOPY_OFFSET   - offset for copy of current hash in "copies" array
+    // EXTRAFRAME_OFFSET - offset for extra frame in "copies" array;
+    //                     as the extra frame follows the current hash frame,
+    //                     EXTRAFRAME_OFFSET is equal to length of current hash frame
+    // FRAME_OFFSET      - offset for frame in "copies" array
+    // MAX_BYTES - maximum # of seed bytes processing which doesn't require extra frame
+    //             see (1) comments on usage of "seed" array below and
+    //             (2) comments in "engineNextBytes(byte[])" method
+    //
+    // UNDEFINED  - three states of engine; initially its state is "UNDEFINED"
+    // SET_SEED     call to "engineSetSeed"  sets up "SET_SEED" state,
+    // NEXT_BYTES   call to "engineNextByte" sets up "NEXT_BYTES" state
+
+    private static final int COUNTER_BASE = 0;
+
+    private static final int HASHCOPY_OFFSET = 0;
+
+    private static final int EXTRAFRAME_OFFSET = 5;
+
+    private static final int FRAME_OFFSET = 21;
+
+    private static final int MAX_BYTES = 48;
+
+    private static final int UNDEFINED = 0;
+
+    private static final int SET_SEED = 1;
+
+    private static final int NEXT_BYTES = 2;
+
+    private static SHA1PRNG_SecureRandomImpl myRandom;
+
+    // Structure of "seed" array:
+    // -  0-79 - words for computing hash
+    // - 80    - unused
+    // - 81    - # of seed bytes in current seed frame
+    // - 82-86 - 5 words, current seed hash
+    private transient int[] seed;
+
+    // total length of seed bytes, including all processed
+    private transient long seedLength;
+
+    // Structure of "copies" array
+    // -  0-4  - 5 words, copy of current seed hash
+    // -  5-20 - extra 16 words frame;
+    //           is used if final padding exceeds 512-bit length
+    // - 21-36 - 16 word frame to store a copy of remaining bytes
+    private transient int[] copies;
+
+    // ready "next" bytes; needed because words are returned
+    private transient byte[] nextBytes;
+
+    // index of used bytes in "nextBytes" array
+    private transient int nextBIndex;
+
+    // variable required according to "SECURE HASH STANDARD"
+    private transient long counter;
+
+    // contains int value corresponding to engine's current state
+    private transient int state;
+
+    // The "seed" array is used to compute both "current seed hash" and "next bytes".
+    //
+    // As the "SHA1" algorithm computes a hash of entire seed by splitting it into
+    // a number of the 512-bit length frames (512 bits = 64 bytes = 16 words),
+    // "current seed hash" is a hash (5 words, 20 bytes) for all previous full frames;
+    // remaining bytes are stored in the 0-15 word frame of the "seed" array.
+    //
+    // As for calculating "next bytes",
+    // both remaining bytes and "current seed hash" are used,
+    // to preserve the latter for following "setSeed(..)" commands,
+    // the following technique is used:
+    // - upon getting "nextBytes(byte[])" invoked, single or first in row,
+    //   which requires computing new hash, that is,
+    //   there is no more bytes remaining from previous "next bytes" computation,
+    //   remaining bytes are copied into the 21-36 word frame of the "copies" array;
+    // - upon getting "setSeed(byte[])" invoked, single or first in row,
+    //   remaining bytes are copied back.
+
+    /**
+     *  Creates object and sets implementation variables to their initial values
+     */
+    public SHA1PRNG_SecureRandomImpl() {
+
+        seed = new int[HASH_OFFSET + EXTRAFRAME_OFFSET];
+        seed[HASH_OFFSET] = H0;
+        seed[HASH_OFFSET + 1] = H1;
+        seed[HASH_OFFSET + 2] = H2;
+        seed[HASH_OFFSET + 3] = H3;
+        seed[HASH_OFFSET + 4] = H4;
+
+        seedLength = 0;
+        copies = new int[2 * FRAME_LENGTH + EXTRAFRAME_OFFSET];
+        nextBytes = new byte[DIGEST_LENGTH];
+        nextBIndex = HASHBYTES_TO_USE;
+        counter = COUNTER_BASE;
+        state = UNDEFINED;
+    }
+
+    /*
+     * The method invokes the SHA1Impl's "updateHash(..)" method
+     * to update current seed frame and
+     * to compute new intermediate hash value if the frame is full.
+     *
+     * After that it computes a length of whole seed.
+     */
+    private void updateSeed(byte[] bytes) {
+
+        // on call:   "seed" contains current bytes and current hash;
+        // on return: "seed" contains new current bytes and possibly new current hash
+        //            if after adding, seed bytes overfill its buffer
+        SHA1Impl.updateHash(seed, bytes, 0, bytes.length - 1);
+
+        seedLength += bytes.length;
+    }
+
+    /**
+     * Changes current seed by supplementing a seed argument to the current seed,
+     * if this already set;
+     * the argument is used as first seed otherwise. <BR>
+     *
+     * The method overrides "engineSetSeed(byte[])" in class SecureRandomSpi.
+     *
+     * @param
+     *       seed - byte array
+     * @throws
+     *       NullPointerException - if null is passed to the "seed" argument
+     */
+    protected synchronized void engineSetSeed(byte[] seed) {
+
+        if (seed == null) {
+            throw new NullPointerException("seed == null");
+        }
+
+        if (state == NEXT_BYTES) { // first setSeed after NextBytes; restoring hash
+            System.arraycopy(copies, HASHCOPY_OFFSET, this.seed, HASH_OFFSET,
+                    EXTRAFRAME_OFFSET);
+        }
+        state = SET_SEED;
+
+        if (seed.length != 0) {
+            updateSeed(seed);
+        }
+    }
+
+    /**
+     * Returns a required number of random bytes. <BR>
+     *
+     * The method overrides "engineGenerateSeed (int)" in class SecureRandomSpi. <BR>
+     *
+     * @param
+     *       numBytes - number of bytes to return; should be >= 0.
+     * @return
+     *       byte array containing bits in order from left to right
+     * @throws
+     *       InvalidParameterException - if numBytes < 0
+     */
+    protected synchronized byte[] engineGenerateSeed(int numBytes) {
+
+        byte[] myBytes; // byte[] for bytes returned by "nextBytes()"
+
+        if (numBytes < 0) {
+            throw new NegativeArraySizeException(Integer.toString(numBytes));
+        }
+        if (numBytes == 0) {
+            return EmptyArray.BYTE;
+        }
+
+        if (myRandom == null) {
+            myRandom = new SHA1PRNG_SecureRandomImpl();
+            myRandom.engineSetSeed(getRandomBytes(DIGEST_LENGTH));
+        }
+
+        myBytes = new byte[numBytes];
+        myRandom.engineNextBytes(myBytes);
+
+        return myBytes;
+    }
+
+    /**
+     * Writes random bytes into an array supplied.
+     * Bits in a byte are from left to right. <BR>
+     *
+     * To generate random bytes, the "expansion of source bits" method is used,
+     * that is,
+     * the current seed with a 64-bit counter appended is used to compute new bits.
+     * The counter is incremented by 1 for each 20-byte output. <BR>
+     *
+     * The method overrides engineNextBytes in class SecureRandomSpi.
+     *
+     * @param
+     *       bytes - byte array to be filled in with bytes
+     * @throws
+     *       NullPointerException - if null is passed to the "bytes" argument
+     */
+    protected synchronized void engineNextBytes(byte[] bytes) {
+
+        int i, n;
+
+        long bits; // number of bits required by Secure Hash Standard
+        int nextByteToReturn; // index of ready bytes in "bytes" array
+        int lastWord; // index of last word in frame containing bytes
+        final int extrabytes = 7;// # of bytes to add in order to computer # of 8 byte words
+
+        if (bytes == null) {
+            throw new NullPointerException("bytes == null");
+        }
+
+        lastWord = seed[BYTES_OFFSET] == 0 ? 0
+                : (seed[BYTES_OFFSET] + extrabytes) >> 3 - 1;
+
+        if (state == UNDEFINED) {
+
+            // no seed supplied by user, hence it is generated thus randomizing internal state
+            updateSeed(getRandomBytes(DIGEST_LENGTH));
+            nextBIndex = HASHBYTES_TO_USE;
+
+            // updateSeed(...) updates where the last word of the seed is, so we
+            // have to read it again.
+            lastWord = seed[BYTES_OFFSET] == 0 ? 0
+                    : (seed[BYTES_OFFSET] + extrabytes) >> 3 - 1;
+
+        } else if (state == SET_SEED) {
+
+            System.arraycopy(seed, HASH_OFFSET, copies, HASHCOPY_OFFSET,
+                    EXTRAFRAME_OFFSET);
+
+            // possible cases for 64-byte frame:
+            //
+            // seed bytes < 48      - remaining bytes are enough for all, 8 counter bytes,
+            //                        0x80, and 8 seedLength bytes; no extra frame required
+            // 48 < seed bytes < 56 - remaining 9 bytes are for 0x80 and 8 counter bytes
+            //                        extra frame contains only seedLength value at the end
+            // seed bytes > 55      - extra frame contains both counter's bytes
+            //                        at the beginning and seedLength value at the end;
+            //                        note, that beginning extra bytes are not more than 8,
+            //                        that is, only 2 extra words may be used
+
+            // no need to set to "0" 3 words after "lastWord" and
+            // more than two words behind frame
+            for (i = lastWord + 3; i < FRAME_LENGTH + 2; i++) {
+                seed[i] = 0;
+            }
+
+            bits = (seedLength << 3) + 64; // transforming # of bytes into # of bits
+
+            // putting # of bits into two last words (14,15) of 16 word frame in
+            // seed or copies array depending on total length after padding
+            if (seed[BYTES_OFFSET] < MAX_BYTES) {
+                seed[14] = (int) (bits >>> 32);
+                seed[15] = (int) (bits & 0xFFFFFFFF);
+            } else {
+                copies[EXTRAFRAME_OFFSET + 14] = (int) (bits >>> 32);
+                copies[EXTRAFRAME_OFFSET + 15] = (int) (bits & 0xFFFFFFFF);
+            }
+
+            nextBIndex = HASHBYTES_TO_USE; // skipping remaining random bits
+        }
+        state = NEXT_BYTES;
+
+        if (bytes.length == 0) {
+            return;
+        }
+
+        nextByteToReturn = 0;
+
+        // possibly not all of HASHBYTES_TO_USE bytes were used previous time
+        n = (HASHBYTES_TO_USE - nextBIndex) < (bytes.length - nextByteToReturn) ? HASHBYTES_TO_USE
+                - nextBIndex
+                : bytes.length - nextByteToReturn;
+        if (n > 0) {
+            System.arraycopy(nextBytes, nextBIndex, bytes, nextByteToReturn, n);
+            nextBIndex += n;
+            nextByteToReturn += n;
+        }
+
+        if (nextByteToReturn >= bytes.length) {
+            return; // return because "bytes[]" are filled in
+        }
+
+        n = seed[BYTES_OFFSET] & 0x03;
+        for (;;) {
+            if (n == 0) {
+
+                seed[lastWord] = (int) (counter >>> 32);
+                seed[lastWord + 1] = (int) (counter & 0xFFFFFFFF);
+                seed[lastWord + 2] = END_FLAGS[0];
+
+            } else {
+
+                seed[lastWord] |= (int) ((counter >>> RIGHT1[n]) & MASK[n]);
+                seed[lastWord + 1] = (int) ((counter >>> RIGHT2[n]) & 0xFFFFFFFF);
+                seed[lastWord + 2] = (int) ((counter << LEFT[n]) | END_FLAGS[n]);
+            }
+            if (seed[BYTES_OFFSET] > MAX_BYTES) {
+                copies[EXTRAFRAME_OFFSET] = seed[FRAME_LENGTH];
+                copies[EXTRAFRAME_OFFSET + 1] = seed[FRAME_LENGTH + 1];
+            }
+
+            SHA1Impl.computeHash(seed);
+
+            if (seed[BYTES_OFFSET] > MAX_BYTES) {
+
+                System.arraycopy(seed, 0, copies, FRAME_OFFSET, FRAME_LENGTH);
+                System.arraycopy(copies, EXTRAFRAME_OFFSET, seed, 0,
+                        FRAME_LENGTH);
+
+                SHA1Impl.computeHash(seed);
+                System.arraycopy(copies, FRAME_OFFSET, seed, 0, FRAME_LENGTH);
+            }
+            counter++;
+
+            int j = 0;
+            for (i = 0; i < EXTRAFRAME_OFFSET; i++) {
+                int k = seed[HASH_OFFSET + i];
+                nextBytes[j] = (byte) (k >>> 24); // getting first  byte from left
+                nextBytes[j + 1] = (byte) (k >>> 16); // getting second byte from left
+                nextBytes[j + 2] = (byte) (k >>> 8); // getting third  byte from left
+                nextBytes[j + 3] = (byte) (k); // getting fourth byte from left
+                j += 4;
+            }
+
+            nextBIndex = 0;
+            j = HASHBYTES_TO_USE < (bytes.length - nextByteToReturn) ? HASHBYTES_TO_USE
+                    : bytes.length - nextByteToReturn;
+
+            if (j > 0) {
+                System.arraycopy(nextBytes, 0, bytes, nextByteToReturn, j);
+                nextByteToReturn += j;
+                nextBIndex += j;
+            }
+
+            if (nextByteToReturn >= bytes.length) {
+                break;
+            }
+        }
+    }
+
+    private void writeObject(ObjectOutputStream oos) throws IOException {
+
+        int[] intData = null;
+
+        final int only_hash = EXTRAFRAME_OFFSET;
+        final int hashes_and_frame = EXTRAFRAME_OFFSET * 2 + FRAME_LENGTH;
+        final int hashes_and_frame_extra = EXTRAFRAME_OFFSET * 2 + FRAME_LENGTH
+                * 2;
+
+        oos.writeLong(seedLength);
+        oos.writeLong(counter);
+        oos.writeInt(state);
+        oos.writeInt(seed[BYTES_OFFSET]);
+
+        int nRemaining = (seed[BYTES_OFFSET] + 3) >> 2; // converting bytes in words
+        // result may be 0
+        if (state != NEXT_BYTES) {
+
+            // either the state is UNDEFINED or previous method was "setSeed(..)"
+            // so in "seed[]" to serialize are remaining bytes (seed[0-nRemaining]) and
+            // current hash (seed[82-86])
+
+            intData = new int[only_hash + nRemaining];
+
+            System.arraycopy(seed, 0, intData, 0, nRemaining);
+            System.arraycopy(seed, HASH_OFFSET, intData, nRemaining,
+                    EXTRAFRAME_OFFSET);
+
+        } else {
+            // previous method was "nextBytes(..)"
+            // so, data to serialize are all the above (two first are in "copies" array)
+            // and current words in both frame and extra frame (as if)
+
+            int offset = 0;
+            if (seed[BYTES_OFFSET] < MAX_BYTES) { // no extra frame
+
+                intData = new int[hashes_and_frame + nRemaining];
+
+            } else { // extra frame is used
+
+                intData = new int[hashes_and_frame_extra + nRemaining];
+
+                intData[offset] = seed[FRAME_LENGTH];
+                intData[offset + 1] = seed[FRAME_LENGTH + 1];
+                intData[offset + 2] = seed[FRAME_LENGTH + 14];
+                intData[offset + 3] = seed[FRAME_LENGTH + 15];
+                offset += 4;
+            }
+
+            System.arraycopy(seed, 0, intData, offset, FRAME_LENGTH);
+            offset += FRAME_LENGTH;
+
+            System.arraycopy(copies, FRAME_LENGTH + EXTRAFRAME_OFFSET, intData,
+                    offset, nRemaining);
+            offset += nRemaining;
+
+            System.arraycopy(copies, 0, intData, offset, EXTRAFRAME_OFFSET);
+            offset += EXTRAFRAME_OFFSET;
+
+            System.arraycopy(seed, HASH_OFFSET, intData, offset,
+                    EXTRAFRAME_OFFSET);
+        }
+        for (int i = 0; i < intData.length; i++) {
+            oos.writeInt(intData[i]);
+        }
+
+        oos.writeInt(nextBIndex);
+        oos.write(nextBytes, nextBIndex, HASHBYTES_TO_USE - nextBIndex);
+    }
+
+    private void readObject(ObjectInputStream ois) throws IOException,
+            ClassNotFoundException {
+
+        seed = new int[HASH_OFFSET + EXTRAFRAME_OFFSET];
+        copies = new int[2 * FRAME_LENGTH + EXTRAFRAME_OFFSET];
+        nextBytes = new byte[DIGEST_LENGTH];
+
+        seedLength = ois.readLong();
+        counter = ois.readLong();
+        state = ois.readInt();
+        seed[BYTES_OFFSET] = ois.readInt();
+
+        int nRemaining = (seed[BYTES_OFFSET] + 3) >> 2; // converting bytes in words
+
+        if (state != NEXT_BYTES) {
+
+            for (int i = 0; i < nRemaining; i++) {
+                seed[i] = ois.readInt();
+            }
+            for (int i = 0; i < EXTRAFRAME_OFFSET; i++) {
+                seed[HASH_OFFSET + i] = ois.readInt();
+            }
+        } else {
+            if (seed[BYTES_OFFSET] >= MAX_BYTES) {
+
+                // reading next bytes in seed extra frame
+                seed[FRAME_LENGTH] = ois.readInt();
+                seed[FRAME_LENGTH + 1] = ois.readInt();
+                seed[FRAME_LENGTH + 14] = ois.readInt();
+                seed[FRAME_LENGTH + 15] = ois.readInt();
+            }
+            // reading next bytes in seed frame
+            for (int i = 0; i < FRAME_LENGTH; i++) {
+                seed[i] = ois.readInt();
+            }
+            // reading remaining seed bytes
+            for (int i = 0; i < nRemaining; i++) {
+                copies[FRAME_LENGTH + EXTRAFRAME_OFFSET + i] = ois.readInt();
+            }
+            // reading copy of current hash
+            for (int i = 0; i < EXTRAFRAME_OFFSET; i++) {
+                copies[i] = ois.readInt();
+            }
+            // reading current hash
+            for (int i = 0; i < EXTRAFRAME_OFFSET; i++) {
+                seed[HASH_OFFSET + i] = ois.readInt();
+            }
+        }
+
+        nextBIndex = ois.readInt();
+        Streams.readFully(ois, nextBytes, nextBIndex, HASHBYTES_TO_USE - nextBIndex);
+    }
+
+    private static byte[] getRandomBytes(int byteCount) {
+        if (byteCount <= 0) {
+            throw new IllegalArgumentException("Too few bytes requested: " + byteCount);
+        }
+
+        BlockGuard.Policy originalPolicy = BlockGuard.getThreadPolicy();
+        try {
+            BlockGuard.setThreadPolicy(BlockGuard.LAX_POLICY);
+            byte[] result = new byte[byteCount];
+            Streams.readFully(devURandom, result, 0, byteCount);
+            return result;
+        } catch (Exception ex) {
+            throw new ProviderException("Couldn't read " + byteCount + " random bytes", ex);
+        } finally {
+            BlockGuard.setThreadPolicy(originalPolicy);
+        }
+    }
+}
diff --git a/luni/src/main/native/java_math_NativeBN.cpp b/luni/src/main/native/java_math_NativeBN.cpp
index 2bbbf65..d7c55b1 100644
--- a/luni/src/main/native/java_math_NativeBN.cpp
+++ b/luni/src/main/native/java_math_NativeBN.cpp
@@ -249,11 +249,11 @@
 
 #ifdef __LP64__
 #define BYTES2ULONG(bytes, k) \
-    ((bytes[k + 7] & 0xffULL)       | (bytes[k + 6] & 0xffULL) <<  8 | (bytes[k + 5] & 0xffULL) << 16 | (bytes[k + 4] & 0xffULL) << 24 | \
-     (bytes[k + 3] & 0xffULL) << 32 | (bytes[k + 2] & 0xffULL) << 40 | (bytes[k + 1] & 0xffULL) << 48 | (bytes[k + 0] & 0xffULL) << 56)
+    (((bytes)[(k) + 7] & 0xffULL)       | ((bytes)[(k) + 6] & 0xffULL) <<  8 | ((bytes)[(k) + 5] & 0xffULL) << 16 | ((bytes)[(k) + 4] & 0xffULL) << 24 | \
+     ((bytes)[(k) + 3] & 0xffULL) << 32 | ((bytes)[(k) + 2] & 0xffULL) << 40 | ((bytes)[(k) + 1] & 0xffULL) << 48 | ((bytes)[(k) + 0] & 0xffULL) << 56)
 #else
 #define BYTES2ULONG(bytes, k) \
-    ((bytes[k + 3] & 0xff) | (bytes[k + 2] & 0xff) << 8 | (bytes[k + 1] & 0xff) << 16 | (bytes[k + 0] & 0xff) << 24)
+    (((bytes)[(k) + 3] & 0xff) | ((bytes)[(k) + 2] & 0xff) << 8 | ((bytes)[(k) + 1] & 0xff) << 16 | ((bytes)[(k) + 0] & 0xff) << 24)
 #endif
 static void negBigEndianBytes2bn(JNIEnv*, jclass, const unsigned char* bytes, int bytesLen, jlong ret0) {
   BIGNUM* ret = toBigNum(ret0);
diff --git a/luni/src/main/native/libcore_io_Memory.cpp b/luni/src/main/native/libcore_io_Memory.cpp
index 5122a6c..05680db 100644
--- a/luni/src/main/native/libcore_io_Memory.cpp
+++ b/luni/src/main/native/libcore_io_Memory.cpp
@@ -124,7 +124,7 @@
             return; \
         } \
         const SWAP_TYPE* src = cast<const SWAP_TYPE*>(srcAddress); \
-        SWAP_FN(reinterpret_cast<SWAP_TYPE*>(elements.get()) + dstOffset, src, count); \
+        SWAP_FN(reinterpret_cast<SWAP_TYPE*>(elements.get()) + dstOffset, src, count); /*NOLINT*/ \
     } else { \
         const SCALAR_TYPE* src = cast<const SCALAR_TYPE*>(srcAddress); \
         env->Set ## JNI_NAME ## ArrayRegion(dst, dstOffset, count, src); \
@@ -177,9 +177,9 @@
             return; \
         } \
         const SWAP_TYPE* src = reinterpret_cast<const SWAP_TYPE*>(elements.get()) + srcOffset; \
-        SWAP_FN(cast<SWAP_TYPE*>(dstAddress), src, count); \
+        SWAP_FN(cast<SWAP_TYPE*>(dstAddress), src, count); /*NOLINT*/ \
     } else { \
-        env->Get ## JNI_NAME ## ArrayRegion(src, srcOffset, count, cast<SCALAR_TYPE*>(dstAddress)); \
+        env->Get ## JNI_NAME ## ArrayRegion(src, srcOffset, count, cast<SCALAR_TYPE*>(dstAddress)); /*NOLINT*/ \
     } \
 }
 
diff --git a/luni/src/main/native/libcore_io_Posix.cpp b/luni/src/main/native/libcore_io_Posix.cpp
index d2bcc5a..4301e2b 100644
--- a/luni/src/main/native/libcore_io_Posix.cpp
+++ b/luni/src/main/native/libcore_io_Posix.cpp
@@ -66,7 +66,7 @@
 
 #define TO_JAVA_STRING(NAME, EXP) \
         jstring NAME = env->NewStringUTF(EXP); \
-        if (NAME == NULL) return NULL;
+        if ((NAME) == NULL) return NULL;
 
 struct addrinfo_deleter {
     void operator()(addrinfo* p) const {
@@ -98,7 +98,7 @@
     do { \
         sockaddr_storage _ss; \
         socklen_t _salen; \
-        if (java_addr == NULL && null_addr_ok) { \
+        if ((java_addr) == NULL && (null_addr_ok)) { \
             /* No IP address specified (e.g., sendto() on a connected socket). */ \
             _salen = 0; \
         } else if (!inetAddressToSockaddr(jni_env, java_addr, port, _ss, _salen)) { \
@@ -112,7 +112,7 @@
         if (_rc == -1 && errno == EAFNOSUPPORT && _salen && isIPv4MappedAddress(_sa)) { \
             /* We passed in an IPv4 address in an IPv6 sockaddr and the kernel told us that we got \
              * the address family wrong. Pass in the same address in an IPv4 sockaddr. */ \
-            jni_env->ExceptionClear(); \
+            (jni_env)->ExceptionClear(); \
             if (!inetAddressToSockaddrVerbatim(jni_env, java_addr, port, _ss, _salen)) { \
                 break; \
             } \
diff --git a/luni/src/test/java/dalvik/system/DexClassLoaderTest.java b/luni/src/test/java/dalvik/system/DexClassLoaderTest.java
index c57db71..0e0ee8d 100644
--- a/luni/src/test/java/dalvik/system/DexClassLoaderTest.java
+++ b/luni/src/test/java/dalvik/system/DexClassLoaderTest.java
@@ -70,7 +70,11 @@
         }
         File[] files = dir.listFiles();
         for (File file : files) {
-            assertTrue(file.delete());
+            if (file.isDirectory()) {
+                cleanUpDir(file);
+            } else {
+                assertTrue(file.delete());
+            }
         }
     }
 
@@ -393,4 +397,39 @@
     public void test_twoJar_diff_getResourceAsStream() throws Exception {
         createLoaderAndCallMethod("test.TestMethods", "test_diff_getResourceAsStream", jar1, jar2);
     }
+
+    /**
+     * Test that a DexClassLoader can be used to generate optimized code, then
+     * a subsequent PathClassLoader can be used to load the optimized code.
+     * (b/19937016).
+     */
+    public void testDexThenPathClassLoader() throws Exception {
+        // Use a DexClassLoader to create optimized code.
+        File dex = new File(srcDir, "dex-then-path.dex");
+        copyResource("loading-test.dex", dex);
+
+        File oatDir = new File(new File(srcDir, "oat"), VMRuntime.getCurrentInstructionSet());
+        assertTrue(oatDir.mkdirs());
+
+        DexClassLoader dexloader = new DexClassLoader(dex.getAbsolutePath(),
+                oatDir.getAbsolutePath(), null, ClassLoader.getSystemClassLoader());
+        Class c1 = dexloader.loadClass("test.Test1");
+        Method m1 = c1.getMethod("test", (Class[]) null);
+        assertSame("blort", m1.invoke(null, (Object[]) null));
+
+        // Move the optimized code to the right location to be used by a
+        // PathClassLoader.
+        File odexForDexClassLoader = new File(oatDir, "dex-then-path.dex");
+        File odexForPathClassLoader = new File(oatDir, "dex-then-path.odex");
+        assertTrue(DexFile.isDexOptNeeded(dex.getAbsolutePath()));
+        assertTrue(odexForDexClassLoader.renameTo(odexForPathClassLoader));
+        assertFalse(DexFile.isDexOptNeeded(dex.getAbsolutePath()));
+
+        // Use a PathClassLoader that loads and runs the optimized code.
+        PathClassLoader pathloader = new PathClassLoader(dex.getAbsolutePath(),
+                ClassLoader.getSystemClassLoader());
+        Class c2 = pathloader.loadClass("test.Test1");
+        Method m2 = c2.getMethod("test", (Class[]) null);
+        assertSame("blort", m2.invoke(null, (Object[]) null));
+    }
 }
diff --git a/luni/src/test/java/libcore/java/lang/ProcessBuilderTest.java b/luni/src/test/java/libcore/java/lang/ProcessBuilderTest.java
index 48dfea3..a9b2e5f 100644
--- a/luni/src/test/java/libcore/java/lang/ProcessBuilderTest.java
+++ b/luni/src/test/java/libcore/java/lang/ProcessBuilderTest.java
@@ -24,6 +24,7 @@
 import java.io.OutputStream;
 import java.io.Writer;
 import java.lang.ProcessBuilder.Redirect;
+import java.lang.ProcessBuilder.Redirect.Type;
 import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -271,18 +272,22 @@
     }
 
     /**
-     * Tests the {@link Redirect#type() type} of various redirects.
+     * Tests the {@link Redirect#type() type} and {@link Redirect#file() file} of
+     * various Redirects. These guarantees are made in the respective javadocs,
+     * so we're testing them together here.
      */
-    public void testRedirect_type() {
+    public void testRedirect_fileAndType() {
         File file = new File("/tmp/fake-file-for/java.lang.ProcessBuilderTest");
-        assertRedirectType(Redirect.Type.INHERIT, INHERIT);
-        assertRedirectType(Redirect.Type.PIPE, PIPE);
-        assertRedirectType(Redirect.Type.APPEND, Redirect.appendTo(file));
-        assertRedirectType(Redirect.Type.READ, Redirect.from(file));
-        assertRedirectType(Redirect.Type.WRITE, Redirect.to(file));
+        assertRedirectFileAndType(null, Type.INHERIT, INHERIT);
+        assertRedirectFileAndType(null, Type.PIPE, PIPE);
+        assertRedirectFileAndType(file, Type.APPEND, Redirect.appendTo(file));
+        assertRedirectFileAndType(file, Type.READ, Redirect.from(file));
+        assertRedirectFileAndType(file, Type.WRITE, Redirect.to(file));
     }
 
-    private static void assertRedirectType(Redirect.Type expectedType, Redirect redirect) {
+    private static void assertRedirectFileAndType(File expectedFile, Type expectedType,
+            Redirect redirect) {
+        assertEquals(redirect.toString(), expectedFile, redirect.file());
         assertEquals(redirect.toString(), expectedType, redirect.type());
     }
 
diff --git a/luni/src/test/java/libcore/java/nio/channels/AcceptPendingExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/AcceptPendingExceptionTest.java
new file mode 100644
index 0000000..12567c4
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/AcceptPendingExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 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 libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.AcceptPendingException;
+
+public class AcceptPendingExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.AcceptPendingException#AcceptPendingException()
+     */
+    public void test_empty() {
+        AcceptPendingException e = new AcceptPendingException();
+        assertTrue(e instanceof IllegalStateException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/IllegalChannelGroupExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/IllegalChannelGroupExceptionTest.java
new file mode 100644
index 0000000..3e85927
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/IllegalChannelGroupExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 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 libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.IllegalChannelGroupException;
+
+public class IllegalChannelGroupExceptionTest extends TestCase{
+
+    /**
+     * java.nio.channels.IllegalChannelGroupException#IllegalChannelGroupException()
+     */
+    public void test_empty() {
+        IllegalChannelGroupException e = new IllegalChannelGroupException();
+        assertTrue(e instanceof IllegalArgumentException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/InterruptedByTimeoutExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/InterruptedByTimeoutExceptionTest.java
new file mode 100644
index 0000000..38b1c45
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/InterruptedByTimeoutExceptionTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 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 libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.io.IOException;
+import java.nio.channels.InterruptedByTimeoutException;
+
+public class InterruptedByTimeoutExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.InterruptedByTimeoutException#InterruptedByTimeoutException()
+     */
+    public void test_empty() {
+        InterruptedByTimeoutException e = new InterruptedByTimeoutException();
+        assertTrue(e instanceof IOException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/ReadPendingExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/ReadPendingExceptionTest.java
new file mode 100644
index 0000000..f05e4cc
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/ReadPendingExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 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 libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.ReadPendingException;
+
+public class ReadPendingExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.ReadPendingException#ReadPendingException()
+     */
+    public void test_empty() {
+        ReadPendingException e = new ReadPendingException();
+        assertTrue(e instanceof IllegalStateException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/ShutdownChannelGroupExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/ShutdownChannelGroupExceptionTest.java
new file mode 100644
index 0000000..0d771cc
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/ShutdownChannelGroupExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 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 libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.ShutdownChannelGroupException;
+
+public class ShutdownChannelGroupExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.ShutdownChannelGroupException#ShutdownChannelGroupException()
+     */
+    public void test_empty() {
+        ShutdownChannelGroupException e = new ShutdownChannelGroupException();
+        assertTrue(e instanceof IllegalStateException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/WritePendingExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/WritePendingExceptionTest.java
new file mode 100644
index 0000000..463cf8c
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/WritePendingExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 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 libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.WritePendingException;
+
+public class WritePendingExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.WritePendingException#WritePendingException()
+     */
+    public void test_empty() {
+        WritePendingException e = new WritePendingException();
+        assertTrue(e instanceof IllegalStateException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/security/SecureRandomTest.java b/luni/src/test/java/libcore/java/security/SecureRandomTest.java
index e296775..7eb3b45 100644
--- a/luni/src/test/java/libcore/java/security/SecureRandomTest.java
+++ b/luni/src/test/java/libcore/java/security/SecureRandomTest.java
@@ -16,6 +16,7 @@
 
 package libcore.java.security;
 
+import java.security.NoSuchProviderException;
 import java.security.Provider;
 import java.security.SecureRandom;
 import java.security.Security;
@@ -24,6 +25,8 @@
 
 import junit.framework.TestCase;
 
+import dalvik.system.VMRuntime;
+
 public class SecureRandomTest extends TestCase {
     private static final String EXPECTED_PROVIDER = "com.android.org.conscrypt.OpenSSLProvider";
 
@@ -110,4 +113,65 @@
         assertEquals(EXPECTED_PROVIDER, sr2.getProvider().getClass().getName());
         test_SecureRandom(sr2);
     }
+
+    /**
+      * http://b/28550092 : Removal of "Crypto" provider in N caused application compatibility
+      * issues for callers of SecureRandom. To improve compatibility the provider is not registered
+      * as a JCA Provider obtainable via Security.getProvider() but is made available for
+      * SecureRandom.getInstance() iff the application targets API <= 23.
+      */
+    public void testCryptoProvider_withWorkaround_Success() throws Exception {
+        // Assert that SecureRandom is still using the default value. Sanity check.
+        assertEquals(SecureRandom.DEFAULT_SDK_TARGET_FOR_CRYPTO_PROVIDER_WORKAROUND,
+                SecureRandom.getSdkTargetForCryptoProviderWorkaround());
+
+        try {
+            // Modify the maximum target SDK to apply the workaround, thereby enabling the
+            // workaround for the current SDK and enabling it to be tested.
+            SecureRandom.setSdkTargetForCryptoProviderWorkaround(
+                    VMRuntime.getRuntime().getTargetSdkVersion());
+
+            // Assert that the crypto provider is not installed...
+            assertNull(Security.getProvider("Crypto"));
+            SecureRandom sr = SecureRandom.getInstance("SHA1PRNG", "Crypto");
+            assertNotNull(sr);
+            // ...but we can get a SecureRandom from it...
+            assertEquals("org.apache.harmony.security.provider.crypto.CryptoProvider",
+                    sr.getProvider().getClass().getName());
+            // ...yet it's not installed. So the workaround worked.
+            assertNull(Security.getProvider("Crypto"));
+        } finally {
+            // Reset the target SDK for the workaround to the default / real value.
+            SecureRandom.setSdkTargetForCryptoProviderWorkaround(
+                    SecureRandom.DEFAULT_SDK_TARGET_FOR_CRYPTO_PROVIDER_WORKAROUND);
+        }
+    }
+
+    /**
+     * http://b/28550092 : Removal of "Crypto" provider in N caused application compatibility
+     * issues for callers of SecureRandom. To improve compatibility the provider is not registered
+     * as a JCA Provider obtainable via Security.getProvider() but is made available for
+     * SecureRandom.getInstance() iff the application targets API <= 23.
+     */
+    public void testCryptoProvider_withoutWorkaround_Failure() throws Exception {
+        // Assert that SecureRandom is still using the default value. Sanity check.
+        assertEquals(SecureRandom.DEFAULT_SDK_TARGET_FOR_CRYPTO_PROVIDER_WORKAROUND,
+                SecureRandom.getSdkTargetForCryptoProviderWorkaround());
+
+        try {
+            // We set the limit SDK for the workaround at the previous one, indicating that the
+            // workaround shouldn't be in place.
+            SecureRandom.setSdkTargetForCryptoProviderWorkaround(
+                    VMRuntime.getRuntime().getTargetSdkVersion() - 1);
+
+            SecureRandom sr = SecureRandom.getInstance("SHA1PRNG", "Crypto");
+            fail("Should throw " + NoSuchProviderException.class.getName());
+        } catch(NoSuchProviderException expected) {
+            // The workaround doesn't work. As expected.
+        } finally {
+            // Reset the target SDK for the workaround to the default / real value.
+            SecureRandom.setSdkTargetForCryptoProviderWorkaround(
+                    SecureRandom.DEFAULT_SDK_TARGET_FOR_CRYPTO_PROVIDER_WORKAROUND);
+        }
+    }
 }
diff --git a/luni/src/test/java/libcore/javax/crypto/CipherTest.java b/luni/src/test/java/libcore/javax/crypto/CipherTest.java
index ad419ac..13c9ceb 100644
--- a/luni/src/test/java/libcore/javax/crypto/CipherTest.java
+++ b/luni/src/test/java/libcore/javax/crypto/CipherTest.java
@@ -28,7 +28,6 @@
 import java.security.Key;
 import java.security.KeyFactory;
 import java.security.KeyPairGenerator;
-import java.security.NoSuchAlgorithmException;
 import java.security.PrivateKey;
 import java.security.Provider;
 import java.security.PublicKey;
@@ -3335,6 +3334,76 @@
         }
     }
 
+    public void testCipher_DoFinal_wrapMode_Failure() throws Exception {
+        checkCipher_DoFinal_invalidMode_Failure(Cipher.WRAP_MODE);
+    }
+
+    public void testCipher_DoFinal_unwrapMode_Failure() throws Exception {
+        checkCipher_DoFinal_invalidMode_Failure(Cipher.UNWRAP_MODE);
+    }
+
+    /**
+     * Helper for testing that Cipher.doFinal() throws IllegalStateException when
+     * initialized in modes other than DECRYPT or ENCRYPT.
+     */
+    private static void checkCipher_DoFinal_invalidMode_Failure(int opmode) throws Exception {
+        String msg = String.format(Locale.US,
+                "doFinal() should throw IllegalStateException [mode=%d]", opmode);
+        int bs = createAesCipher(opmode).getBlockSize();
+        assertEquals(16, bs); // check test is set up correctly
+        try {
+            createAesCipher(opmode).doFinal();
+            fail(msg);
+        } catch (IllegalStateException expected) {
+        }
+
+        try {
+            createAesCipher(opmode).doFinal(new byte[0]);
+            fail(msg);
+        } catch (IllegalStateException expected) {
+        }
+
+        try {
+            createAesCipher(opmode).doFinal(new byte[2 * bs], 0, bs);
+            fail(msg);
+        } catch (IllegalStateException expected) {
+        }
+
+        try {
+            createAesCipher(opmode).doFinal(new byte[2 * bs], 0, bs, new byte[2 * bs], 0);
+            fail(msg);
+        } catch (IllegalStateException expected) {
+        }
+    }
+
+    public void testCipher_Update_wrapMode_Failure() throws Exception {
+        checkCipher_Update_invalidMode_Failure(Cipher.WRAP_MODE);
+    }
+
+    public void testCipher_Update_unwrapMode_Failure() throws Exception {
+        checkCipher_Update_invalidMode_Failure(Cipher.UNWRAP_MODE);
+    }
+
+    /**
+     * Helper for testing that Cipher.update() throws IllegalStateException when
+     * initialized in modes other than DECRYPT or ENCRYPT.
+     */
+    private static void checkCipher_Update_invalidMode_Failure(int opmode) throws Exception {
+        String msg = "update() should throw IllegalStateException [mode=" + opmode + "]";
+        int bs = createAesCipher(opmode).getBlockSize();
+        assertEquals(16, bs); // check test is set up correctly
+        assertIllegalStateException(msg, () -> createAesCipher(opmode).update(new byte[0]));
+        assertIllegalStateException(msg, () -> createAesCipher(opmode).update(new byte[2 * bs]));
+        assertIllegalStateException(msg, () -> createAesCipher(opmode).update(
+                new byte[2 * bs] /* input */, bs  /* inputOffset */, 0 /* inputLen */));
+        try {
+            createAesCipher(opmode).update(new byte[2*bs] /* input */, 0 /* inputOffset */,
+                    2 * bs /* inputLen */, new byte[2 * bs] /* output */, 0 /* outputOffset */);
+            fail(msg);
+        } catch (IllegalStateException expected) {
+        }
+    }
+
     public void testCipher_Update_WithZeroLengthInput_ReturnsNull() throws Exception {
         SecretKey key = new SecretKeySpec(AES_128_KEY, "AES");
         Cipher c = Cipher.getInstance("AES/ECB/NoPadding");
@@ -3346,6 +3415,63 @@
         assertNull(c.update(new byte[c.getBlockSize() * 2], 16, 0));
     }
 
+    public void testCipher_Wrap_decryptMode_Failure() throws Exception {
+        checkCipher_Wrap_invalidMode_Failure(Cipher.DECRYPT_MODE);
+    }
+
+    public void testCipher_Wrap_encryptMode_Failure() throws Exception {
+        checkCipher_Wrap_invalidMode_Failure(Cipher.ENCRYPT_MODE);
+    }
+
+    public void testCipher_Wrap_unwrapMode_Failure() throws Exception {
+        checkCipher_Wrap_invalidMode_Failure(Cipher.UNWRAP_MODE);
+    }
+
+    /**
+     * Helper for testing that Cipher.wrap() throws IllegalStateException when
+     * initialized in modes other than WRAP.
+     */
+    private static void checkCipher_Wrap_invalidMode_Failure(int opmode) throws Exception {
+        KeyGenerator kg = KeyGenerator.getInstance("AES");
+        kg.init(128);
+        SecretKey key = kg.generateKey();
+        Cipher cipher = createAesCipher(opmode);
+        try {
+            cipher.wrap(key);
+            fail("wrap() should throw IllegalStateException [mode=" + opmode + "]");
+        } catch (IllegalStateException expected) {
+        }
+    }
+
+    public void testCipher_Unwrap_decryptMode_Failure() throws Exception {
+        checkCipher_Unwrap_invalidMode_Failure(Cipher.DECRYPT_MODE);
+    }
+
+    public void testCipher_Unwrap_encryptMode_Failure() throws Exception {
+        checkCipher_Unwrap_invalidMode_Failure(Cipher.ENCRYPT_MODE);
+    }
+
+    public void testCipher_Unwrap_wrapMode_Failure() throws Exception {
+        checkCipher_Unwrap_invalidMode_Failure(Cipher.WRAP_MODE);
+    }
+
+    /**
+     * Helper for testing that Cipher.unwrap() throws IllegalStateException when
+     * initialized in modes other than UNWRAP.
+     */
+    private static void checkCipher_Unwrap_invalidMode_Failure(int opmode) throws Exception {
+        KeyGenerator kg = KeyGenerator.getInstance("AES");
+        kg.init(128);
+        SecretKey key = kg.generateKey();
+        Cipher cipher = createAesCipher(opmode);
+        byte[] wrappedKey = createAesCipher(Cipher.WRAP_MODE).wrap(key);
+        try {
+            cipher.unwrap(wrappedKey, key.getAlgorithm(), Cipher.PRIVATE_KEY);
+            fail("unwrap() should throw IllegalStateException [mode=" + opmode + "]");
+        } catch (IllegalStateException expected) {
+        }
+    }
+
     private void checkCipher_ShortBlock_Failure(CipherTestParam p, String provider) throws Exception {
         // Do not try to test ciphers with no padding already.
         String noPaddingTransform = getCipherTransformationWithNoPadding(p.transformation);
@@ -3751,4 +3877,29 @@
         cipher.init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(iv));
         assertEquals(Arrays.toString(plaintext), Arrays.toString(cipher.doFinal(ciphertext)));
     }
+
+    private static Cipher createAesCipher(int opmode) {
+        try {
+            SecretKey key = new SecretKeySpec(AES_128_KEY, "AES");
+            final Cipher c = Cipher.getInstance("AES/ECB/NoPadding");
+            c.init(opmode, key);
+            return c;
+        } catch (Exception e) {
+            fail("Unexpected Exception: " + e.getMessage());
+            return null; // unreachable
+        }
+    }
+
+    /**
+     * Asserts that running the given runnable results in an IllegalStateException
+     */
+    private static void assertIllegalStateException(String failureMessage, Runnable runnable) {
+        try {
+            runnable.run();
+            fail(failureMessage);
+        } catch (IllegalStateException expected) {
+            // expected
+        }
+    }
+
 }
diff --git a/luni/src/test/java/libcore/util/NativeAllocationRegistryTest.java b/luni/src/test/java/libcore/util/NativeAllocationRegistryTest.java
index b934c42..af45bfa 100644
--- a/luni/src/test/java/libcore/util/NativeAllocationRegistryTest.java
+++ b/luni/src/test/java/libcore/util/NativeAllocationRegistryTest.java
@@ -24,6 +24,8 @@
         System.loadLibrary("javacoretests");
     }
 
+    private ClassLoader classLoader = NativeAllocationRegistryTest.class.getClassLoader();
+
     private static class TestConfig {
         public boolean useAllocator;
         public boolean shareRegistry;
@@ -53,14 +55,15 @@
         final int nativeSize = size/2;
         int javaSize = size/2;
         NativeAllocationRegistry registry = new NativeAllocationRegistry(
-                getNativeFinalizer(), nativeSize);
+                classLoader, getNativeFinalizer(), nativeSize);
 
         // Allocate more native allocations than will fit in memory. This should
         // not throw OutOfMemoryError because the few allocations we save
         // references to should easily fit.
         for (int i = 0; i < expectedMaxNumAllocations * 10; i++) {
             if (!config.shareRegistry) {
-                registry = new NativeAllocationRegistry(getNativeFinalizer(), nativeSize);
+                registry = new NativeAllocationRegistry(
+                    classLoader, getNativeFinalizer(), nativeSize);
             }
 
             final Allocation alloc = new Allocation();
@@ -109,7 +112,7 @@
         assertThrowsIllegalArgumentException(new Runnable() {
             public void run() {
                 NativeAllocationRegistry registry = new NativeAllocationRegistry(
-                        getNativeFinalizer(), -8);
+                        classLoader, getNativeFinalizer(), -8);
             }
         });
     }
@@ -117,7 +120,7 @@
     public void testEarlyFree() {
         long size = 1234;
         NativeAllocationRegistry registry
-            = new NativeAllocationRegistry(getNativeFinalizer(), size);
+            = new NativeAllocationRegistry(classLoader, getNativeFinalizer(), size);
         long nativePtr = doNativeAllocation(size);
         Object referent = new Object();
         Runnable cleaner = registry.registerNativeAllocation(referent, nativePtr);
@@ -139,7 +142,7 @@
 
     public void testNullArguments() {
         final NativeAllocationRegistry registry
-            = new NativeAllocationRegistry(getNativeFinalizer(), 1024);
+            = new NativeAllocationRegistry(classLoader, getNativeFinalizer(), 1024);
         final long dummyNativePtr = 0x1;
         final Object referent = new Object();
 
diff --git a/non_openjdk_java_files.mk b/non_openjdk_java_files.mk
index c50d5ad..ff97f3a 100644
--- a/non_openjdk_java_files.mk
+++ b/non_openjdk_java_files.mk
@@ -421,6 +421,12 @@
   dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/DdmServer.java \
   dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/DdmVmInternal.java \
   luni/src/main/java/org/apache/harmony/luni/internal/util/TimezoneGetter.java \
+  luni/src/main/java/org/apache/harmony/security/PrivateKeyImpl.java \
+  luni/src/main/java/org/apache/harmony/security/PublicKeyImpl.java \
+  luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1Impl.java \
+  luni/src/main/java/org/apache/harmony/security/provider/crypto/CryptoProvider.java \
+  luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java \
+  luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1Constants.java \
   luni/src/main/java/org/apache/harmony/xml/ExpatAttributes.java \
   luni/src/main/java/org/apache/harmony/xml/ExpatException.java \
   luni/src/main/java/org/apache/harmony/xml/ExpatParser.java \
diff --git a/ojluni/src/main/java/java/io/ObjectInputStream.java b/ojluni/src/main/java/java/io/ObjectInputStream.java
index 3352266..419d095 100755
--- a/ojluni/src/main/java/java/io/ObjectInputStream.java
+++ b/ojluni/src/main/java/java/io/ObjectInputStream.java
@@ -202,7 +202,7 @@
  * @see java.io.DataInput
  * @see java.io.ObjectOutputStream
  * @see java.io.Serializable
- * @see <a href="{@docRoot}/../platform/serialization/spec/input.html"> Object Serialization Specification, Section 3, Object Input Classes</a>
+ * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/platform/serialization/spec/input.html"> Object Serialization Specification, Section 3, Object Input Classes</a>
  * @since   JDK1.1
  */
 public class ObjectInputStream
diff --git a/ojluni/src/main/java/java/io/ObjectOutputStream.java b/ojluni/src/main/java/java/io/ObjectOutputStream.java
index 5e5fbfa..f2abe23 100755
--- a/ojluni/src/main/java/java/io/ObjectOutputStream.java
+++ b/ojluni/src/main/java/java/io/ObjectOutputStream.java
@@ -158,7 +158,7 @@
  * @see java.io.ObjectInputStream
  * @see java.io.Serializable
  * @see java.io.Externalizable
- * @see <a href="{@docRoot}/../platform/serialization/spec/output.html">Object Serialization Specification, Section 2, Object Output Classes</a>
+ * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/platform/serialization/spec/output.html">Object Serialization Specification, Section 2, Object Output Classes</a>
  * @since       JDK1.1
  */
 public class ObjectOutputStream
diff --git a/ojluni/src/main/java/java/io/ObjectStreamClass.java b/ojluni/src/main/java/java/io/ObjectStreamClass.java
index 1491aac1..34bba48 100755
--- a/ojluni/src/main/java/java/io/ObjectStreamClass.java
+++ b/ojluni/src/main/java/java/io/ObjectStreamClass.java
@@ -60,13 +60,13 @@
  * loaded in this Java VM can be found/created using the lookup method.
  *
  * <p>The algorithm to compute the SerialVersionUID is described in
- * <a href="{@docRoot}/../platform/serialization/spec/class.html#4100">Object
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/platform/serialization/spec/class.html#4100">Object
  * Serialization Specification, Section 4.6, Stream Unique Identifiers</a>.
  *
  * @author      Mike Warres
  * @author      Roger Riggs
  * @see ObjectStreamField
- * @see <a href="{@docRoot}/../platform/serialization/spec/class.html">Object Serialization Specification, Section 4, Class Descriptors</a>
+ * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/platform/serialization/spec/class.html">Object Serialization Specification, Section 4, Class Descriptors</a>
  * @since   JDK1.1
  */
 public class ObjectStreamClass implements Serializable {
diff --git a/ojluni/src/main/java/java/io/package.html b/ojluni/src/main/java/java/io/package.html
index 72e458b..295da7f 100755
--- a/ojluni/src/main/java/java/io/package.html
+++ b/ojluni/src/main/java/java/io/package.html
@@ -36,7 +36,7 @@
 
 <h2>Package Specification</h2>
 <ul>
-  <li><a href="{@docRoot}/../platform/serialization/spec/serialTOC.html"> Java Object Serialization Specification </a>
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/platform/serialization/spec/serialTOC.html"> Java Object Serialization Specification </a>
 </ul>
 
 <h2>Related Documentation</h2>
@@ -44,7 +44,7 @@
 For overviews, tutorials, examples, guides, and tool documentation,
 please see:
 <ul>
-  <li><a href="{@docRoot}/../technotes/guides/serialization">Serialization Enhancements</a>
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/serialization">Serialization Enhancements</a>
 </ul>
 
 @since JDK1.0
diff --git a/ojluni/src/main/java/java/lang/AbstractStringBuilder.java b/ojluni/src/main/java/java/lang/AbstractStringBuilder.java
index 63606b3..aa71ca4 100755
--- a/ojluni/src/main/java/java/lang/AbstractStringBuilder.java
+++ b/ojluni/src/main/java/java/lang/AbstractStringBuilder.java
@@ -40,7 +40,7 @@
  * @author      Ulf Zibis
  * @since       1.5
  */
-abstract class AbstractStringBuilder implements Appendable, CharSequence {
+abstract class AbstractStringBuilder implements CharSequence {
     /**
      * The value is used for character storage.
      */
@@ -386,6 +386,7 @@
      *
      * @param   obj   an {@code Object}.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(Object obj) {
         return append(String.valueOf(obj));
@@ -408,6 +409,7 @@
      *
      * @param   str   a string.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(String str) {
         if (str == null) str = "null";
@@ -419,6 +421,7 @@
     }
 
     // Documentation in subclasses because of synchro difference
+    /** @hide */
     public AbstractStringBuilder append(StringBuffer sb) {
         if (sb == null)
             return append("null");
@@ -430,6 +433,7 @@
     }
 
     // Documentation in subclasses because of synchro difference
+    /** @hide */
     public AbstractStringBuilder append(CharSequence s) {
         if (s == null)
             s = "null";
@@ -468,6 +472,7 @@
      *             {@code start} is negative, or
      *             {@code start} is greater than {@code end} or
      *             {@code end} is greater than {@code s.length()}
+     * @hide
      */
     public AbstractStringBuilder append(CharSequence s, int start, int end) {
         if (s == null)
@@ -507,6 +512,7 @@
      *
      * @param   str   the characters to be appended.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(char[] str) {
         int len = str.length;
@@ -537,6 +543,7 @@
      * @throws IndexOutOfBoundsException
      *         if {@code offset < 0} or {@code len < 0}
      *         or {@code offset+len > str.length}
+     * @hide
      */
     public AbstractStringBuilder append(char str[], int offset, int len) {
         if (len > 0)                // let arraycopy report AIOOBE for len < 0
@@ -557,6 +564,7 @@
      *
      * @param   b   a {@code boolean}.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(boolean b) {
         if (b) {
@@ -592,6 +600,7 @@
      *
      * @param   c   a {@code char}.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(char c) {
         ensureCapacityInternal(count + 1);
@@ -610,6 +619,7 @@
      *
      * @param   i   an {@code int}.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(int i) {
         if (i == Integer.MIN_VALUE) {
@@ -636,6 +646,7 @@
      *
      * @param   l   a {@code long}.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(long l) {
         if (l == Long.MIN_VALUE) {
@@ -662,6 +673,7 @@
      *
      * @param   f   a {@code float}.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(float f) {
         FloatingDecimal.getThreadLocalInstance()
@@ -681,6 +693,7 @@
      *
      * @param   d   a {@code double}.
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder append(double d) {
         FloatingDecimal.getThreadLocalInstance()
@@ -702,6 +715,7 @@
      * @throws     StringIndexOutOfBoundsException  if {@code start}
      *             is negative, greater than {@code length()}, or
      *             greater than {@code end}.
+     * @hide
      */
     public AbstractStringBuilder delete(int start, int end) {
         if (start < 0)
@@ -736,6 +750,7 @@
      * @return  a reference to this object.
      * @exception IllegalArgumentException if the specified
      * {@code codePoint} isn't a valid Unicode code point
+     * @hide
      */
     public AbstractStringBuilder appendCodePoint(int codePoint) {
         final int count = this.count;
@@ -770,6 +785,7 @@
      * @throws      StringIndexOutOfBoundsException  if the <code>index</code>
      *              is negative or greater than or equal to
      *              <code>length()</code>.
+     * @hide
      */
     public AbstractStringBuilder deleteCharAt(int index) {
         if ((index < 0) || (index >= count))
@@ -797,6 +813,7 @@
      * @throws     StringIndexOutOfBoundsException  if <code>start</code>
      *             is negative, greater than <code>length()</code>, or
      *             greater than <code>end</code>.
+     * @hide
      */
     public AbstractStringBuilder replace(int start, int end, String str) {
         if (start < 0)
@@ -907,6 +924,7 @@
      *             {@code offset} or {@code len} are negative, or
      *             {@code (offset+len)} is greater than
      *             {@code str.length}.
+     * @hide
      */
     public AbstractStringBuilder insert(int index, char[] str, int offset,
                                         int len)
@@ -942,6 +960,7 @@
      * @param      obj      an {@code Object}.
      * @return     a reference to this object.
      * @throws     StringIndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, Object obj) {
         return insert(offset, String.valueOf(obj));
@@ -977,6 +996,7 @@
      * @param      str      a string.
      * @return     a reference to this object.
      * @throws     StringIndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, String str) {
         if ((offset < 0) || (offset > length()))
@@ -1014,6 +1034,7 @@
      * @param      str      a character array.
      * @return     a reference to this object.
      * @throws     StringIndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, char[] str) {
         if ((offset < 0) || (offset > length()))
@@ -1046,6 +1067,7 @@
      * @param      s the sequence to be inserted
      * @return     a reference to this object.
      * @throws     IndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int dstOffset, CharSequence s) {
         if (s == null)
@@ -1098,6 +1120,7 @@
      *              {@code start} or {@code end} are negative, or
      *              {@code start} is greater than {@code end} or
      *              {@code end} is greater than {@code s.length()}
+     * @hide
      */
      public AbstractStringBuilder insert(int dstOffset, CharSequence s,
                                          int start, int end) {
@@ -1137,6 +1160,7 @@
      * @param      b        a {@code boolean}.
      * @return     a reference to this object.
      * @throws     StringIndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, boolean b) {
         return insert(offset, String.valueOf(b));
@@ -1160,6 +1184,7 @@
      * @param      c        a {@code char}.
      * @return     a reference to this object.
      * @throws     IndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, char c) {
         ensureCapacityInternal(count + 1);
@@ -1187,6 +1212,7 @@
      * @param      i        an {@code int}.
      * @return     a reference to this object.
      * @throws     StringIndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, int i) {
         return insert(offset, String.valueOf(i));
@@ -1210,6 +1236,7 @@
      * @param      l        a {@code long}.
      * @return     a reference to this object.
      * @throws     StringIndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, long l) {
         return insert(offset, String.valueOf(l));
@@ -1233,6 +1260,7 @@
      * @param      f        a {@code float}.
      * @return     a reference to this object.
      * @throws     StringIndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, float f) {
         return insert(offset, String.valueOf(f));
@@ -1256,6 +1284,7 @@
      * @param      d        a {@code double}.
      * @return     a reference to this object.
      * @throws     StringIndexOutOfBoundsException  if the offset is invalid.
+     * @hide
      */
     public AbstractStringBuilder insert(int offset, double d) {
         return insert(offset, String.valueOf(d));
@@ -1369,6 +1398,7 @@
      * a valid surrogate pair.
      *
      * @return  a reference to this object.
+     * @hide
      */
     public AbstractStringBuilder reverse() {
         boolean hasSurrogate = false;
@@ -1408,6 +1438,7 @@
      * <code>String</code>.
      *
      * @return  a string representation of this sequence of characters.
+     * @hide
      */
     public abstract String toString();
 
diff --git a/ojluni/src/main/java/java/lang/Comparable.java b/ojluni/src/main/java/java/lang/Comparable.java
index d853197..c049323 100755
--- a/ojluni/src/main/java/java/lang/Comparable.java
+++ b/ojluni/src/main/java/java/lang/Comparable.java
@@ -84,7 +84,7 @@
  *     {(x, y) such that x.equals(y)}. </pre><p>
  *
  * This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <T> the type of objects that this object may be compared to
diff --git a/ojluni/src/main/java/java/lang/Iterable.java b/ojluni/src/main/java/java/lang/Iterable.java
index eed3938..b897d07 100644
--- a/ojluni/src/main/java/java/lang/Iterable.java
+++ b/ojluni/src/main/java/java/lang/Iterable.java
@@ -34,7 +34,7 @@
  * Implementing this interface allows an object to be the target of
  * the "for-each loop" statement. See
  * <strong>
- * <a href="{@docRoot}/../technotes/guides/language/foreach.html">For-each Loop</a>
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/language/foreach.html">For-each Loop</a>
  * </strong>
  *
  * @param <T> the type of elements returned by the iterator
diff --git a/ojluni/src/main/java/java/lang/StringBuffer.java b/ojluni/src/main/java/java/lang/StringBuffer.java
index e66dbce..d832881 100755
--- a/ojluni/src/main/java/java/lang/StringBuffer.java
+++ b/ojluni/src/main/java/java/lang/StringBuffer.java
@@ -82,7 +82,7 @@
  */
  public final class StringBuffer
     extends AbstractStringBuilder
-    implements java.io.Serializable, CharSequence
+    implements java.io.Serializable, Appendable, CharSequence
 {
 
     /** use serialVersionUID from JDK 1.0.2 for interoperability */
diff --git a/ojluni/src/main/java/java/lang/StringBuilder.java b/ojluni/src/main/java/java/lang/StringBuilder.java
index 6712b41..e16522d 100755
--- a/ojluni/src/main/java/java/lang/StringBuilder.java
+++ b/ojluni/src/main/java/java/lang/StringBuilder.java
@@ -72,7 +72,7 @@
  */
 public final class StringBuilder
     extends AbstractStringBuilder
-    implements java.io.Serializable, CharSequence
+    implements java.io.Serializable, Appendable, CharSequence
 {
 
     /** use serialVersionUID for interoperability */
diff --git a/ojluni/src/main/java/java/lang/Thread.java b/ojluni/src/main/java/java/lang/Thread.java
index 1436dd4..cff47dc 100755
--- a/ojluni/src/main/java/java/lang/Thread.java
+++ b/ojluni/src/main/java/java/lang/Thread.java
@@ -844,7 +844,7 @@
      *       for example), the <code>interrupt</code> method should be used to
      *       interrupt the wait.
      *       For more information, see
-     *       <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
+     *       <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
      *       are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      */
     @Deprecated
@@ -898,7 +898,7 @@
      *        exceptions that the thread could not possibly throw, were it
      *        not for this method).
      *        For more information, see
-     *        <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
+     *        <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
      *        are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      */
     @Deprecated
@@ -1007,7 +1007,7 @@
      *     If another thread ever attempted to lock this resource, deadlock
      *     would result. Such deadlocks typically manifest themselves as
      *     "frozen" processes. For more information, see
-     *     <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">
+     *     <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/concurrency/threadPrimitiveDeprecation.html">
      *     Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      * @throws UnsupportedOperationException always
      */
@@ -1050,7 +1050,7 @@
      *   monitor prior to calling <code>resume</code>, deadlock results.  Such
      *   deadlocks typically manifest themselves as "frozen" processes.
      *   For more information, see
-     *   <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
+     *   <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
      *   are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      */
     @Deprecated
@@ -1075,7 +1075,7 @@
      * @deprecated This method exists solely for use with {@link #suspend},
      *     which has been deprecated because it is deadlock-prone.
      *     For more information, see
-     *     <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
+     *     <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
      *     are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      */
     @Deprecated
diff --git a/ojluni/src/main/java/java/lang/UnsupportedOperationException.java b/ojluni/src/main/java/java/lang/UnsupportedOperationException.java
index fcb355c..15b7c6d 100755
--- a/ojluni/src/main/java/java/lang/UnsupportedOperationException.java
+++ b/ojluni/src/main/java/java/lang/UnsupportedOperationException.java
@@ -29,7 +29,7 @@
  * Thrown to indicate that the requested operation is not supported.<p>
  *
  * This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author  Josh Bloch
diff --git a/ojluni/src/main/java/java/net/Inet4Address.java b/ojluni/src/main/java/java/net/Inet4Address.java
index 57da1c4..1570fad 100755
--- a/ojluni/src/main/java/java/net/Inet4Address.java
+++ b/ojluni/src/main/java/java/net/Inet4Address.java
@@ -106,13 +106,6 @@
     public static final InetAddress LOOPBACK =
             new Inet4Address("localhost", new byte[] { 127, 0, 0, 1 });
 
-    /*
-     * Perform initializations.
-     */
-    static {
-        init();
-    }
-
     Inet4Address() {
         super();
         holder().hostName = null;
@@ -386,9 +379,4 @@
     {
         return (src[0] & 0xff) + "." + (src[1] & 0xff) + "." + (src[2] & 0xff) + "." + (src[3] & 0xff);
     }
-
-    /**
-     * Perform class load-time initializations.
-     */
-    private static native void init();
 }
diff --git a/ojluni/src/main/java/java/net/Inet6Address.java b/ojluni/src/main/java/java/net/Inet6Address.java
index f66b68d..4b353e5 100755
--- a/ojluni/src/main/java/java/net/Inet6Address.java
+++ b/ojluni/src/main/java/java/net/Inet6Address.java
@@ -210,13 +210,6 @@
 
     private static final long serialVersionUID = 6880410070516793377L;
 
-    /*
-     * Perform initializations.
-     */
-    static {
-        init();
-    }
-
     Inet6Address() {
         super();
         holder().hostName = null;
@@ -768,11 +761,6 @@
     }
 
     /**
-     * Perform class load-time initializations.
-     */
-    private static native void init();
-
-    /**
      * Following field is only used during (de)/serialization
      */
     private String ifname;
diff --git a/ojluni/src/main/java/java/net/InetAddress.java b/ojluni/src/main/java/java/net/InetAddress.java
index d8057ff..3ea1086 100755
--- a/ojluni/src/main/java/java/net/InetAddress.java
+++ b/ojluni/src/main/java/java/net/InetAddress.java
@@ -246,13 +246,6 @@
     /** use serialVersionUID from JDK 1.0.2 for interoperability */
     private static final long serialVersionUID = 3286316764910316507L;
 
-    /*
-     * Load net library into runtime, and perform initializations.
-     */
-    static {
-        init();
-    }
-
     /**
      * Constructor for the Socket.accept() method.
      * This creates an empty InetAddress, which is filled in by
@@ -823,12 +816,6 @@
         return impl.lookupAllHostAddr(local, NETID_UNSET)[0];
     }
 
-    /**
-     * Perform class load-time initializations.
-     */
-    private static native void init();
-
-
     /*
      * Returns the InetAddress representing anyLocalAddress
      * (typically 0.0.0.0 or ::0)
diff --git a/ojluni/src/main/java/java/net/NetworkInterface.java b/ojluni/src/main/java/java/net/NetworkInterface.java
index 1f5825f..edae4b3 100755
--- a/ojluni/src/main/java/java/net/NetworkInterface.java
+++ b/ojluni/src/main/java/java/net/NetworkInterface.java
@@ -54,7 +54,6 @@
     private static final int defaultIndex; /* index of defaultInterface */
 
     static {
-        init();
         defaultInterface = DefaultInterface.getDefault();
         if (defaultInterface != null) {
             defaultIndex = defaultInterface.getIndex();
@@ -541,8 +540,6 @@
         return result;
     }
 
-    private static native void init();
-
     /**
      * Returns the default network interface of this system
      *
diff --git a/ojluni/src/main/java/java/net/PlainSocketImpl.java b/ojluni/src/main/java/java/net/PlainSocketImpl.java
index 32be8e5..b6a2677 100755
--- a/ojluni/src/main/java/java/net/PlainSocketImpl.java
+++ b/ojluni/src/main/java/java/net/PlainSocketImpl.java
@@ -36,10 +36,6 @@
 
 class PlainSocketImpl extends AbstractPlainSocketImpl
 {
-    static {
-        initProto();
-    }
-
     /**
      * Constructs an empty instance.
      */
@@ -72,8 +68,6 @@
 
     native void socketShutdown(int howto) throws IOException;
 
-    static native void initProto();
-
     native void socketSetOption(int cmd, boolean on, Object value)
         throws SocketException;
 
diff --git a/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java b/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java
index b85eac0..5bc43a4 100755
--- a/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java
+++ b/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java
@@ -66,19 +66,15 @@
  * default modulus prime size of 1024 bits for the generation of DSA
  * parameters.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>AlgorithmParameterGenerator</code> algorithms and
- * keysizes in parentheses:
+ * <p> Latest Android version provides the following <code>AlgorithmParameterGenerator</code> algorithms:
  * <ul>
- * <li><tt>DiffieHellman</tt> (1024)</li>
- * <li><tt>DSA</tt> (1024)</li>
+ * <li><tt>DH</tt></li>
+ * <li><tt>DSA</tt></li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
  * AlgorithmParameterGenerator section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Jan Luehe
  *
@@ -141,7 +137,7 @@
      * @param algorithm the name of the algorithm this
      * parameter generator is associated with.
      * See the AlgorithmParameterGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -183,7 +179,7 @@
      * @param algorithm the name of the algorithm this
      * parameter generator is associated with.
      * See the AlgorithmParameterGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -229,7 +225,7 @@
      * @param algorithm the string name of the algorithm this
      * parameter generator is associated with.
      * See the AlgorithmParameterGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/AlgorithmParameters.java b/ojluni/src/main/java/java/security/AlgorithmParameters.java
index 36ba66e..82f30bc 100755
--- a/ojluni/src/main/java/java/security/AlgorithmParameters.java
+++ b/ojluni/src/main/java/java/security/AlgorithmParameters.java
@@ -46,21 +46,23 @@
  * <code>getParameterSpec</code>, and a byte encoding of the parameters is
  * obtained via a call to <code>getEncoded</code>.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>AlgorithmParameters</code> algorithms:
+ * <p> Latest Android version provides the following <code>AlgorithmParameters</code> algorithms:
  * <ul>
  * <li><tt>AES</tt></li>
+ * <li><tt>BLOWFISH</tt></li>
  * <li><tt>DES</tt></li>
- * <li><tt>DESede</tt></li>
- * <li><tt>DiffieHellman</tt></li>
+ * <li><tt>DESEDE</tt></li>
+ * <li><tt>DH</tt></li>
  * <li><tt>DSA</tt></li>
+ * <li><tt>GCM</tt></li>
+ * <li><tt>OAEP</tt></li>
+ * <li><tt>PKCS12PBE</tt></li>
+ * <li><tt>PSS</tt></li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#AlgorithmParameters">
  * AlgorithmParameters section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Jan Luehe
  *
@@ -128,7 +130,7 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the AlgorithmParameters section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#AlgorithmParameters">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -170,7 +172,7 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the AlgorithmParameters section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#AlgorithmParameters">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -217,7 +219,7 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the AlgorithmParameters section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#AlgorithmParameters">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/Key.java b/ojluni/src/main/java/java/security/Key.java
index 9322710..e346b10 100755
--- a/ojluni/src/main/java/java/security/Key.java
+++ b/ojluni/src/main/java/java/security/Key.java
@@ -83,7 +83,7 @@
  * <p> A Key should use KeyRep as its serialized representation.
  * Note that a serialized Key may contain sensitive information
  * which should not be exposed in untrusted environments.  See the
- * <a href="{@docRoot}/../platform/serialization/spec/security.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/platform/serialization/spec/security.html">
  * Security Appendix</a>
  * of the Serialization Specification for more information.
  *
@@ -115,7 +115,7 @@
      * Returns the standard algorithm name for this key. For
      * example, "DSA" would indicate that this key is a DSA key.
      * See Appendix A in the <a href=
-     * "../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      * Java Cryptography Architecture API Specification &amp; Reference </a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/KeyFactory.java b/ojluni/src/main/java/java/security/KeyFactory.java
index 78ccfcf..a964ae8d 100755
--- a/ojluni/src/main/java/java/security/KeyFactory.java
+++ b/ojluni/src/main/java/java/security/KeyFactory.java
@@ -67,19 +67,17 @@
  * sig.verify(signature);
  * </pre>
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>KeyFactory</code> algorithms:
+ * <p> Latest Android version provides the following <code>KeyFactory</code> algorithms:
  * <ul>
- * <li><tt>DiffieHellman</tt></li>
+ * <li><tt>DH</tt></li>
  * <li><tt>DSA</tt></li>
+ * <li><tt>EC</tt></li>
  * <li><tt>RSA</tt></li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyFactory">
  * KeyFactory section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Jan Luehe
  *
@@ -155,7 +153,7 @@
      *
      * @param algorithm the name of the requested key algorithm.
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -186,7 +184,7 @@
      *
      * @param algorithm the name of the requested key algorithm.
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -225,7 +223,7 @@
      *
      * @param algorithm the name of the requested key algorithm.
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/KeyPairGenerator.java b/ojluni/src/main/java/java/security/KeyPairGenerator.java
index 2d7f427..e7f17f3 100755
--- a/ojluni/src/main/java/java/security/KeyPairGenerator.java
+++ b/ojluni/src/main/java/java/security/KeyPairGenerator.java
@@ -105,20 +105,17 @@
  * the superclass are intended for cryptographic service providers who wish to
  * supply their own implementations of key pair generators.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>KeyPairGenerator</code> algorithms and keysizes in
- * parentheses:
+ * <p> Latest Android version provides the following <code>KeyPairGenerator</code> algorithms:
  * <ul>
- * <li><tt>DiffieHellman</tt> (1024)</li>
- * <li><tt>DSA</tt> (1024)</li>
- * <li><tt>RSA</tt> (1024, 2048)</li>
+ * <li><tt>DH</tt></li>
+ * <li><tt>DSA</tt></li>
+ * <li><tt>EC</tt></li>
+ * <li><tt>RSA</tt></li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyPairGenerator">
  * KeyPairGenerator section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Benjamin Renaud
  *
@@ -137,7 +134,7 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyPairGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      */
@@ -148,7 +145,7 @@
     /**
      * Returns the standard name of the algorithm for this key pair generator.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyPairGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -186,7 +183,7 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyPairGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -242,7 +239,7 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyPairGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -281,7 +278,7 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyPairGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/KeyRep.java b/ojluni/src/main/java/java/security/KeyRep.java
index 20e3e2f..80a9b03 100755
--- a/ojluni/src/main/java/java/security/KeyRep.java
+++ b/ojluni/src/main/java/java/security/KeyRep.java
@@ -41,7 +41,7 @@
  *
  * Note that a serialized Key may contain sensitive information
  * which should not be exposed in untrusted environments.  See the
- * <a href="{@docRoot}/../platform/serialization/spec/security.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/platform/serialization/spec/security.html">
  * Security Appendix</a>
  * of the Serialization Specification for more information.
  *
diff --git a/ojluni/src/main/java/java/security/KeyStore.java b/ojluni/src/main/java/java/security/KeyStore.java
index 60dba96..581572f 100755
--- a/ojluni/src/main/java/java/security/KeyStore.java
+++ b/ojluni/src/main/java/java/security/KeyStore.java
@@ -164,17 +164,17 @@
  * different passwords or other protection parameters
  * may also be used.
  *
- * <p> Every implementation of the Java platform is required to support
- * the following standard <code>KeyStore</code> type:
+ * <p> Latest Android version provides the following <code>KeyStore</code> type:
  * <ul>
+ * <li><tt>ANDROIDCASTORE</tt></li>
+ * <li><tt>BKS</tt></li>
+ * <li><tt>BOUNCYCASTLE</tt></li>
  * <li><tt>PKCS12</tt></li>
  * </ul>
  * This type is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyStore">
  * KeyStore section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other types are supported.
  *
  * @author Jan Luehe
  *
@@ -594,7 +594,7 @@
      *
      * @param type the type of keystore.
      * See the KeyStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyStore">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard keystore types.
      *
@@ -632,7 +632,7 @@
      *
      * @param type the type of keystore.
      * See the KeyStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyStore">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard keystore types.
      *
@@ -675,7 +675,7 @@
      *
      * @param type the type of keystore.
      * See the KeyStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyStore">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard keystore types.
      *
diff --git a/ojluni/src/main/java/java/security/MessageDigest.java b/ojluni/src/main/java/java/security/MessageDigest.java
index a19fb85..6d0f8bf 100755
--- a/ojluni/src/main/java/java/security/MessageDigest.java
+++ b/ojluni/src/main/java/java/security/MessageDigest.java
@@ -81,19 +81,19 @@
  * the superclass are intended for cryptographic service providers who wish to
  * supply their own implementations of message digest algorithms.
  *
- * <p> Every implementation of the Java platform is required to support
- * the following standard <code>MessageDigest</code> algorithms:
+ * <p> Latest Android version provides the following <code>MessageDigest</code> algorithms:
  * <ul>
- * <li><tt>MD5</tt></li>
- * <li><tt>SHA-1</tt></li>
- * <li><tt>SHA-256</tt></li>
+ *   <li><tt>MD5</tt></li>
+ *   <li><tt>SHA-1</tt></li>
+ *   <li><tt>SHA-224</tt></li>
+ *   <li><tt>SHA-256</tt></li>
+ *   <li><tt>SHA-384</tt></li>
+ *   <li><tt>SHA-512</tt></li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#MessageDigest">
  * MessageDigest section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Benjamin Renaud
  *
@@ -118,7 +118,7 @@
      *
      * @param algorithm the standard name of the digest algorithm.
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#MessageDigest">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      */
@@ -141,7 +141,7 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#MessageDigest">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -187,7 +187,7 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#MessageDigest">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -236,7 +236,7 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#MessageDigest">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -456,7 +456,7 @@
      * implementation details. The name should be a standard
      * Java Security name (such as "SHA", "MD5", and so on).
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#MessageDigest">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/Provider.java b/ojluni/src/main/java/java/security/Provider.java
index b6d84e7..784cbf1 100755
--- a/ojluni/src/main/java/java/security/Provider.java
+++ b/ojluni/src/main/java/java/security/Provider.java
@@ -56,7 +56,7 @@
  * in each runtime it is installed in.
  *
  * <p>See <a href =
- * "../../../technotes/guides/security/crypto/CryptoSpec.html#Provider">The Provider Class</a>
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#Provider">The Provider Class</a>
  * in the "Java Cryptography Architecture API Specification &amp; Reference"
  * for information about how a particular type of provider, the
  * cryptographic service provider, works and is installed. However,
@@ -766,7 +766,7 @@
      * it is replaced by the new service.
      * This method also places information about this service
      * in the provider's Hashtable values in the format described in the
-     * <a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+     * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
      * Java Cryptography Architecture API Specification &amp; Reference </a>.
      *
      * <p>Also, if there is a security manager, its
@@ -1045,7 +1045,7 @@
      * suitable services and instantes them. The valid arguments to those
      * methods depend on the type of service. For the service types defined
      * within Java SE, see the
-     * <a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+     * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
      * Java Cryptography Architecture API Specification &amp; Reference </a>
      * for the valid values.
      * Note that components outside of Java SE can define additional types of
@@ -1222,7 +1222,7 @@
          * instantiation in a different way.
          * For details and the values of constructorParameter that are
          * valid for the various types of services see the
-         * <a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+         * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
          * Java Cryptography Architecture API Specification &amp;
          * Reference</a>.
          *
@@ -1359,7 +1359,7 @@
          *
          * <p>For details and the values of parameter that are valid for the
          * various types of services see the top of this class and the
-         * <a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+         * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
          * Java Cryptography Architecture API Specification &amp;
          * Reference</a>.
          * Security providers can override it to implement their own test.
diff --git a/ojluni/src/main/java/java/security/SecureRandom.java b/ojluni/src/main/java/java/security/SecureRandom.java
index dd84618..a9566e7 100755
--- a/ojluni/src/main/java/java/security/SecureRandom.java
+++ b/ojluni/src/main/java/java/security/SecureRandom.java
@@ -28,7 +28,9 @@
 import java.util.*;
 
 import java.security.Provider.Service;
+import java.util.function.Function;
 
+import dalvik.system.VMRuntime;
 import sun.security.jca.*;
 import sun.security.jca.GetInstance.Instance;
 
@@ -134,7 +136,7 @@
      * the {@link Security#getProviders() Security.getProviders()} method.
      *
      * <p> See the SecureRandom section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecureRandom">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard RNG algorithm names.
      *
@@ -172,7 +174,7 @@
      * the {@link Security#getProviders() Security.getProviders()} method.
      *
      * <p> See the SecureRandom section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecureRandom">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard RNG algorithm names.
      *
@@ -257,7 +259,7 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the SecureRandom section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecureRandom">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard RNG algorithm names.
      *
@@ -280,6 +282,39 @@
     }
 
     /**
+     * Maximum SDK version for which the workaround for the Crypto provider is in place.
+     *
+     * <p> We provide instances from the Crypto provider (although the provider is not installed) to
+     * apps targeting M or earlier versions of the SDK.
+     *
+     * <p> Default is 23 (M). We have it as a field for testability and it shouldn't be changed.
+     *
+     * @hide
+     */
+    public static final int DEFAULT_SDK_TARGET_FOR_CRYPTO_PROVIDER_WORKAROUND = 23;
+
+    private static int sdkTargetForCryptoProviderWorkaround =
+            DEFAULT_SDK_TARGET_FOR_CRYPTO_PROVIDER_WORKAROUND;
+
+    /**
+     * Only for testing.
+     *
+     * @hide
+     */
+    public static void setSdkTargetForCryptoProviderWorkaround(int sdkTargetVersion) {
+        sdkTargetForCryptoProviderWorkaround = sdkTargetVersion;
+    }
+
+    /**
+     * Only for testing.
+     *
+     * @hide
+     */
+    public static int getSdkTargetForCryptoProviderWorkaround() {
+        return sdkTargetForCryptoProviderWorkaround;
+    }
+
+    /**
      * Returns a SecureRandom object that implements the specified
      * Random Number Generator (RNG) algorithm.
      *
@@ -300,7 +335,7 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the SecureRandom section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecureRandom">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard RNG algorithm names.
      *
@@ -333,18 +368,39 @@
             if ("Crypto".equals(provider)) {
                 System.logE(" ********** PLEASE READ ************ ");
                 System.logE(" * ");
-                System.logE(" * Android N no longer ships with the Crypto provider.");
+                System.logE(" * New versions of the Android SDK no longer support the Crypto provider.");
                 System.logE(" * If your app was relying on setSeed() to derive keys from strings, you");
                 System.logE(" * should switch to using SecretKeySpec to load raw key bytes directly OR");
                 System.logE(" * use a real key derivation function (KDF). See advice here : ");
                 System.logE(" * https://stackoverflow.com/questions/13433529/android-4-2-broke-my-encrypt-decrypt-code-and-the-provided-solutions-dont-work ");
                 System.logE(" *********************************** ");
+                if (VMRuntime.getRuntime().getTargetSdkVersion()
+                        <= sdkTargetForCryptoProviderWorkaround) {
+                    return getInstanceFromCryptoProvider(algorithm);
+                }
             }
 
             throw nspe;
         }
     }
 
+    private static SecureRandom getInstanceFromCryptoProvider(String algorithm)
+            throws NoSuchAlgorithmException {
+        Provider cryptoProvider;
+        try {
+            cryptoProvider = (Provider) SecureRandom.class.getClassLoader()
+                    .loadClass(
+                            "org.apache.harmony.security.provider.crypto.CryptoProvider")
+                    .newInstance();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        Service service = cryptoProvider.getService("SecureRandom", algorithm);
+        Instance instance = GetInstance.getInstance(service, SecureRandomSpi.class);
+        return new SecureRandom(
+                (SecureRandomSpi) instance.impl, instance.provider, algorithm);
+    }
+
     /**
      * Returns a SecureRandom object that implements the specified
      * Random Number Generator (RNG) algorithm.
@@ -363,7 +419,7 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the SecureRandom section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecureRandom">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard RNG algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/Security.java b/ojluni/src/main/java/java/security/Security.java
index b7f7ca9..003fb81 100755
--- a/ojluni/src/main/java/java/security/Security.java
+++ b/ojluni/src/main/java/java/security/Security.java
@@ -168,7 +168,7 @@
     /**
      * Gets a specified property for an algorithm. The algorithm name
      * should be a standard name. See the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -407,7 +407,7 @@
      * </ul>
      *
      * <p> See the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard cryptographic service names, standard
      * algorithm names and standard attribute names.
@@ -475,7 +475,7 @@
      * </ul>
      *
      * <p> See the <a href=
-     * "../../../technotes/guides/security/StandardNames.html">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard cryptographic service names, standard
      * algorithm names and standard attribute names.
@@ -953,7 +953,7 @@
      * an empty Set if there is no provider that supports the
      * specified service or if serviceName is null. For a complete list
      * of Java cryptographic services, please see the
-     * <a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">Java
+     * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">Java
      * Cryptography Architecture API Specification &amp; Reference</a>.
      * Note: the returned set is immutable.
      *
diff --git a/ojluni/src/main/java/java/security/Signature.java b/ojluni/src/main/java/java/security/Signature.java
index e9a5886..e805991 100755
--- a/ojluni/src/main/java/java/security/Signature.java
+++ b/ojluni/src/main/java/java/security/Signature.java
@@ -99,19 +99,35 @@
  * the superclass are intended for cryptographic service providers who wish to
  * supply their own implementations of digital signature algorithms.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>Signature</code> algorithms:
+ * <p> Latest Android version provides the following <code>Signature</code> algorithms:
  * <ul>
+ * <li><tt>MD5withRSA</tt></li>
+ * <li><tt>NONEwithDSA</tt></li>
+ * <li><tt>NONEwithECDSA</tt></li>
+ * <li><tt>NONEwithRSA</tt></li>
  * <li><tt>SHA1withDSA</tt></li>
+ * <li><tt>SHA1withECDSA</tt></li>
  * <li><tt>SHA1withRSA</tt></li>
+ * <li><tt>SHA1withRSA/PSS</tt></li>
+ * <li><tt>SHA224withDSA</tt></li>
+ * <li><tt>SHA224withECDSA</tt></li>
+ * <li><tt>SHA224withRSA</tt></li>
+ * <li><tt>SHA224withRSA/PSS</tt></li>
+ * <li><tt>SHA256withDSA</tt></li>
+ * <li><tt>SHA256withECDSA</tt></li>
  * <li><tt>SHA256withRSA</tt></li>
+ * <li><tt>SHA256withRSA/PSS</tt></li>
+ * <li><tt>SHA384withECDSA</tt></li>
+ * <li><tt>SHA384withRSA</tt></li>
+ * <li><tt>SHA384withRSA/PSS</tt></li>
+ * <li><tt>SHA512withECDSA</tt></li>
+ * <li><tt>SHA512withRSA</tt></li>
+ * <li><tt>SHA512withRSA/PSS</tt></li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Signature">
  * Signature section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Benjamin Renaud
  *
@@ -160,7 +176,7 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the Signature section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Signature">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      */
@@ -200,7 +216,7 @@
      *
      * @param algorithm the standard name of the algorithm requested.
      * See the Signature section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Signature">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -319,7 +335,7 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the Signature section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Signature">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -369,7 +385,7 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the Signature section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Signature">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/cert/CRL.java b/ojluni/src/main/java/java/security/cert/CRL.java
index f8083c7..725d7b5 100755
--- a/ojluni/src/main/java/java/security/cert/CRL.java
+++ b/ojluni/src/main/java/java/security/cert/CRL.java
@@ -53,7 +53,7 @@
      *
      * @param type the standard name of the CRL type.
      * See Appendix A in the <a href=
-     * "../../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      * Java Cryptography Architecture API Specification &amp; Reference </a>
      * for information about standard CRL types.
      */
diff --git a/ojluni/src/main/java/java/security/cert/CertPath.java b/ojluni/src/main/java/java/security/cert/CertPath.java
index 052be20..600000a 100755
--- a/ojluni/src/main/java/java/security/cert/CertPath.java
+++ b/ojluni/src/main/java/java/security/cert/CertPath.java
@@ -91,7 +91,7 @@
  * <li><tt>PkiPath</tt></li>
  * </ul>
  * These encodings are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
  * CertPath Encodings section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
  * Consult the release documentation for your implementation to see if any
diff --git a/ojluni/src/main/java/java/security/cert/CertPathBuilder.java b/ojluni/src/main/java/java/security/cert/CertPathBuilder.java
index 6008e9e..a84d9ab 100755
--- a/ojluni/src/main/java/java/security/cert/CertPathBuilder.java
+++ b/ojluni/src/main/java/java/security/cert/CertPathBuilder.java
@@ -66,17 +66,14 @@
  * CertPathBuilderResult cpbr = cpb.build(params);
  * </pre>
  *
- * <p>Every implementation of the Java platform is required to support the
- * following standard {@code CertPathBuilder} algorithm:
+ * <p> Latest Android version provides the following {@code CertPathBuilder} algorithm:
  * <ul>
  * <li>{@code PKIX}</li>
  * </ul>
  * This algorithm is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathBuilder">
  * CertPathBuilder section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * <p>
  * <b>Concurrent Access</b>
@@ -144,7 +141,7 @@
      *
      * @param algorithm the name of the requested {@code CertPathBuilder}
      *  algorithm.  See the CertPathBuilder section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathBuilder">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -179,7 +176,7 @@
      *
      * @param algorithm the name of the requested {@code CertPathBuilder}
      *  algorithm.  See the CertPathBuilder section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathBuilder">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -219,7 +216,7 @@
      *
      * @param algorithm the name of the requested {@code CertPathBuilder}
      *  algorithm.  See the CertPathBuilder section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathBuilder">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/cert/CertPathValidator.java b/ojluni/src/main/java/java/security/cert/CertPathValidator.java
index bd2ff56..1214b92 100755
--- a/ojluni/src/main/java/java/security/cert/CertPathValidator.java
+++ b/ojluni/src/main/java/java/security/cert/CertPathValidator.java
@@ -68,17 +68,14 @@
  * CertPathValidatorResult cpvr = cpv.validate(path, params);
  * </pre>
  *
- * <p>Every implementation of the Java platform is required to support the
- * following standard {@code CertPathValidator} algorithm:
+ * <p> Latest Android version provides the following {@code CertPathValidator} algorithm:
  * <ul>
  * <li>{@code PKIX}</li>
  * </ul>
  * This algorithm is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathValidator">
  * CertPathValidator section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * <p>
  * <b>Concurrent Access</b>
@@ -145,7 +142,7 @@
      *
      * @param algorithm the name of the requested {@code CertPathValidator}
      *  algorithm. See the CertPathValidator section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathValidator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -180,7 +177,7 @@
      *
      * @param algorithm the name of the requested {@code CertPathValidator}
      *  algorithm. See the CertPathValidator section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathValidator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -221,7 +218,7 @@
      *
      * @param algorithm the name of the requested {@code CertPathValidator}
      * algorithm. See the CertPathValidator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathValidator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/java/security/cert/CertStore.java b/ojluni/src/main/java/java/security/cert/CertStore.java
index 989d181..5f8a8af 100755
--- a/ojluni/src/main/java/java/security/cert/CertStore.java
+++ b/ojluni/src/main/java/java/security/cert/CertStore.java
@@ -60,17 +60,14 @@
  * and CRLs stored in one or more directories using the LDAP protocol and the
  * schema as defined in the RFC service attribute.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>CertStore</code> type:
+ * <p> Latest Android version provides the following <code>CertStore</code> type:
  * <ul>
  * <li><tt>Collection</tt></li>
  * </ul>
  * This type is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertStore">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertStore">
  * CertStore section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other types are supported.
  *
  * <p>
  * <b>Concurrent Access</b>
@@ -203,7 +200,7 @@
      *
      * @param type the name of the requested <code>CertStore</code> type.
      * See the CertStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertStore">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertStore">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard types.
      *
@@ -263,7 +260,7 @@
      *
      * @param type the requested <code>CertStore</code> type.
      * See the CertStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertStore">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertStore">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard types.
      *
@@ -321,7 +318,7 @@
      *
      * @param type the requested <code>CertStore</code> type.
      * See the CertStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertStore">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertStore">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard types.
      *
diff --git a/ojluni/src/main/java/java/security/cert/Certificate.java b/ojluni/src/main/java/java/security/cert/Certificate.java
index 424e4b6..81f7d8c 100755
--- a/ojluni/src/main/java/java/security/cert/Certificate.java
+++ b/ojluni/src/main/java/java/security/cert/Certificate.java
@@ -70,7 +70,7 @@
      *
      * @param type the standard name of the certificate type.
      * See the CertificateFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertificateFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard certificate types.
      */
diff --git a/ojluni/src/main/java/java/security/cert/CertificateFactory.java b/ojluni/src/main/java/java/security/cert/CertificateFactory.java
index 57a3fe1..061744d 100755
--- a/ojluni/src/main/java/java/security/cert/CertificateFactory.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateFactory.java
@@ -91,24 +91,22 @@
  * }
  * </pre>
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>CertificateFactory</code> type:
+ * <p> Latest Android version provides the following <code>CertificateFactory</code> type:
  * <ul>
  * <li><tt>X.509</tt></li>
+ * <li><tt>X509</tt></li>
  * </ul>
- * and the following standard <code>CertPath</code> encodings:
+ * and the following <code>CertPath</code> encodings:
  * <ul>
  * <li><tt>PKCS7</tt></li>
  * <li><tt>PkiPath</tt></li>
  * </ul>
  * The type and encodings are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertificateFactory">
  * CertificateFactory section</a> and the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
  * CertPath Encodings section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other types or encodings are supported.
  *
  * @author Hemma Prafullchandra
  * @author Jan Luehe
@@ -165,7 +163,7 @@
      *
      * @param type the name of the requested certificate type.
      * See the CertificateFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertificateFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard certificate types.
      *
@@ -203,7 +201,7 @@
      *
      * @param type the certificate type.
      * See the CertificateFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertificateFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard certificate types.
      *
@@ -247,7 +245,7 @@
      *
      * @param type the certificate type.
      * See the CertificateFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertificateFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard certificate types.
      * @param provider the provider.
@@ -343,7 +341,7 @@
      * Returns an iteration of the <code>CertPath</code> encodings supported
      * by this certificate factory, with the default encoding first. See
      * the CertPath Encodings section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard encoding names and their formats.
      * <p>
@@ -383,7 +381,7 @@
      * the data read from the <code>InputStream</code> inStream. The data
      * is assumed to be in the specified encoding. See
      * the CertPath Encodings section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard encoding names and their formats.
      *
diff --git a/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java b/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java
index 0912ba2..ca64665 100755
--- a/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java
@@ -183,7 +183,7 @@
      * Returns an iteration of the <code>CertPath</code> encodings supported
      * by this certificate factory, with the default encoding first. See
      * the CertPath Encodings section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard encoding names.
      * <p>
diff --git a/ojluni/src/main/java/java/security/cert/package.html b/ojluni/src/main/java/java/security/cert/package.html
index 569a113..9234e2d 100755
--- a/ojluni/src/main/java/java/security/cert/package.html
+++ b/ojluni/src/main/java/java/security/cert/package.html
@@ -35,12 +35,12 @@
 <h2>Package Specification</h2>
 
 <ul>
-  <li><a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture (JCA) Reference Guide</b></a>
   <li>RFC 3280: Internet X.509 Public Key Infrastructure Certificate and 
     Certificate Revocation List (CRL) Profile
-  <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture Standard Algorithm Name
     Documentation</b></a></li>
@@ -53,10 +53,10 @@
   <li><a href="http://www.ietf.org/rfc/rfc3280.txt">
     http://www.ietf.org/rfc/rfc3280.txt</a>
   <li><a href=
-    "{@docRoot}/../technotes/guides/security/certpath/CertPathProgGuide.html">
+    "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/certpath/CertPathProgGuide.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     PKI Programmer's Guide</a>
-  <li><a href="{@docRoot}/../technotes/guides/security/cert3.html">
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/cert3.html">
     X.509 Certificates and Certificate Revocation Lists (CRLs)</a>
 </ul>
 
diff --git a/ojluni/src/main/java/java/security/interfaces/package.html b/ojluni/src/main/java/java/security/interfaces/package.html
index 70820dd..ca1fa8d 100755
--- a/ojluni/src/main/java/java/security/interfaces/package.html
+++ b/ojluni/src/main/java/java/security/interfaces/package.html
@@ -46,7 +46,7 @@
 to these cryptographic provider developer guides:
 <ul>
   <li><a href=
-    "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
+    "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
     <b>How to Implement a Provider for the
     Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
     </b></a></li>
@@ -66,7 +66,7 @@
 <ul>
   <li>
     <a href=
-      "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+      "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
       <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
       Cryptography Architecture API Specification and Reference
       </b></a></li>
diff --git a/ojluni/src/main/java/java/security/package.html b/ojluni/src/main/java/java/security/package.html
index 65eb70c..52d427a 100755
--- a/ojluni/src/main/java/java/security/package.html
+++ b/ojluni/src/main/java/java/security/package.html
@@ -51,14 +51,14 @@
 <h2>Package Specification</h2>
 
 <ul>
-  <li><a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture (JCA) Reference Guide</b></a></li>
 
   <li>PKCS #8: Private-Key Information Syntax Standard, Version 1.2,
     November 1993</li>
 
-  <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture Standard Algorithm Name 
     Documentation</b></a></li>
@@ -69,44 +69,44 @@
 For further documentation, please see:
 <ul>
   <li><a href=
-    "{@docRoot}/../technotes/guides/security/spec/security-spec.doc.html">
+    "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/spec/security-spec.doc.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     SE Platform Security Architecture</b></a></li>
 
   <li><a href=
-    "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
+    "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
     <b>How to Implement a Provider in the
     Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
     </b></a></li>
 
   <li><a href=
-    "{@docRoot}/../technotes/guides/security/PolicyFiles.html"><b>
+    "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/PolicyFiles.html"><b>
     Default Policy Implementation and Policy File Syntax
     </b></a></li>
 
   <li><a href=
-    "{@docRoot}/../technotes/guides/security/permissions.html"><b>
+    "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/permissions.html"><b>
     Permissions in the
     Java<FONT SIZE=-2><SUP>TM</SUP></FONT> SE Development Kit (JDK)
     </b></a></li>
 
   <li><a href=
-    "{@docRoot}/../technotes/guides/security/SecurityToolsSummary.html"><b>
+    "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/SecurityToolsSummary.html"><b>
     Summary of Tools for
     Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Platform Security
     </b></a></li>
 
   <li><b>keytool</b>
-    (<a href="{@docRoot}/../technotes/tools/solaris/keytool.html">
+    (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/solaris/keytool.html">
       for Solaris/Linux</a>)
-    (<a href="{@docRoot}/../technotes/tools/windows/keytool.html">
+    (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/windows/keytool.html">
       for Windows</a>)
     </li>
 
   <li><b>jarsigner</b>
-    (<a href="{@docRoot}/../technotes/tools/solaris/jarsigner.html">
+    (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/solaris/jarsigner.html">
       for Solaris/Linux</a>)
-    (<a href="{@docRoot}/../technotes/tools/windows/jarsigner.html">
+    (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/windows/jarsigner.html">
       for Windows</a>)
     </li>
 
diff --git a/ojluni/src/main/java/java/security/spec/package.html b/ojluni/src/main/java/java/security/spec/package.html
index 54558ae..59986b3 100755
--- a/ojluni/src/main/java/java/security/spec/package.html
+++ b/ojluni/src/main/java/java/security/spec/package.html
@@ -61,13 +61,13 @@
 <ul>
   <li>
     <a href=
-      "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+      "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
       <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
       Cryptography Architecture API Specification and Reference
       </b></a></li>
   <li>
     <a href=
-      "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
+      "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
       <b>How to Implement a Provider for the
       Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
       </b></a></li>
diff --git a/ojluni/src/main/java/java/sql/DriverManager.java b/ojluni/src/main/java/java/sql/DriverManager.java
index d1a9054..e7d9c94 100755
--- a/ojluni/src/main/java/java/sql/DriverManager.java
+++ b/ojluni/src/main/java/java/sql/DriverManager.java
@@ -53,7 +53,7 @@
  * </pre>
  *<P> The <code>DriverManager</code> methods <code>getConnection</code> and
  * <code>getDrivers</code> have been enhanced to support the Java Standard Edition
- * <a href="{@docRoot}/../technotes/guides/jar/jar.html#Service%20Provider">Service Provider</a> mechanism. JDBC 4.0 Drivers must
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/jar/jar.html#Service%20Provider">Service Provider</a> mechanism. JDBC 4.0 Drivers must
  * include the file <code>META-INF/services/java.sql.Driver</code>. This file contains the name of the JDBC drivers
  * implementation of <code>java.sql.Driver</code>.  For example, to load the <code>my.sql.Driver</code> class,
  * the <code>META-INF/services/java.sql.Driver</code> file would contain the entry:
diff --git a/ojluni/src/main/java/java/sql/package.html b/ojluni/src/main/java/java/sql/package.html
index 673aa07..60acef6 100755
--- a/ojluni/src/main/java/java/sql/package.html
+++ b/ojluni/src/main/java/java/sql/package.html
@@ -310,7 +310,7 @@
 <h2>Related Documentation</h2>
 
 <ul>
-  <li><a href="{@docRoot}/../technotes/guides/jdbc/getstart/GettingStartedTOC.fm.html">Getting Started</a>--overviews of the major interfaces
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/jdbc/getstart/GettingStartedTOC.fm.html">Getting Started</a>--overviews of the major interfaces
 <P>
   <li><a href="http://java.sun.com/docs/books/tutorial/jdbc">Chapters on the JDBC 
      API</a>--from the online version of <i>The Java Tutorial Continued</i>
diff --git a/ojluni/src/main/java/java/util/AbstractCollection.java b/ojluni/src/main/java/java/util/AbstractCollection.java
index a32d411..3279b62 100755
--- a/ojluni/src/main/java/java/util/AbstractCollection.java
+++ b/ojluni/src/main/java/java/util/AbstractCollection.java
@@ -49,7 +49,7 @@
  * the collection being implemented admits a more efficient implementation.<p>
  *
  * This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author  Josh Bloch
diff --git a/ojluni/src/main/java/java/util/AbstractList.java b/ojluni/src/main/java/java/util/AbstractList.java
index 4492166..441a18c 100755
--- a/ojluni/src/main/java/java/util/AbstractList.java
+++ b/ojluni/src/main/java/java/util/AbstractList.java
@@ -60,7 +60,7 @@
  * collection being implemented admits a more efficient implementation.
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author  Josh Bloch
diff --git a/ojluni/src/main/java/java/util/AbstractMap.java b/ojluni/src/main/java/java/util/AbstractMap.java
index a3ad3d3..5ed05c8 100755
--- a/ojluni/src/main/java/java/util/AbstractMap.java
+++ b/ojluni/src/main/java/java/util/AbstractMap.java
@@ -52,7 +52,7 @@
  * map being implemented admits a more efficient implementation.
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <K> the type of keys maintained by this map
diff --git a/ojluni/src/main/java/java/util/AbstractSequentialList.java b/ojluni/src/main/java/java/util/AbstractSequentialList.java
index 36a91da..1ee5e21 100755
--- a/ojluni/src/main/java/java/util/AbstractSequentialList.java
+++ b/ojluni/src/main/java/java/util/AbstractSequentialList.java
@@ -54,7 +54,7 @@
  * specification.<p>
  *
  * This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author  Josh Bloch
diff --git a/ojluni/src/main/java/java/util/AbstractSet.java b/ojluni/src/main/java/java/util/AbstractSet.java
index 1f1a49c..c963aca 100755
--- a/ojluni/src/main/java/java/util/AbstractSet.java
+++ b/ojluni/src/main/java/java/util/AbstractSet.java
@@ -42,7 +42,7 @@
  * for <tt>equals</tt> and <tt>hashCode</tt>.<p>
  *
  * This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements maintained by this set
diff --git a/ojluni/src/main/java/java/util/ArrayList.java b/ojluni/src/main/java/java/util/ArrayList.java
index 77aa035..4f644ca 100755
--- a/ojluni/src/main/java/java/util/ArrayList.java
+++ b/ojluni/src/main/java/java/util/ArrayList.java
@@ -92,7 +92,7 @@
  * should be used only to detect bugs.</i>
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author  Josh Bloch
diff --git a/ojluni/src/main/java/java/util/Arrays.java b/ojluni/src/main/java/java/util/Arrays.java
index 1fbe710..df3f769 100755
--- a/ojluni/src/main/java/java/util/Arrays.java
+++ b/ojluni/src/main/java/java/util/Arrays.java
@@ -61,7 +61,7 @@
  * a MergeSort, but it does have to be <i>stable</i>.)
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author Josh Bloch
diff --git a/ojluni/src/main/java/java/util/Collection.java b/ojluni/src/main/java/java/util/Collection.java
index 09f10e6..7db86aa 100755
--- a/ojluni/src/main/java/java/util/Collection.java
+++ b/ojluni/src/main/java/java/util/Collection.java
@@ -105,7 +105,7 @@
  * implementor deems it appropriate.
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements in this collection
diff --git a/ojluni/src/main/java/java/util/Collections.java b/ojluni/src/main/java/java/util/Collections.java
index 1a9f83a..5a4de2a 100644
--- a/ojluni/src/main/java/java/util/Collections.java
+++ b/ojluni/src/main/java/java/util/Collections.java
@@ -68,7 +68,7 @@
  * already sorted may or may not throw <tt>UnsupportedOperationException</tt>.
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author  Josh Bloch
diff --git a/ojluni/src/main/java/java/util/Comparator.java b/ojluni/src/main/java/java/util/Comparator.java
index ecf8d64..4447351 100644
--- a/ojluni/src/main/java/java/util/Comparator.java
+++ b/ojluni/src/main/java/java/util/Comparator.java
@@ -94,7 +94,7 @@
  * an equivalence relation.
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <T> the type of objects that may be compared by this comparator
diff --git a/ojluni/src/main/java/java/util/EnumMap.java b/ojluni/src/main/java/java/util/EnumMap.java
index 3b533e8..bfccbee 100755
--- a/ojluni/src/main/java/java/util/EnumMap.java
+++ b/ojluni/src/main/java/java/util/EnumMap.java
@@ -69,7 +69,7 @@
  * {@link HashMap} counterparts.
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author Josh Bloch
diff --git a/ojluni/src/main/java/java/util/EnumSet.java b/ojluni/src/main/java/java/util/EnumSet.java
index ad17859..981fc9d 100755
--- a/ojluni/src/main/java/java/util/EnumSet.java
+++ b/ojluni/src/main/java/java/util/EnumSet.java
@@ -68,7 +68,7 @@
  * constant time if their argument is also an enum set.
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author Josh Bloch
diff --git a/ojluni/src/main/java/java/util/HashMap.java b/ojluni/src/main/java/java/util/HashMap.java
index 9403225..f47d681 100755
--- a/ojluni/src/main/java/java/util/HashMap.java
+++ b/ojluni/src/main/java/java/util/HashMap.java
@@ -108,7 +108,7 @@
  * should be used only to detect bugs.</i>
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <K> the type of keys maintained by this map
diff --git a/ojluni/src/main/java/java/util/HashSet.java b/ojluni/src/main/java/java/util/HashSet.java
index c8deade..ab5fe4d 100755
--- a/ojluni/src/main/java/java/util/HashSet.java
+++ b/ojluni/src/main/java/java/util/HashSet.java
@@ -70,7 +70,7 @@
  * should be used only to detect bugs.</i>
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements maintained by this set
diff --git a/ojluni/src/main/java/java/util/Hashtable.java b/ojluni/src/main/java/java/util/Hashtable.java
index 783d17b..1b7138b 100755
--- a/ojluni/src/main/java/java/util/Hashtable.java
+++ b/ojluni/src/main/java/java/util/Hashtable.java
@@ -105,7 +105,7 @@
  *
  * <p>As of the Java 2 platform v1.2, this class was retrofitted to
  * implement the {@link Map} interface, making it a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  *
  * Java Collections Framework</a>.  Unlike the new collection
  * implementations, {@code Hashtable} is synchronized.  If a
diff --git a/ojluni/src/main/java/java/util/IdentityHashMap.java b/ojluni/src/main/java/java/util/IdentityHashMap.java
index b860cca..f78c583 100755
--- a/ojluni/src/main/java/java/util/IdentityHashMap.java
+++ b/ojluni/src/main/java/java/util/IdentityHashMap.java
@@ -123,7 +123,7 @@
  * {@link HashMap} (which uses <i>chaining</i> rather than linear-probing).
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @see     System#identityHashCode(Object)
diff --git a/ojluni/src/main/java/java/util/Iterator.java b/ojluni/src/main/java/java/util/Iterator.java
index 7d2daf8..f9826c0 100755
--- a/ojluni/src/main/java/java/util/Iterator.java
+++ b/ojluni/src/main/java/java/util/Iterator.java
@@ -40,7 +40,7 @@
  * </ul>
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements returned by this iterator
diff --git a/ojluni/src/main/java/java/util/LinkedHashMap.java b/ojluni/src/main/java/java/util/LinkedHashMap.java
index 5a35728..0396e8c 100755
--- a/ojluni/src/main/java/java/util/LinkedHashMap.java
+++ b/ojluni/src/main/java/java/util/LinkedHashMap.java
@@ -142,7 +142,7 @@
  * <em>fail-fast</em>, and additionally report {@link Spliterator#ORDERED}.
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @implNote
diff --git a/ojluni/src/main/java/java/util/LinkedHashSet.java b/ojluni/src/main/java/java/util/LinkedHashSet.java
index 08606cf..5d3cec9 100755
--- a/ojluni/src/main/java/java/util/LinkedHashSet.java
+++ b/ojluni/src/main/java/java/util/LinkedHashSet.java
@@ -100,7 +100,7 @@
  * should be used only to detect bugs.</i>
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements maintained by this set
diff --git a/ojluni/src/main/java/java/util/LinkedList.java b/ojluni/src/main/java/java/util/LinkedList.java
index 0236076..caae5f1 100755
--- a/ojluni/src/main/java/java/util/LinkedList.java
+++ b/ojluni/src/main/java/java/util/LinkedList.java
@@ -70,7 +70,7 @@
  * should be used only to detect bugs.</i>
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author  Josh Bloch
diff --git a/ojluni/src/main/java/java/util/List.java b/ojluni/src/main/java/java/util/List.java
index d79ee06..a656826 100755
--- a/ojluni/src/main/java/java/util/List.java
+++ b/ojluni/src/main/java/java/util/List.java
@@ -88,7 +88,7 @@
  * interface.
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements in this list
diff --git a/ojluni/src/main/java/java/util/ListIterator.java b/ojluni/src/main/java/java/util/ListIterator.java
index 9285917..74d1b05 100755
--- a/ojluni/src/main/java/java/util/ListIterator.java
+++ b/ojluni/src/main/java/java/util/ListIterator.java
@@ -46,7 +46,7 @@
  * {@link #previous()}.
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @author  Josh Bloch
diff --git a/ojluni/src/main/java/java/util/PriorityQueue.java b/ojluni/src/main/java/java/util/PriorityQueue.java
index 7c929bd..98d4939 100644
--- a/ojluni/src/main/java/java/util/PriorityQueue.java
+++ b/ojluni/src/main/java/java/util/PriorityQueue.java
@@ -72,7 +72,7 @@
  * ({@code peek}, {@code element}, and {@code size}).
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @since 1.5
diff --git a/ojluni/src/main/java/java/util/Properties.java b/ojluni/src/main/java/java/util/Properties.java
index d0470b2..7c3f0bb 100755
--- a/ojluni/src/main/java/java/util/Properties.java
+++ b/ojluni/src/main/java/java/util/Properties.java
@@ -106,8 +106,8 @@
  * <p>This class is thread-safe: multiple threads can share a single
  * <tt>Properties</tt> object without the need for external synchronization.
  *
- * @see <a href="{@docRoot}/../technotes/tools/solaris/native2ascii.html">native2ascii tool for Solaris</a>
- * @see <a href="{@docRoot}/../technotes/tools/windows/native2ascii.html">native2ascii tool for Windows</a>
+ * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/solaris/native2ascii.html">native2ascii tool for Solaris</a>
+ * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/windows/native2ascii.html">native2ascii tool for Windows</a>
  *
  * @author  Arthur van Hoff
  * @author  Michael McCloskey
diff --git a/ojluni/src/main/java/java/util/RandomAccess.java b/ojluni/src/main/java/java/util/RandomAccess.java
index 09ce29e..ca89cf8 100755
--- a/ojluni/src/main/java/java/util/RandomAccess.java
+++ b/ojluni/src/main/java/java/util/RandomAccess.java
@@ -59,7 +59,7 @@
  * </pre>
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @since 1.4
diff --git a/ojluni/src/main/java/java/util/Set.java b/ojluni/src/main/java/java/util/Set.java
index 2703049..56db1ef 100755
--- a/ojluni/src/main/java/java/util/Set.java
+++ b/ojluni/src/main/java/java/util/Set.java
@@ -64,7 +64,7 @@
  * interface.
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements maintained by this set
diff --git a/ojluni/src/main/java/java/util/SortedMap.java b/ojluni/src/main/java/java/util/SortedMap.java
index b71b5fa..3557db7 100755
--- a/ojluni/src/main/java/java/util/SortedMap.java
+++ b/ojluni/src/main/java/java/util/SortedMap.java
@@ -93,7 +93,7 @@
  *   SortedMap&lt;String, V&gt; sub = m.subMap(low+"\0", high);</pre>
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <K> the type of keys maintained by this map
diff --git a/ojluni/src/main/java/java/util/SortedSet.java b/ojluni/src/main/java/java/util/SortedSet.java
index 3ea9329..07001cb 100755
--- a/ojluni/src/main/java/java/util/SortedSet.java
+++ b/ojluni/src/main/java/java/util/SortedSet.java
@@ -89,7 +89,7 @@
  *   SortedSet&lt;String&gt; sub = s.subSet(low+"\0", high);</pre>
  *
  * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements maintained by this set
diff --git a/ojluni/src/main/java/java/util/TreeMap.java b/ojluni/src/main/java/java/util/TreeMap.java
index 5e26f0f..acee3b3 100755
--- a/ojluni/src/main/java/java/util/TreeMap.java
+++ b/ojluni/src/main/java/java/util/TreeMap.java
@@ -93,7 +93,7 @@
  * associated map using {@code put}.)
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <K> the type of keys maintained by this map
diff --git a/ojluni/src/main/java/java/util/TreeSet.java b/ojluni/src/main/java/java/util/TreeSet.java
index 54eeeda..c1825ca 100755
--- a/ojluni/src/main/java/java/util/TreeSet.java
+++ b/ojluni/src/main/java/java/util/TreeSet.java
@@ -74,7 +74,7 @@
  * should be used only to detect bugs.</i>
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <E> the type of elements maintained by this set
diff --git a/ojluni/src/main/java/java/util/Vector.java b/ojluni/src/main/java/java/util/Vector.java
index db80cf2..b2bc200 100755
--- a/ojluni/src/main/java/java/util/Vector.java
+++ b/ojluni/src/main/java/java/util/Vector.java
@@ -68,7 +68,7 @@
  *
  * <p>As of the Java 2 platform v1.2, this class was retrofitted to
  * implement the {@link List} interface, making it a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.  Unlike the new collection
  * implementations, {@code Vector} is synchronized.  If a thread-safe
  * implementation is not needed, it is recommended to use {@link
diff --git a/ojluni/src/main/java/java/util/WeakHashMap.java b/ojluni/src/main/java/java/util/WeakHashMap.java
index 7785e05..3e82610 100755
--- a/ojluni/src/main/java/java/util/WeakHashMap.java
+++ b/ojluni/src/main/java/java/util/WeakHashMap.java
@@ -119,7 +119,7 @@
  * should be used only to detect bugs.</i>
  *
  * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html">
  * Java Collections Framework</a>.
  *
  * @param <K> the type of keys maintained by this map
diff --git a/ojluni/src/main/java/java/util/jar/Attributes.java b/ojluni/src/main/java/java/util/jar/Attributes.java
index d7f68a0..04b6ff7 100755
--- a/ojluni/src/main/java/java/util/jar/Attributes.java
+++ b/ojluni/src/main/java/java/util/jar/Attributes.java
@@ -45,7 +45,7 @@
  * the ASCII characters in the set [0-9a-zA-Z_-], and cannot exceed 70
  * characters in length. Attribute values can contain any characters and
  * will be UTF8-encoded when written to the output stream.  See the
- * <a href="{@docRoot}/../technotes/guides/jar/jar.html">JAR File Specification</a>
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/jar/jar.html">JAR File Specification</a>
  * for more information about valid attribute names and values.
  *
  * @author  David Connelly
@@ -442,7 +442,7 @@
      * to the ASCII characters in the set [0-9a-zA-Z_-], and cannot exceed
      * 70 characters in length. Attribute values can contain any characters
      * and will be UTF8-encoded when written to the output stream.  See the
-     * <a href="{@docRoot}/../technotes/guides/jar/jar.html">JAR File Specification</a>
+     * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/jar/jar.html">JAR File Specification</a>
      * for more information about valid attribute names and values.
      */
     public static class Name {
@@ -528,7 +528,7 @@
          * <code>Name</code> object for <code>Manifest-Version</code>
          * manifest attribute. This attribute indicates the version number
          * of the manifest standard to which a JAR file's manifest conforms.
-         * @see <a href="{@docRoot}/../technotes/guides/jar/jar.html#JAR Manifest">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/jar/jar.html#JAR Manifest">
          *      Manifest and Signature Specification</a>
          */
         public static final Name MANIFEST_VERSION = new Name("Manifest-Version");
@@ -536,7 +536,7 @@
         /**
          * <code>Name</code> object for <code>Signature-Version</code>
          * manifest attribute used when signing JAR files.
-         * @see <a href="{@docRoot}/../technotes/guides/jar/jar.html#JAR Manifest">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/jar/jar.html#JAR Manifest">
          *      Manifest and Signature Specification</a>
          */
         public static final Name SIGNATURE_VERSION = new Name("Signature-Version");
@@ -551,7 +551,7 @@
          * <code>Name</code> object for <code>Class-Path</code>
          * manifest attribute. Bundled extensions can use this attribute
          * to find other JAR files containing needed classes.
-         * @see <a href="{@docRoot}/../technotes/guides/extensions/spec.html#bundled">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/extensions/spec.html#bundled">
          *      Extensions Specification</a>
          */
         public static final Name CLASS_PATH = new Name("Class-Path");
@@ -568,7 +568,7 @@
         /**
          * <code>Name</code> object for <code>Sealed</code> manifest attribute
          * used for sealing.
-         * @see <a href="{@docRoot}/../technotes/guides/extensions/spec.html#sealing">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/extensions/spec.html#sealing">
          *      Extension Sealing</a>
          */
         public static final Name SEALED = new Name("Sealed");
@@ -576,7 +576,7 @@
        /**
          * <code>Name</code> object for <code>Extension-List</code> manifest attribute
          * used for declaring dependencies on installed extensions.
-         * @see <a href="{@docRoot}/../technotes/guides/extensions/spec.html#dependency">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/extensions/spec.html#dependency">
          *      Installed extension dependency</a>
          */
         public static final Name EXTENSION_LIST = new Name("Extension-List");
@@ -584,7 +584,7 @@
         /**
          * <code>Name</code> object for <code>Extension-Name</code> manifest attribute
          * used for declaring dependencies on installed extensions.
-         * @see <a href="{@docRoot}/../technotes/guides/extensions/spec.html#dependency">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/extensions/spec.html#dependency">
          *      Installed extension dependency</a>
          */
         public static final Name EXTENSION_NAME = new Name("Extension-Name");
@@ -592,7 +592,7 @@
         /**
          * <code>Name</code> object for <code>Extension-Name</code> manifest attribute
          * used for declaring dependencies on installed extensions.
-         * @see <a href="{@docRoot}/../technotes/guides/extensions/spec.html#dependency">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/extensions/spec.html#dependency">
          *      Installed extension dependency</a>
          */
         public static final Name EXTENSION_INSTALLATION = new Name("Extension-Installation");
@@ -600,7 +600,7 @@
         /**
          * <code>Name</code> object for <code>Implementation-Title</code>
          * manifest attribute used for package versioning.
-         * @see <a href="{@docRoot}/../technotes/guides/versioning/spec/versioning2.html#wp90779">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>
          */
         public static final Name IMPLEMENTATION_TITLE = new Name("Implementation-Title");
@@ -608,7 +608,7 @@
         /**
          * <code>Name</code> object for <code>Implementation-Version</code>
          * manifest attribute used for package versioning.
-         * @see <a href="{@docRoot}/../technotes/guides/versioning/spec/versioning2.html#wp90779">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>
          */
         public static final Name IMPLEMENTATION_VERSION = new Name("Implementation-Version");
@@ -616,7 +616,7 @@
         /**
          * <code>Name</code> object for <code>Implementation-Vendor</code>
          * manifest attribute used for package versioning.
-         * @see <a href="{@docRoot}/../technotes/guides/versioning/spec/versioning2.html#wp90779">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>
          */
         public static final Name IMPLEMENTATION_VENDOR = new Name("Implementation-Vendor");
@@ -624,7 +624,7 @@
         /**
          * <code>Name</code> object for <code>Implementation-Vendor-Id</code>
          * manifest attribute used for package versioning.
-         * @see <a href="{@docRoot}/../technotes/guides/versioning/spec/versioning2.html#wp90779">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>
          */
         public static final Name IMPLEMENTATION_VENDOR_ID = new Name("Implementation-Vendor-Id");
@@ -632,7 +632,7 @@
        /**
          * <code>Name</code> object for <code>Implementation-Vendor-URL</code>
          * manifest attribute used for package versioning.
-         * @see <a href="{@docRoot}/../technotes/guides/versioning/spec/versioning2.html#wp90779">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>
          */
         public static final Name IMPLEMENTATION_URL = new Name("Implementation-URL");
@@ -640,7 +640,7 @@
         /**
          * <code>Name</code> object for <code>Specification-Title</code>
          * manifest attribute used for package versioning.
-         * @see <a href="{@docRoot}/../technotes/guides/versioning/spec/versioning2.html#wp90779">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>
          */
         public static final Name SPECIFICATION_TITLE = new Name("Specification-Title");
@@ -648,7 +648,7 @@
         /**
          * <code>Name</code> object for <code>Specification-Version</code>
          * manifest attribute used for package versioning.
-         * @see <a href="{@docRoot}/../technotes/guides/versioning/spec/versioning2.html#wp90779">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>
          */
         public static final Name SPECIFICATION_VERSION = new Name("Specification-Version");
@@ -656,7 +656,7 @@
         /**
          * <code>Name</code> object for <code>Specification-Vendor</code>
          * manifest attribute used for package versioning.
-         * @see <a href="{@docRoot}/../technotes/guides/versioning/spec/versioning2.html#wp90779">
+         * @see <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>
          */
         public static final Name SPECIFICATION_VENDOR = new Name("Specification-Vendor");
diff --git a/ojluni/src/main/java/java/util/jar/JarFile.java b/ojluni/src/main/java/java/util/jar/JarFile.java
index f219505..68a6d85 100755
--- a/ojluni/src/main/java/java/util/jar/JarFile.java
+++ b/ojluni/src/main/java/java/util/jar/JarFile.java
@@ -28,19 +28,14 @@
 
 import java.io.*;
 import java.lang.ref.SoftReference;
-import java.net.URL;
 import java.util.*;
 import java.util.zip.*;
 import java.security.CodeSigner;
 import java.security.cert.Certificate;
 import java.security.AccessController;
-import java.security.CodeSource;
 import sun.misc.IOUtils;
 import sun.security.action.GetPropertyAction;
 import sun.security.util.ManifestEntryVerifier;
-/* ----- BEGIN android -----
-import sun.misc.SharedSecrets;
------ END android ----- */
 
 /**
  * The <code>JarFile</code> class is used to read the contents of a jar file
@@ -62,10 +57,8 @@
  */
 public
 class JarFile extends ZipFile {
-    // ----- BEGIN android -----
     static final String META_DIR = "META-INF/";
-    // ----- END android -----
-    private SoftReference<Manifest> manRef;
+    private Manifest manifest;
     private JarEntry manEntry;
     private JarVerifier jv;
     private boolean jvInitialized;
@@ -73,13 +66,6 @@
     private boolean computedHasClassPathAttribute;
     private boolean hasClassPathAttribute;
 
-    // Set up JavaUtilJarAccess in SharedSecrets
-    /* ----- BEGIN android -----
-    static {
-        SharedSecrets.setJavaUtilJarAccess(new JavaUtilJarAccessImpl());
-    }
-    ----- END android ----- */
-
     /**
      * The JAR manifest file name.
      */
@@ -175,9 +161,7 @@
     }
 
     private synchronized Manifest getManifestFromReference() throws IOException {
-        Manifest man = manRef != null ? manRef.get() : null;
-
-        if (man == null) {
+        if (manifest == null) {
 
             JarEntry manEntry = getManEntry();
 
@@ -185,36 +169,19 @@
             if (manEntry != null) {
                 if (verify) {
                     byte[] b = getBytes(manEntry);
-                    man = new Manifest(new ByteArrayInputStream(b));
+                    manifest = new Manifest(new ByteArrayInputStream(b));
                     if (!jvInitialized) {
                         jv = new JarVerifier(b);
                     }
                 } else {
-                    man = new Manifest(super.getInputStream(manEntry));
+                    manifest = new Manifest(super.getInputStream(manEntry));
                 }
-                manRef = new SoftReference(man);
             }
         }
-        return man;
+        return manifest;
     }
 
-    /* ----- BEGIN android -----
-    private native String[] getMetaInfEntryNames();*/
-
-    private String[] getMetaInfEntryNames() {
-        List<String> list = new ArrayList<String>(8);
-
-        Enumeration<? extends ZipEntry> allEntries = entries();
-        while (allEntries.hasMoreElements()) {
-            ZipEntry ze = allEntries.nextElement();
-            if (ze.getName().startsWith(META_DIR)
-                    && ze.getName().length() > META_DIR.length()) {
-                list.add(ze.getName());
-            }
-        }
-        return list.toArray(new String[list.size()]);
-    }
-    // ----- END android -----
+    private native String[] getMetaInfEntryNames();
 
     /**
      * Returns the <code>JarEntry</code> for the given entry name or
@@ -575,57 +542,7 @@
         return false;
     }
 
-    private synchronized void ensureInitialization() {
-        try {
-            maybeInstantiateVerifier();
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-        if (jv != null && !jvInitialized) {
-            initializeVerifier();
-            jvInitialized = true;
-        }
-    }
-
     JarEntry newEntry(ZipEntry ze) {
         return new JarFileEntry(ze);
     }
-
-    private Enumeration<String> unsignedEntryNames() {
-        final Enumeration entries = entries();
-        return new Enumeration<String>() {
-
-            String name;
-
-            /*
-             * Grab entries from ZIP directory but screen out
-             * metadata.
-             */
-            public boolean hasMoreElements() {
-                if (name != null) {
-                    return true;
-                }
-                while (entries.hasMoreElements()) {
-                    String value;
-                    ZipEntry e = (ZipEntry) entries.nextElement();
-                    value = e.getName();
-                    if (e.isDirectory() || JarVerifier.isSigningRelated(value)) {
-                        continue;
-                    }
-                    name = value;
-                    return true;
-                }
-                return false;
-            }
-
-            public String nextElement() {
-                if (hasMoreElements()) {
-                    String value = name;
-                    name = null;
-                    return value;
-                }
-                throw new NoSuchElementException();
-            }
-        };
-    }
 }
diff --git a/ojluni/src/main/java/java/util/jar/Manifest.java b/ojluni/src/main/java/java/util/jar/Manifest.java
index 092926b..2bd4eb0 100755
--- a/ojluni/src/main/java/java/util/jar/Manifest.java
+++ b/ojluni/src/main/java/java/util/jar/Manifest.java
@@ -39,7 +39,7 @@
  * associated Attributes. There are main Manifest Attributes as well as
  * per-entry Attributes. For information on the Manifest format, please
  * see the
- * <a href="{@docRoot}/../technotes/guides/jar/jar.html">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/jar/jar.html">
  * Manifest format specification</a>.
  *
  * @author  David Connelly
diff --git a/ojluni/src/main/java/java/util/jar/Pack200.java b/ojluni/src/main/java/java/util/jar/Pack200.java
index 17facf2..cf97590 100755
--- a/ojluni/src/main/java/java/util/jar/Pack200.java
+++ b/ojluni/src/main/java/java/util/jar/Pack200.java
@@ -96,7 +96,7 @@
  * The deployment applications can use "Accept-Encoding=pack200-gzip". This
  * indicates to the server that the client application desires a version of
  * the file encoded with Pack200 and further compressed with gzip. Please
- * refer to  <a href="{@docRoot}/../technotes/guides/deployment/deployment-guide/pack200.html">Java Deployment Guide</a> for more details and
+ * refer to  <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/deployment/deployment-guide/pack200.html">Java Deployment Guide</a> for more details and
  * techniques.
  * <p>
  * Unless otherwise noted, passing a <tt>null</tt> argument to a constructor or
diff --git a/ojluni/src/main/java/java/util/jar/package.html b/ojluni/src/main/java/java/util/jar/package.html
index f485e63..2d2e493 100755
--- a/ojluni/src/main/java/java/util/jar/package.html
+++ b/ojluni/src/main/java/java/util/jar/package.html
@@ -45,7 +45,7 @@
       package description.</a> <p>
       In JAR files, all file names must be encoded in the UTF-8 encoding. 
 <p>
-  <li><a href="{@docRoot}/../technotes/guides/jar/jar.html">
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/jar/jar.html">
       Manifest and Signature Specification</a> - The manifest format specification.
 </ul>
 
diff --git a/ojluni/src/main/java/java/util/logging/package.html b/ojluni/src/main/java/java/util/logging/package.html
index 0dd7882..7384835 100755
--- a/ojluni/src/main/java/java/util/logging/package.html
+++ b/ojluni/src/main/java/java/util/logging/package.html
@@ -116,7 +116,7 @@
 <P>
 For an overview of control flow, 
 please refer to the 
-<a href="{@docRoot}/../technotes/guides/logging/overview.html">
+<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/logging/overview.html">
 Java Logging Overview</a>.
 </P>
 
diff --git a/ojluni/src/main/java/java/util/package.html b/ojluni/src/main/java/java/util/package.html
index d062b97..9cad732 100755
--- a/ojluni/src/main/java/java/util/package.html
+++ b/ojluni/src/main/java/java/util/package.html
@@ -35,8 +35,8 @@
 
 <h2>Package Specification</h2>
 <ul>
-  <li><a href="{@docRoot}/../technotes/guides/collections/overview.html"><b>Collections Framework Overview</b></a>
-  <li><a href="{@docRoot}/../technotes/guides/collections/reference.html"><b>
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/overview.html"><b>Collections Framework Overview</b></a>
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/reference.html"><b>
        Collections Framework Annotated Outline</b></a>
 </ul>
 
@@ -46,7 +46,7 @@
     <li><a href="http://www.java.sun.com/docs/books/tutorial/collections/">
        <b>Collections Framework Tutorial</b></a>
     <li><a
-    href="{@docRoot}/../technotes/guides/collections/designfaq.html"><b>Collections
+    href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/collections/designfaq.html"><b>Collections
     Framework Design FAQ</b></a>
 </ul>
 
diff --git a/ojluni/src/main/java/java/util/regex/Matcher.java b/ojluni/src/main/java/java/util/regex/Matcher.java
index dc37946..bc74820 100755
--- a/ojluni/src/main/java/java/util/regex/Matcher.java
+++ b/ojluni/src/main/java/java/util/regex/Matcher.java
@@ -121,7 +121,7 @@
     private Runnable nativeFinalizer;
 
     private static final NativeAllocationRegistry registry = new NativeAllocationRegistry(
-            getNativeFinalizer(), nativeSize());
+            Matcher.class.getClassLoader(), getNativeFinalizer(), nativeSize());
 
     /**
      * Holds the input text.
diff --git a/ojluni/src/main/java/java/util/regex/Pattern.java b/ojluni/src/main/java/java/util/regex/Pattern.java
index 1d772d9..5da11c8 100755
--- a/ojluni/src/main/java/java/util/regex/Pattern.java
+++ b/ojluni/src/main/java/java/util/regex/Pattern.java
@@ -930,7 +930,7 @@
     transient long address;
 
     private static final NativeAllocationRegistry registry = new NativeAllocationRegistry(
-            getNativeFinalizer(), nativeSize());
+            Pattern.class.getClassLoader(), getNativeFinalizer(), nativeSize());
 
 
     /**
diff --git a/ojluni/src/main/java/java/util/spi/LocaleServiceProvider.java b/ojluni/src/main/java/java/util/spi/LocaleServiceProvider.java
index 5308d812..f2d89c7 100755
--- a/ojluni/src/main/java/java/util/spi/LocaleServiceProvider.java
+++ b/ojluni/src/main/java/java/util/spi/LocaleServiceProvider.java
@@ -44,7 +44,7 @@
  * <p>
  * <h4>Packaging of Locale Sensitive Service Provider Implementations</h4>
  * Implementations of these locale sensitive services are packaged using the
- * <a href="{@docRoot}/../technotes/guides/extensions/index.html">Java Extension Mechanism</a>
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/extensions/index.html">Java Extension Mechanism</a>
  * as installed extensions.  A provider identifies itself with a
  * provider-configuration file in the resource directory META-INF/services,
  * using the fully qualified provider interface class name as the file name.
diff --git a/ojluni/src/main/java/javax/crypto/Cipher.java b/ojluni/src/main/java/javax/crypto/Cipher.java
index 2ce2279..1d4f072 100755
--- a/ojluni/src/main/java/javax/crypto/Cipher.java
+++ b/ojluni/src/main/java/javax/crypto/Cipher.java
@@ -119,32 +119,78 @@
  *     cipher.update(...);     // Multi-part update
  *     cipher.doFinal(...);    // conclusion of operation
  * </pre>
- * Every implementation of the Java platform is required to support
- * the following standard <code>Cipher</code> transformations with the keysizes
- * in parentheses:
+ * <p> Latest Android version provides the following <code>Cipher</code> transformations:
  * <ul>
- * <li><tt>AES/CBC/NoPadding</tt> (128)</li>
- * <li><tt>AES/CBC/PKCS5Padding</tt> (128)</li>
- * <li><tt>AES/ECB/NoPadding</tt> (128)</li>
- * <li><tt>AES/ECB/PKCS5Padding</tt> (128)</li>
- * <li><tt>DES/CBC/NoPadding</tt> (56)</li>
- * <li><tt>DES/CBC/PKCS5Padding</tt> (56)</li>
- * <li><tt>DES/ECB/NoPadding</tt> (56)</li>
- * <li><tt>DES/ECB/PKCS5Padding</tt> (56)</li>
- * <li><tt>DESede/CBC/NoPadding</tt> (168)</li>
- * <li><tt>DESede/CBC/PKCS5Padding</tt> (168)</li>
- * <li><tt>DESede/ECB/NoPadding</tt> (168)</li>
- * <li><tt>DESede/ECB/PKCS5Padding</tt> (168)</li>
- * <li><tt>RSA/ECB/PKCS1Padding</tt> (1024, 2048)</li>
- * <li><tt>RSA/ECB/OAEPWithSHA-1AndMGF1Padding</tt> (1024, 2048)</li>
- * <li><tt>RSA/ECB/OAEPWithSHA-256AndMGF1Padding</tt> (1024, 2048)</li>
+
+ * <li><tt>AES</tt></li>
+ * <li><tt>AES/CBC/NoPadding</tt></li>
+ * <li><tt>AES/CBC/PKCS5Padding</tt></li>
+ * <li><tt>AES/CBC/PKCS7Padding</tt></li>
+ * <li><tt>AES/CFB/NoPadding</tt></li>
+ * <li><tt>AES/CFB/PKCS5Padding</tt></li>
+ * <li><tt>AES/CFB/PKCS7Padding</tt></li>
+ * <li><tt>AES/CTR/NoPadding</tt></li>
+ * <li><tt>AES/CTR/PKCS5Padding</tt></li>
+ * <li><tt>AES/CTR/PKCS7Padding</tt></li>
+ * <li><tt>AES/ECB/NoPadding</tt></li>
+ * <li><tt>AES/ECB/PKCS5Padding</tt></li>
+ * <li><tt>AES/ECB/PKCS7Padding</tt></li>
+ * <li><tt>AES/GCM/NoPadding</tt></li>
+ * <li><tt>AES/OFB/NoPadding</tt></li>
+ * <li><tt>AES/OFB/PKCS5Padding</tt></li>
+ * <li><tt>AES/OFB/PKCS7Padding</tt></li>
+ * <li><tt>AESWRAP</tt></li>
+ * <li><tt>ARC4</tt></li>
+ * <li><tt>BLOWFISH</tt></li>
+ * <li><tt>DES</tt></li>
+ * <li><tt>DESede</tt></li>
+ * <li><tt>DESede/CBC/NoPadding</tt></li>
+ * <li><tt>DESede/CBC/PKCS5Padding</tt></li>
+ * <li><tt>DESede/CBC/PKCS7Padding</tt></li>
+ * <li><tt>DESede/CFB/NoPadding</tt></li>
+ * <li><tt>DESede/CFB/PKCS5Padding</tt></li>
+ * <li><tt>DESede/CFB/PKCS7Padding</tt></li>
+ * <li><tt>DESede/ECB/NoPadding</tt></li>
+ * <li><tt>DESede/ECB/PKCS5Padding</tt></li>
+ * <li><tt>DESede/ECB/PKCS7Padding</tt></li>
+ * <li><tt>DESede/OFB/NoPadding</tt></li>
+ * <li><tt>DESede/OFB/PKCS5Padding</tt></li>
+ * <li><tt>DESede/OFB/PKCS7Padding</tt></li>
+ * <li><tt>DESedeWRAP</tt></li>
+ * <li><tt>PBEwithMD5and128BITAES-CBC-OPENSSL</tt></li>
+ * <li><tt>PBEwithMD5and192BITAES-CBC-OPENSSL</tt></li>
+ * <li><tt>PBEwithMD5and256BITAES-CBC-OPENSSL</tt></li>
+ * <li><tt>PBEwithMD5andDES</tt></li>
+ * <li><tt>PBEwithMD5andRC2</tt></li>
+ * <li><tt>PBEwithSHA1andDES</tt></li>
+ * <li><tt>PBEwithSHA1andRC2</tt></li>
+ * <li><tt>PBEwithSHA256and128BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEwithSHA256and192BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEwithSHA256and256BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEwithSHAand128BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEwithSHAand128BITRC2-CBC</tt></li>
+ * <li><tt>PBEwithSHAand128BITRC4</tt></li>
+ * <li><tt>PBEwithSHAand192BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEwithSHAand2-KEYTRIPLEDES-CBC</tt></li>
+ * <li><tt>PBEwithSHAand256BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEwithSHAand3-KEYTRIPLEDES-CBC</tt></li>
+ * <li><tt>PBEwithSHAand40BITRC2-CBC</tt></li>
+ * <li><tt>PBEwithSHAand40BITRC4</tt></li>
+ * <li><tt>PBEwithSHAandTWOFISH-CBC</tt></li>
+ * <li><tt>RSA</tt></li>
+ * <li><tt>RSA/ECB/NoPadding</tt></li>
+ * <li><tt>RSA/ECB/OAEPPadding</tt></li>
+ * <li><tt>RSA/ECB/OAEPwithSHA-1andMGF1Padding</tt></li>
+ * <li><tt>RSA/ECB/OAEPwithSHA-224andMGF1Padding</tt></li>
+ * <li><tt>RSA/ECB/OAEPwithSHA-256andMGF1Padding</tt></li>
+ * <li><tt>RSA/ECB/OAEPwithSHA-384andMGF1Padding</tt></li>
+ * <li><tt>RSA/ECB/OAEPwithSHA-512andMGF1Padding</tt></li>
+ * <li><tt>RSA/ECB/PKCS1Padding</tt></li>
  * </ul>
  * These transformations are described in the
- * <a href="{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Cipher">
  * Cipher section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other transformations are supported.
  *
  * @author Jan Luehe
  * @see KeyGenerator
@@ -311,7 +357,7 @@
      * @param transformation the name of the transformation, e.g.,
      * <i>DES/CBC/PKCS5Padding</i>.
      * See the Cipher section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Cipher">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard transformation names.
      *
@@ -348,7 +394,7 @@
      * @param transformation the name of the transformation,
      * e.g., <i>DES/CBC/PKCS5Padding</i>.
      * See the Cipher section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Cipher">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard transformation names.
      *
@@ -400,7 +446,7 @@
      * @param transformation the name of the transformation,
      * e.g., <i>DES/CBC/PKCS5Padding</i>.
      * See the Cipher section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Cipher">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard transformation names.
      *
@@ -2019,7 +2065,7 @@
      * For more information on default key size in JCE jurisdiction
      * policy files, please see Appendix E in the
      * <a href=
-     *   "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppC">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppC">
      * Java Cryptography Architecture Reference Guide</a>.
      *
      * @param transformation the cipher transformation.
diff --git a/ojluni/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java b/ojluni/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java
index 92cc1eb..5fa59b1 100755
--- a/ojluni/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java
+++ b/ojluni/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java
@@ -115,7 +115,7 @@
      *
      * @param algName encryption algorithm name. See Appendix A in the
      * <a href=
-     *   "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      * Java Cryptography Architecture Reference Guide</a>
      * for information about standard Cipher algorithm names.
      * @param encryptedData encrypted data. The contents of
@@ -198,7 +198,7 @@
      * in the constructor when such mapping is available.
      * See Appendix A in the
      * <a href=
-     *   "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      * Java Cryptography Architecture Reference Guide</a>
      * for information about standard Cipher algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/crypto/ExemptionMechanism.java b/ojluni/src/main/java/javax/crypto/ExemptionMechanism.java
index 6a7cc90..ec49ccd 100755
--- a/ojluni/src/main/java/javax/crypto/ExemptionMechanism.java
+++ b/ojluni/src/main/java/javax/crypto/ExemptionMechanism.java
@@ -116,7 +116,7 @@
      * mechanism.
      * See the ExemptionMechanism section in the
      * <a href=
-     *   "{docRoot}/../technotes/guides/security/StandardNames.html#Exemption">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Exemption">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard exemption mechanism names.
      *
@@ -155,7 +155,7 @@
      * @param algorithm the standard name of the requested exemption mechanism.
      * See the ExemptionMechanism section in the
      * <a href=
-     *   "{docRoot}/../technotes/guides/security/StandardNames.html#Exemption">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Exemption">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard exemption mechanism names.
      *
@@ -199,7 +199,7 @@
      * @param algorithm the standard name of the requested exemption mechanism.
      * See the ExemptionMechanism section in the
      * <a href=
-     *   "{docRoot}/../technotes/guides/security/StandardNames.html#Exemption">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Exemption">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard exemption mechanism names.
      *
diff --git a/ojluni/src/main/java/javax/crypto/KeyAgreement.java b/ojluni/src/main/java/javax/crypto/KeyAgreement.java
index 6c1a763..a74786d 100755
--- a/ojluni/src/main/java/javax/crypto/KeyAgreement.java
+++ b/ojluni/src/main/java/javax/crypto/KeyAgreement.java
@@ -55,17 +55,15 @@
  * <code>false</code>, and the second time setting it to <code>true</code>.
  * There may be any number of parties involved in a key exchange.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>KeyAgreement</code> algorithm:
+ * <p> Latest Android version provides the following <code>KeyAgreement</code> algorithm:
  * <ul>
- * <li><tt>DiffieHellman</tt></li>
+ * <li><tt>DH</tt></li>
+ * <li><tt>ECDH</tt></li>
  * </ul>
  * This algorithm is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyAgreement">
  * KeyAgreement section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Jan Luehe
  *
@@ -139,7 +137,7 @@
      * @param algorithm the standard name of the requested key agreement
      * algorithm.
      * See the KeyAgreement section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyAgreement">
      * Java Cryptography Architecture Standard Algorithm Name Documentation
      * for information about standard algorithm names.
      *
@@ -185,7 +183,7 @@
      * @param algorithm the standard name of the requested key agreement
      * algorithm.
      * See the KeyAgreement section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyAgreement">
      * Java Cryptography Architecture Standard Algorithm Name Documentation
      * for information about standard algorithm names.
      *
@@ -229,7 +227,7 @@
      * @param algorithm the standard name of the requested key agreement
      * algorithm.
      * See the KeyAgreement section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyAgreement">
      * Java Cryptography Architecture Standard Algorithm Name Documentation
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/crypto/KeyGenerator.java b/ojluni/src/main/java/javax/crypto/KeyGenerator.java
index 8358f53..ff878ed 100755
--- a/ojluni/src/main/java/javax/crypto/KeyGenerator.java
+++ b/ojluni/src/main/java/javax/crypto/KeyGenerator.java
@@ -84,18 +84,22 @@
  * (via a call to an <code>init</code> method), each provider must
  * supply (and document) a default initialization.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>KeyGenerator</code> algorithms with the keysizes in
- * parentheses:
+ * <p> Latest Android version provides the following <code>KeyGenerator</code> algorithms:
  * <ul>
- * <li><tt>AES</tt> (128)</li>
- * <li><tt>DES</tt> (56)</li>
- * <li><tt>DESede</tt> (168)</li>
+ * <li><tt>AES</tt></li>
+ * <li><tt>ARC4</tt></li>
+ * <li><tt>Blowfish</tt></li>
+ * <li><tt>DES</tt></li>
+ * <li><tt>DESede</tt></li>
+ * <li><tt>HmacMD5</tt></li>
  * <li><tt>HmacSHA1</tt></li>
+ * <li><tt>HmacSHA224</tt></li>
  * <li><tt>HmacSHA256</tt></li>
+ * <li><tt>HmacSHA384</tt></li>
+ * <li><tt>HmacSHA512</tt></li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyGenerator">
  * KeyGenerator section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
  * Consult the release documentation for your implementation to see if any
@@ -188,7 +192,7 @@
      *
      * @param algorithm the standard name of the requested key algorithm.
      * See the KeyGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -221,7 +225,7 @@
      *
      * @param algorithm the standard name of the requested key algorithm.
      * See the KeyGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -263,7 +267,7 @@
      *
      * @param algorithm the standard name of the requested key algorithm.
      * See the KeyGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#KeyGenerator">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/crypto/Mac.java b/ojluni/src/main/java/javax/crypto/Mac.java
index 3822038..39ae20c 100755
--- a/ojluni/src/main/java/javax/crypto/Mac.java
+++ b/ojluni/src/main/java/javax/crypto/Mac.java
@@ -54,19 +54,21 @@
  * e.g., MD5 or SHA-1, in combination with a secret shared key. HMAC is
  * specified in RFC 2104.
  *
- * <p> Every implementation of the Java platform is required to support
- * the following standard <code>Mac</code> algorithms:
+ * <p> Latest Android version provides the following <code>Mac</code> algorithms:
  * <ul>
  * <li><tt>HmacMD5</tt></li>
  * <li><tt>HmacSHA1</tt></li>
+ * <li><tt>HmacSHA224</tt></li>
  * <li><tt>HmacSHA256</tt></li>
+ * <li><tt>HmacSHA384</tt></li>
+ * <li><tt>HmacSHA512</tt></li>
+ * <li><tt>PBEWITHHmacSHA</tt></li>
+ * <li><tt>PBEWITHHmacSHA1</tt></li>
  * </ul>
  * These algorithms are described in the
- * <a href="{@docRoot}/../technotes/guides/security/StandardNames.html#Mac">
+ * <a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Mac">
  * Mac section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Jan Luehe
  *
@@ -139,7 +141,7 @@
      *
      * @param algorithm the standard name of the requested MAC algorithm.
      * See the Mac section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Mac">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Mac">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -181,7 +183,7 @@
      *
      * @param algorithm the standard name of the requested MAC algorithm.
      * See the Mac section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Mac">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Mac">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -219,7 +221,7 @@
      *
      * @param algorithm the standard name of the requested MAC algorithm.
      * See the Mac section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Mac">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Mac">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/crypto/SecretKeyFactory.java b/ojluni/src/main/java/javax/crypto/SecretKeyFactory.java
index bf32bae..0026b0e 100755
--- a/ojluni/src/main/java/javax/crypto/SecretKeyFactory.java
+++ b/ojluni/src/main/java/javax/crypto/SecretKeyFactory.java
@@ -58,18 +58,44 @@
  * <code>DESedeKeySpec</code> as a transparent representation of Triple DES
  * keys.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>SecretKeyFactory</code> algorithms:
+ * <p> Latest Android version provides the following <code>SecretKeyFactory</code> algorithms:
  * <ul>
+ * <li><tt>AES</tt></li>
  * <li><tt>DES</tt></li>
  * <li><tt>DESede</tt></li>
+ * <li><tt>HMACSHA1</tt></li>
+ * <li><tt>HMACSHA224</tt></li>
+ * <li><tt>HMACSHA256</tt></li>
+ * <li><tt>HMACSHA384</tt></li>
+ * <li><tt>HMACSHA512</tt></li>
+ * <li><tt>PBEWITHHMACSHA1</tt></li>
+ * <li><tt>PBEWITHMD5AND128BITAES-CBC-OPENSSL</tt></li>
+ * <li><tt>PBEWITHMD5AND192BITAES-CBC-OPENSSL</tt></li>
+ * <li><tt>PBEWITHMD5AND256BITAES-CBC-OPENSSL</tt></li>
+ * <li><tt>PBEWITHMD5ANDDES</tt></li>
+ * <li><tt>PBEWITHMD5ANDRC2</tt></li>
+ * <li><tt>PBEWITHSHA1ANDDES</tt></li>
+ * <li><tt>PBEWITHSHA1ANDRC2</tt></li>
+ * <li><tt>PBEWITHSHA256AND128BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEWITHSHA256AND192BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEWITHSHA256AND256BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEWITHSHAAND128BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEWITHSHAAND128BITRC2-CBC</tt></li>
+ * <li><tt>PBEWITHSHAAND128BITRC4</tt></li>
+ * <li><tt>PBEWITHSHAAND192BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEWITHSHAAND2-KEYTRIPLEDES-CBC</tt></li>
+ * <li><tt>PBEWITHSHAAND256BITAES-CBC-BC</tt></li>
+ * <li><tt>PBEWITHSHAAND3-KEYTRIPLEDES-CBC</tt></li>
+ * <li><tt>PBEWITHSHAAND40BITRC2-CBC</tt></li>
+ * <li><tt>PBEWITHSHAAND40BITRC4</tt></li>
+ * <li><tt>PBEWITHSHAANDTWOFISH-CBC</tt></li>
+ * <li><tt>PBKDF2WITHHMACSHA1</tt></li>
+ * <li><tt>PBKDF2WITHHMACSHA1AND8BIT</tt></li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecretKeyFactory">
  * SecretKeyFactory section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @author Jan Luehe
  *
@@ -139,7 +165,7 @@
      * @param algorithm the standard name of the requested secret-key
      * algorithm.
      * See the SecretKeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecretKeyFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -174,7 +200,7 @@
      * @param algorithm the standard name of the requested secret-key
      * algorithm.
      * See the SecretKeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecretKeyFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
@@ -218,7 +244,7 @@
      * @param algorithm the standard name of the requested secret-key
      * algorithm.
      * See the SecretKeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SecretKeyFactory">
      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/crypto/interfaces/package.html b/ojluni/src/main/java/javax/crypto/interfaces/package.html
index 8b18ce2..8c5ba20 100755
--- a/ojluni/src/main/java/javax/crypto/interfaces/package.html
+++ b/ojluni/src/main/java/javax/crypto/interfaces/package.html
@@ -46,7 +46,7 @@
 cryptographic provider developer guide:
 <ul>
   <li><a href=
-    "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
+    "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
     <b>How to Implement a Provider for the
     Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
     </b></a></li>
@@ -65,7 +65,7 @@
 <ul>
   <li>
     <a href=
-      "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+      "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
       <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
       Cryptography Architecture API Specification and Reference
       </b></a></li>
diff --git a/ojluni/src/main/java/javax/crypto/package.html b/ojluni/src/main/java/javax/crypto/package.html
index 1518573..ec2239a 100755
--- a/ojluni/src/main/java/javax/crypto/package.html
+++ b/ojluni/src/main/java/javax/crypto/package.html
@@ -47,7 +47,7 @@
 <h2>Package Specification</h2>
 
 <ul>
-  <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html"><b>
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html"><b>
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture Standard Algorithm Name
     Documentation</b></a></li>
@@ -59,13 +59,13 @@
 <ul>
   <li>
     <a href=
-      "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+      "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
       <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
        Cryptography Architecture (JCA) Reference Guide
       </b></a></li>
   <li>
     <a href=
-      "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
+      "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
       <b>How to Implement a Provider in the
       Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
       </b></a></li>
diff --git a/ojluni/src/main/java/javax/crypto/spec/SecretKeySpec.java b/ojluni/src/main/java/javax/crypto/spec/SecretKeySpec.java
index 0dc7f27..6f4cc3e 100755
--- a/ojluni/src/main/java/javax/crypto/spec/SecretKeySpec.java
+++ b/ojluni/src/main/java/javax/crypto/spec/SecretKeySpec.java
@@ -82,7 +82,7 @@
      * @param algorithm the name of the secret-key algorithm to be associated
      * with the given key material.
      * See Appendix A in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      * Java Cryptography Architecture Reference Guide</a>
      * for information about standard algorithm names.
      * @exception IllegalArgumentException if <code>algorithm</code>
@@ -127,7 +127,7 @@
      * @param algorithm the name of the secret-key algorithm to be associated
      * with the given key material.
      * See Appendix A in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      * Java Cryptography Architecture Reference Guide</a>
      * for information about standard algorithm names.
      * @exception IllegalArgumentException if <code>algorithm</code>
diff --git a/ojluni/src/main/java/javax/crypto/spec/package.html b/ojluni/src/main/java/javax/crypto/spec/package.html
index b8fd807..3b87900 100755
--- a/ojluni/src/main/java/javax/crypto/spec/package.html
+++ b/ojluni/src/main/java/javax/crypto/spec/package.html
@@ -61,13 +61,13 @@
 <ul>
   <li>
     <a href=
-      "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
+      "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
       <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
       Cryptography Architecture API Specification and Reference
       </b></a></li>
   <li>
     <a href=
-      "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
+      "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
       <b>How to Implement a Provider for the
       Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
       </b></a></li>
diff --git a/ojluni/src/main/java/javax/net/ssl/ExtendedSSLSession.java b/ojluni/src/main/java/javax/net/ssl/ExtendedSSLSession.java
index 70f98ce..d1a24ac 100755
--- a/ojluni/src/main/java/javax/net/ssl/ExtendedSSLSession.java
+++ b/ojluni/src/main/java/javax/net/ssl/ExtendedSSLSession.java
@@ -45,7 +45,7 @@
      * The signature algorithm name must be a standard Java Security
      * name (such as "SHA1withRSA", "SHA256withECDSA", and so on).
      * See Appendix A in the <a href=
-     * "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      * Java Cryptography Architecture API Specification &amp; Reference </a>
      * for information about standard algorithm names.
      * <p>
@@ -73,7 +73,7 @@
      * The signature algorithm name must be a standard Java Security
      * name (such as "SHA1withRSA", "SHA256withECDSA", and so on).
      * See Appendix A in the <a href=
-     * "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      * Java Cryptography Architecture API Specification &amp; Reference </a>
      * for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/net/ssl/KeyManagerFactory.java b/ojluni/src/main/java/javax/net/ssl/KeyManagerFactory.java
index e7fe89f..70ea99f 100755
--- a/ojluni/src/main/java/javax/net/ssl/KeyManagerFactory.java
+++ b/ojluni/src/main/java/javax/net/ssl/KeyManagerFactory.java
@@ -121,7 +121,7 @@
      *
      * @param algorithm the standard name of the requested algorithm.
      *          See the <a href=
-     *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/jsse/JSSERefGuide.html">
      *          Java Secure Socket Extension Reference Guide </a>
      *          for information about standard algorithm names.
      *
@@ -157,7 +157,7 @@
 
      * @param algorithm the standard name of the requested algorithm.
      *          See the <a href=
-     *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/jsse/JSSERefGuide.html">
      *          Java Secure Socket Extension Reference Guide </a>
      *          for information about standard algorithm names.
      *
@@ -198,7 +198,7 @@
      *
      * @param algorithm the standard name of the requested algorithm.
      *          See the <a href=
-     *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/jsse/JSSERefGuide.html">
      *          Java Secure Socket Extension Reference Guide </a>
      *          for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLContext.java b/ojluni/src/main/java/javax/net/ssl/SSLContext.java
index 6852df2..4f0bfe1 100755
--- a/ojluni/src/main/java/javax/net/ssl/SSLContext.java
+++ b/ojluni/src/main/java/javax/net/ssl/SSLContext.java
@@ -37,17 +37,20 @@
  * with an optional set of key and trust managers and source of
  * secure random bytes.
  *
- * <p> Every implementation of the Java platform is required to support the
- * following standard <code>SSLContext</code> protocol:
+ * <p> Latest Android version provides the following <code>SSLContext</code> protocol:
  * <ul>
- * <li><tt>TLSv1</tt></li>
+ * <li><tt>DEFAULT</tt></li>
+ * <li><tt>SSL</tt></li>
+ * <li><tt>SSLV3</tt></li>
+ * <li><tt>TLS</tt></li>
+ * <li><tt>TLSV1</tt></li>
+ * <li><tt>TLSV1.1</tt></li>
+ * <li><tt>TLSV1.2</tt></li>
  * </ul>
  * This protocol is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SSLContext">
  * SSLContext section</a> of the
  * Java Cryptography Architecture Standard Algorithm Name Documentation.
- * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
  *
  * @since 1.4
  */
@@ -137,7 +140,7 @@
      *
      * @param protocol the standard name of the requested protocol.
      *          See the SSLContext section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SSLContext">
      *          Java Cryptography Architecture Standard Algorithm Name
      *          Documentation</a>
      *          for information about standard protocol names.
@@ -173,7 +176,7 @@
      *
      * @param protocol the standard name of the requested protocol.
      *          See the SSLContext section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SSLContext">
      *          Java Cryptography Architecture Standard Algorithm Name
      *          Documentation</a>
      *          for information about standard protocol names.
@@ -213,7 +216,7 @@
      *
      * @param protocol the standard name of the requested protocol.
      *          See the SSLContext section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
+     * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#SSLContext">
      *          Java Cryptography Architecture Standard Algorithm Name
      *          Documentation</a>
      *          for information about standard protocol names.
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLParameters.java b/ojluni/src/main/java/javax/net/ssl/SSLParameters.java
index 1baa331..c83f656 100755
--- a/ojluni/src/main/java/javax/net/ssl/SSLParameters.java
+++ b/ojluni/src/main/java/javax/net/ssl/SSLParameters.java
@@ -255,7 +255,7 @@
      *
      * @param algorithm The standard string name of the endpoint
      *     identification algorithm (or null).  See Appendix A in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
+     *   "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html#AppA">
      *     Java Cryptography Architecture API Specification &amp; Reference </a>
      *     for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/net/ssl/TrustManagerFactory.java b/ojluni/src/main/java/javax/net/ssl/TrustManagerFactory.java
index b1762fc..aa5baa7 100755
--- a/ojluni/src/main/java/javax/net/ssl/TrustManagerFactory.java
+++ b/ojluni/src/main/java/javax/net/ssl/TrustManagerFactory.java
@@ -120,7 +120,7 @@
      *
      * @param algorithm the standard name of the requested trust management
      *          algorithm.  See the <a href=
-     *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/jsse/JSSERefGuide.html">
      *          Java Secure Socket Extension Reference Guide </a>
      *          for information about standard algorithm names.
      *
@@ -156,7 +156,7 @@
      *
      * @param algorithm the standard name of the requested trust management
      *          algorithm.  See the <a href=
-     *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/jsse/JSSERefGuide.html">
      *          Java Secure Socket Extension Reference Guide </a>
      *          for information about standard algorithm names.
      *
@@ -197,7 +197,7 @@
      *
      * @param algorithm the standard name of the requested trust management
      *          algorithm.  See the <a href=
-     *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
+     *  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/jsse/JSSERefGuide.html">
      *          Java Secure Socket Extension Reference Guide </a>
      *          for information about standard algorithm names.
      *
diff --git a/ojluni/src/main/java/javax/net/ssl/package.html b/ojluni/src/main/java/javax/net/ssl/package.html
index 5213137..fc4d95c 100755
--- a/ojluni/src/main/java/javax/net/ssl/package.html
+++ b/ojluni/src/main/java/javax/net/ssl/package.html
@@ -37,7 +37,7 @@
 <h2>Package Specification</h2>
 
 <ul>
-  <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture Standard Algorithm Name
     Documentation</b></a></li>
diff --git a/ojluni/src/main/java/javax/security/auth/login/package.html b/ojluni/src/main/java/javax/security/auth/login/package.html
index 0088f07..6bf4b6d 100755
--- a/ojluni/src/main/java/javax/security/auth/login/package.html
+++ b/ojluni/src/main/java/javax/security/auth/login/package.html
@@ -33,7 +33,7 @@
 <h2>Package Specification</h2>
 
 <ul>
-  <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
+  <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture Standard Algorithm Name
     Documentation</b></a></li>
diff --git a/ojluni/src/main/java/javax/security/sasl/package.html b/ojluni/src/main/java/javax/security/sasl/package.html
index 7d9ba43..20a83ce 100755
--- a/ojluni/src/main/java/javax/security/sasl/package.html
+++ b/ojluni/src/main/java/javax/security/sasl/package.html
@@ -102,7 +102,7 @@
 <h2>Related Documentation</h2>
 
 Please refer to the 
-<a href="{@docRoot}/../technotes/guides/security/sasl/sasl-refguide.html">Java 
+<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/sasl/sasl-refguide.html">Java 
 SASL Programming Guide</a> for information on how to use this API.
 
 
diff --git a/ojluni/src/main/java/javax/sql/rowset/spi/package.html b/ojluni/src/main/java/javax/sql/rowset/spi/package.html
index a573271..93d647d 100755
--- a/ojluni/src/main/java/javax/sql/rowset/spi/package.html
+++ b/ojluni/src/main/java/javax/sql/rowset/spi/package.html
@@ -494,12 +494,12 @@
 <a name="relspec"><h3>5.0 Related Specifications</h3>
 <ul>
 <li><a href="http://java.sun.com/products/jndi">JNDI 1.3</a>
-<li><a href="{@docRoot}/../technotes/guides/logging/index.html">Java Logging
+<li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/logging/index.html">Java Logging
 APIs</a>
 </ul>
 <a name="reldocs"><h3>6.0 Related Documentation</h3>
 <ul>
-<li><a href="{@docRoot}/../technotes/tools/index.html#basic">System
+<li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/index.html#basic">System
 properties</a>
 <li>Resource Files
 <li><a href="http://java.sun.com/tutorial/jdbc">DataSource for JDBC
diff --git a/ojluni/src/main/native/Bits.c b/ojluni/src/main/native/Bits.c
index 122fd49..18e5e59 100644
--- a/ojluni/src/main/native/Bits.c
+++ b/ojluni/src/main/native/Bits.c
@@ -54,13 +54,13 @@
 #define MBYTE 1048576
 
 #define GETCRITICAL(bytes, env, obj) { \
-    bytes = (*env)->GetPrimitiveArrayCritical(env, obj, NULL); \
-    if (bytes == NULL) \
+    (bytes) = (*(env))->GetPrimitiveArrayCritical(env, obj, NULL); \
+    if ((bytes) == NULL) \
         JNU_ThrowInternalError(env, "Unable to get array"); \
 }
 
 #define RELEASECRITICAL(bytes, env, obj, mode) { \
-    (*env)->ReleasePrimitiveArrayCritical(env, obj, bytes, mode); \
+    (*(env))->ReleasePrimitiveArrayCritical(env, obj, bytes, mode); \
 }
 
 #define SWAPSHORT(x) ((jshort)(((x) << 8) | (((x) >> 8) & 0xff)))
diff --git a/ojluni/src/main/native/EPollArrayWrapper.c b/ojluni/src/main/native/EPollArrayWrapper.c
index f14a85a..5a4374e 100644
--- a/ojluni/src/main/native/EPollArrayWrapper.c
+++ b/ojluni/src/main/native/EPollArrayWrapper.c
@@ -35,8 +35,8 @@
 
 #define RESTARTABLE(_cmd, _result) do { \
   do { \
-    _result = _cmd; \
-  } while((_result == -1) && (errno == EINTR)); \
+    (_result) = _cmd; \
+  } while(((_result) == -1) && (errno == EINTR)); \
 } while(0)
 
 
diff --git a/ojluni/src/main/native/Inet4Address.c b/ojluni/src/main/native/Inet4Address.c
index cd41068..5c7df40 100755
--- a/ojluni/src/main/native/Inet4Address.c
+++ b/ojluni/src/main/native/Inet4Address.c
@@ -37,13 +37,7 @@
 jclass ia4_class;
 jmethodID ia4_ctrID;
 
-/*
- * Class:     java_net_Inet4Address
- * Method:    init
- * Signature: ()V
- */
-JNIEXPORT void JNICALL
-Inet4Address_init(JNIEnv *env, jclass cls) {
+static void Inet4Address_init(JNIEnv *env) {
     jclass c = (*env)->FindClass(env, "java/net/Inet4Address");
     CHECK_NULL(c);
     ia4_class = (*env)->NewGlobalRef(env, c);
@@ -52,10 +46,6 @@
     CHECK_NULL(ia4_ctrID);
 }
 
-static JNINativeMethod gMethods[] = {
-  NATIVE_METHOD(Inet4Address, init, "()V"),
-};
-
 void register_java_net_Inet4Address(JNIEnv* env) {
-  jniRegisterNativeMethods(env, "java/net/Inet4Address", gMethods, NELEM(gMethods));
+    Inet4Address_init(env);
 }
diff --git a/ojluni/src/main/native/Inet6Address.c b/ojluni/src/main/native/Inet6Address.c
index 2dfc38f..ad2d978 100755
--- a/ojluni/src/main/native/Inet6Address.c
+++ b/ojluni/src/main/native/Inet6Address.c
@@ -43,13 +43,7 @@
 jfieldID ia6_scopeifnamesetID;
 jmethodID ia6_ctrID;
 
-/*
- * Class:     java_net_Inet6Address
- * Method:    init
- * Signature: ()V
- */
-JNIEXPORT void JNICALL
-Inet6Address_init(JNIEnv *env, jclass cls) {
+static void Inet6Address_init(JNIEnv *env) {
     jclass c = (*env)->FindClass(env, "java/net/Inet6Address");
     CHECK_NULL(c);
     ia6_class = (*env)->NewGlobalRef(env, c);
@@ -68,10 +62,6 @@
     CHECK_NULL(ia6_ctrID);
 }
 
-static JNINativeMethod gMethods[] = {
-  NATIVE_METHOD(Inet6Address, init, "()V"),
-};
-
 void register_java_net_Inet6Address(JNIEnv* env) {
-  jniRegisterNativeMethods(env, "java/net/Inet6Address", gMethods, NELEM(gMethods));
+    Inet6Address_init(env);
 }
diff --git a/ojluni/src/main/native/InetAddress.c b/ojluni/src/main/native/InetAddress.c
index ef76ed8..0f0fefe 100755
--- a/ojluni/src/main/native/InetAddress.c
+++ b/ojluni/src/main/native/InetAddress.c
@@ -42,13 +42,7 @@
 jfieldID iac_familyID;
 jfieldID iac_hostNameID;
 
-/*
- * Class:     java_net_InetAddress
- * Method:    init
- * Signature: ()V
- */
-JNIEXPORT void JNICALL
-InetAddress_init(JNIEnv *env, jclass cls) {
+static void InetAddress_init(JNIEnv *env) {
     jclass c = (*env)->FindClass(env,"java/net/InetAddress");
     CHECK_NULL(c);
     ia_class = (*env)->NewGlobalRef(env, c);
@@ -67,10 +61,6 @@
     CHECK_NULL(iac_hostNameID);
 }
 
-static JNINativeMethod gMethods[] = {
-  NATIVE_METHOD(InetAddress, init, "()V"),
-};
-
 void register_java_net_InetAddress(JNIEnv* env) {
-  jniRegisterNativeMethods(env, "java/net/InetAddress", gMethods, NELEM(gMethods));
+  InetAddress_init(env);
 }
diff --git a/ojluni/src/main/native/Net.c b/ojluni/src/main/native/Net.c
index 02fa69c..4c5f5a6 100644
--- a/ojluni/src/main/native/Net.c
+++ b/ojluni/src/main/native/Net.c
@@ -92,7 +92,7 @@
 
 
 #define COPY_INET6_ADDRESS(env, source, target) \
-    (*env)->GetByteArrayRegion(env, source, 0, 16, target)
+    (*(env))->GetByteArrayRegion(env, source, 0, 16, target)
 
 /*
  * Copy IPv6 group, interface index, and IPv6 source address
diff --git a/ojluni/src/main/native/NetworkInterface.c b/ojluni/src/main/native/NetworkInterface.c
index 94cdd03..48450e1 100755
--- a/ojluni/src/main/native/NetworkInterface.c
+++ b/ojluni/src/main/native/NetworkInterface.c
@@ -125,13 +125,7 @@
 
 /******************* Java entry points *****************************/
 
-/*
- * Class:     java_net_NetworkInterface
- * Method:    init
- * Signature: ()V
- */
-JNIEXPORT void JNICALL
-NetworkInterface_init(JNIEnv *env, jclass cls) {
+static void NetworkInterface_init(JNIEnv *env) {
     ni_class = (*env)->FindClass(env,"java/net/NetworkInterface");
     ni_class = (*env)->NewGlobalRef(env, ni_class);
     ni_nameID = (*env)->GetFieldID(env, ni_class,"name", "Ljava/lang/String;");
@@ -715,8 +709,8 @@
 
 #define CHECKED_MALLOC3(_pointer,_type,_size) \
     do{ \
-      _pointer = (_type)malloc( _size ); \
-      if (_pointer == NULL) { \
+      (_pointer) = (_type)malloc( _size ); \
+      if ((_pointer) == NULL) { \
         JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed"); \
         return ifs; /* return untouched list */ \
       } \
@@ -1080,10 +1074,9 @@
   NATIVE_METHOD(NetworkInterface, getByInetAddress0, "(Ljava/net/InetAddress;)Ljava/net/NetworkInterface;"),
   NATIVE_METHOD(NetworkInterface, getByIndex0, "(I)Ljava/net/NetworkInterface;"),
   NATIVE_METHOD(NetworkInterface, getByName0, "(Ljava/lang/String;)Ljava/net/NetworkInterface;"),
-  NATIVE_METHOD(NetworkInterface, init, "()V"),
-
 };
 
 void register_java_net_NetworkInterface(JNIEnv* env) {
   jniRegisterNativeMethods(env, "java/net/NetworkInterface", gMethods, NELEM(gMethods));
+  NetworkInterface_init(env);
 }
diff --git a/ojluni/src/main/native/PlainDatagramSocketImpl.c b/ojluni/src/main/native/PlainDatagramSocketImpl.c
index 1b1e3f6..c7b753e 100755
--- a/ojluni/src/main/native/PlainDatagramSocketImpl.c
+++ b/ojluni/src/main/native/PlainDatagramSocketImpl.c
@@ -168,11 +168,6 @@
     IO_fd_fdID = NET_GetFileDescriptorID(env);
     CHECK_NULL(IO_fd_fdID);
 
-    InetAddress_init(env, 0);
-    Inet4Address_init(env, 0);
-    Inet6Address_init(env, 0);
-    NetworkInterface_init(env, 0);
-
 #ifdef __linux__
 #ifdef AF_INET6
     pdsi_multicastInterfaceID = (*env)->GetFieldID(env, cls, "multicastInterface", "I");
diff --git a/ojluni/src/main/native/PlainSocketImpl.c b/ojluni/src/main/native/PlainSocketImpl.c
index db25104..521a6ef 100755
--- a/ojluni/src/main/native/PlainSocketImpl.c
+++ b/ojluni/src/main/native/PlainSocketImpl.c
@@ -98,17 +98,8 @@
     return (*env)->GetIntField(env, fdObj, IO_fd_fdID);
 }
 
-/*
- * The initroto function is called whenever PlainSocketImpl is
- * loaded, to cache fieldIds for efficiency. This is called everytime
- * the Java class is loaded.
- *
- * Class:     java_net_PlainSocketImpl
- * Method:    initProto
- * Signature: ()V
- */
-JNIEXPORT void JNICALL
-PlainSocketImpl_initProto(JNIEnv *env, jclass cls) {
+static void PlainSocketImpl_initProto(JNIEnv *env) {
+    jclass cls = (*env)->FindClass(env, "java/net/PlainSocketImpl");
     psi_fdID = (*env)->GetFieldID(env, cls , "fd",
                                   "Ljava/io/FileDescriptor;");
     CHECK_NULL(psi_fdID);
@@ -1091,9 +1082,9 @@
   NATIVE_METHOD(PlainSocketImpl, socketBind, "(Ljava/net/InetAddress;I)V"),
   NATIVE_METHOD(PlainSocketImpl, socketConnect, "(Ljava/net/InetAddress;II)V"),
   NATIVE_METHOD(PlainSocketImpl, socketCreate, "(Z)V"),
-  NATIVE_METHOD(PlainSocketImpl, initProto, "()V"),
 };
 
 void register_java_net_PlainSocketImpl(JNIEnv* env) {
   jniRegisterNativeMethods(env, "java/net/PlainSocketImpl", gMethods, NELEM(gMethods));
+  PlainSocketImpl_initProto(env);
 }
diff --git a/ojluni/src/main/native/Register.cpp b/ojluni/src/main/native/Register.cpp
index 8e522d6..f1eb490 100644
--- a/ojluni/src/main/native/Register.cpp
+++ b/ojluni/src/main/native/Register.cpp
@@ -116,6 +116,19 @@
     register_sun_nio_ch_NativeThread(env);
     register_sun_nio_ch_FileKey(env);
     register_java_io_ObjectStreamClass(env);
+    register_java_lang_Character(env);
+    register_java_lang_Float(env);
+    register_java_lang_Double(env);
+    register_java_lang_StrictMath(env);
+    register_java_lang_Math(env);
+    register_java_lang_ProcessEnvironment(env);
+    register_java_lang_Runtime(env);
+    register_java_lang_System(env);
+    register_java_lang_Shutdown(env);
+    register_java_lang_UNIXProcess(env);
+    // register_java_net_InetAddress depends on java_lang_Float & Math being
+    // fully registered (getMethodId on InetAddress class triggers its
+    // <clinit> which depends on java.lang.Float)
     register_java_net_InetAddress(env);
     register_java_net_Inet4Address(env);
     register_java_net_Inet6Address(env);
@@ -127,16 +140,6 @@
     register_java_net_SocketInputStream(env);
     register_java_net_SocketOutputStream(env);
     register_java_nio_Bits(env);
-    register_java_lang_Character(env);
-    register_java_lang_Float(env);
-    register_java_lang_Double(env);
-    register_java_lang_StrictMath(env);
-    register_java_lang_Math(env);
-    register_java_lang_ProcessEnvironment(env);
-    register_java_lang_Runtime(env);
-    register_java_lang_System(env);
-    register_java_lang_Shutdown(env);
-    register_java_lang_UNIXProcess(env);
     register_java_util_prefs_FileSystemPreferences(env);
     register_sun_nio_ch_ServerSocketChannelImpl(env);
     register_sun_nio_ch_SocketChannelImpl(env);
diff --git a/ojluni/src/main/native/System.c b/ojluni/src/main/native/System.c
index f014983..4c547c0 100755
--- a/ojluni/src/main/native/System.c
+++ b/ojluni/src/main/native/System.c
@@ -77,7 +77,7 @@
 #define GETPROP(props, key, jret) \
     if (1) { \
         jstring jkey = JNU_NewStringPlatform(env, key); \
-        jret = (*env)->CallObjectMethod(env, props, getPropID, jkey); \
+        (jret) = (*env)->CallObjectMethod(env, props, getPropID, jkey); \
         if ((*env)->ExceptionOccurred(env)) return NULL; \
         (*env)->DeleteLocalRef(env, jkey); \
     } else ((void) 0)
diff --git a/ojluni/src/main/native/UNIXProcess_md.c b/ojluni/src/main/native/UNIXProcess_md.c
index a304bdc..3c03221 100755
--- a/ojluni/src/main/native/UNIXProcess_md.c
+++ b/ojluni/src/main/native/UNIXProcess_md.c
@@ -156,8 +156,8 @@
 /* TODO: Refactor. */
 #define RESTARTABLE(_cmd, _result) do { \
   do { \
-    _result = _cmd; \
-  } while((_result == -1) && (errno == EINTR)); \
+    (_result) = _cmd; \
+  } while(((_result) == -1) && (errno == EINTR)); \
 } while(0)
 
 /* This is one of the rare times it's more portable to declare an
diff --git a/ojluni/src/main/native/java_net_PlainSocketImpl.h b/ojluni/src/main/native/java_net_PlainSocketImpl.h
index 22bd59e..a7c14c5 100644
--- a/ojluni/src/main/native/java_net_PlainSocketImpl.h
+++ b/ojluni/src/main/native/java_net_PlainSocketImpl.h
@@ -102,13 +102,6 @@
 JNIEXPORT void JNICALL PlainSocketImpl_socketShutdown
   (JNIEnv *, jobject, jint);
 
-/*
- * Class:     java_net_PlainSocketImpl
- * Method:    initProto
- * Signature: ()V
- */
-JNIEXPORT void JNICALL PlainSocketImpl_initProto
-  (JNIEnv *, jclass);
 
 /*
  * Class:     java_net_PlainSocketImpl
diff --git a/ojluni/src/main/native/java_util_zip_ZipFile.c b/ojluni/src/main/native/java_util_zip_ZipFile.c
index 2c770af..a57e20e 100644
--- a/ojluni/src/main/native/java_util_zip_ZipFile.c
+++ b/ojluni/src/main/native/java_util_zip_ZipFile.c
@@ -345,6 +345,49 @@
     return JNU_NewStringPlatform(env, msg);
 }
 
+JNIEXPORT jobjectArray JNICALL
+JarFile_getMetaInfEntryNames(JNIEnv *env, jobject obj)
+{
+    jlong zfile = (*env)->GetLongField(env, obj, jzfileID);
+    jzfile *zip;
+    int i, count;
+    jobjectArray result = 0;
+
+    if (zfile == 0) {
+        JNU_ThrowByName(env,
+                        "java/lang/IllegalStateException", "zip file closed");
+        return NULL;
+    }
+    zip = jlong_to_ptr(zfile);
+
+    /* count the number of valid ZIP metanames */
+    count = 0;
+    if (zip->metanames != 0) {
+        for (i = 0; i < zip->metacount; i++) {
+            if (zip->metanames[i] != 0) {
+                count++;
+            }
+        }
+    }
+
+    /* If some names were found then build array of java strings */
+    if (count > 0) {
+        jclass cls = (*env)->FindClass(env, "java/lang/String");
+        result = (*env)->NewObjectArray(env, count, cls, 0);
+        if (result != 0) {
+            for (i = 0; i < count; i++) {
+                jstring str = (*env)->NewStringUTF(env, zip->metanames[i]);
+                if (str == 0) {
+                    break;
+                }
+                (*env)->SetObjectArrayElement(env, result, i, str);
+                (*env)->DeleteLocalRef(env, str);
+            }
+        }
+    }
+    return result;
+}
+
 static JNINativeMethod gMethods[] = {
   NATIVE_METHOD(ZipFile, getEntry, "(J[BZ)J"),
   NATIVE_METHOD(ZipFile, freeEntry, "(JJ)V"),
@@ -365,8 +408,13 @@
   NATIVE_METHOD(ZipFile, getZipMessage, "(J)Ljava/lang/String;"),
 };
 
+static JNINativeMethod gJarFileMethods[] = {
+  NATIVE_METHOD(JarFile, getMetaInfEntryNames, "()[Ljava/lang/String;"),
+};
+
 void register_java_util_zip_ZipFile(JNIEnv* env) {
   jniRegisterNativeMethods(env, "java/util/zip/ZipFile", gMethods, NELEM(gMethods));
-
   ZipFile_initIDs(env);
+
+  jniRegisterNativeMethods(env, "java/util/jar/JarFile", gJarFileMethods, NELEM(gJarFileMethods));
 }
diff --git a/ojluni/src/main/native/net_util.c b/ojluni/src/main/native/net_util.c
index c3acf0c..a656ed3 100755
--- a/ojluni/src/main/native/net_util.c
+++ b/ojluni/src/main/native/net_util.c
@@ -62,17 +62,6 @@
     return JNI_VERSION_1_2;
 }
 
-static int initialized = 0;
-
-static void initInetAddrs(JNIEnv *env) {
-    if (!initialized) {
-        InetAddress_init(env, 0);
-        Inet4Address_init(env, 0);
-        Inet6Address_init(env, 0);
-        initialized = 1;
-    }
-}
-
 /* The address, and family fields used to be in InetAddress
  * but are now in an implementation object. So, there is an extra
  * level of indirection to access them now.
@@ -85,28 +74,24 @@
 
 void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) {
     jobject holder;
-    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetIntField(env, holder, iac_addressID, address);
 }
 
 void setInetAddress_family(JNIEnv *env, jobject iaObj, int family) {
     jobject holder;
-    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetIntField(env, holder, iac_familyID, family);
 }
 
 void setInetAddress_hostName(JNIEnv *env, jobject iaObj, jobject host) {
     jobject holder;
-    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetObjectField(env, holder, iac_hostNameID, host);
 }
 
 int getInetAddress_addr(JNIEnv *env, jobject iaObj) {
     jobject holder;
-    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetIntField(env, holder, iac_addressID);
 }
@@ -114,14 +99,12 @@
 int getInetAddress_family(JNIEnv *env, jobject iaObj) {
     jobject holder;
 
-    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetIntField(env, holder, iac_familyID);
 }
 
 jobject getInetAddress_hostName(JNIEnv *env, jobject iaObj) {
     jobject holder;
-    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetObjectField(env, holder, iac_hostNameID);
 }
@@ -129,7 +112,6 @@
 JNIEXPORT jobject JNICALL
 NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port) {
     jobject iaObj;
-    initInetAddrs(env);
 #ifdef AF_INET6
     if (him->sa_family == AF_INET6) {
         jbyteArray ipaddress;
diff --git a/ojluni/src/main/native/net_util.h b/ojluni/src/main/native/net_util.h
index 61302e2f..74e8089 100755
--- a/ojluni/src/main/native/net_util.h
+++ b/ojluni/src/main/native/net_util.h
@@ -103,10 +103,6 @@
 /************************************************************************
  *  Utilities
  */
-JNIEXPORT void JNICALL InetAddress_init(JNIEnv *env, jclass cls);
-JNIEXPORT void JNICALL Inet4Address_init(JNIEnv *env, jclass cls);
-JNIEXPORT void JNICALL Inet6Address_init(JNIEnv *env, jclass cls);
-JNIEXPORT void JNICALL NetworkInterface_init(JNIEnv *env, jclass cls);
 
 JNIEXPORT void JNICALL NET_ThrowNew(JNIEnv *env, int errorNum, char *msg);
 int NET_GetError();
diff --git a/ojluni/src/main/native/zip_util.c b/ojluni/src/main/native/zip_util.c
index c79f738..a4dbe14 100644
--- a/ojluni/src/main/native/zip_util.c
+++ b/ojluni/src/main/native/zip_util.c
@@ -440,22 +440,19 @@
 
 /*
  * Returns true if the specified entry's name begins with the string
- * "META-INF/" irrespective of case.
+ * "META-INF/".
  */
 static int
 isMetaName(const char *name, int length)
 {
+    static const char kMetaInf[] = "META-INF/";
+    static const int kMetaInfLength = sizeof(kMetaInf) - 1;
     const char *s;
-    if (length < (int)sizeof("META-INF/") - 1)
+    if (length < kMetaInfLength) {
         return 0;
-    for (s = "META-INF/"; *s != '\0'; s++) {
-        char c = *name++;
-        // Avoid toupper; it's locale-dependent
-        if (c >= 'a' && c <= 'z') c += 'A' - 'a';
-        if (*s != c)
-            return 0;
     }
-    return 1;
+
+    return (strncmp(kMetaInf, name, kMetaInfLength) == 0) ? 1 : 0;
 }
 
 /*