changeset 11259:98c282afebc3

Merge
author minqi
date Sat, 10 Jan 2015 12:38:18 -0800
parents 353147b4364d bdb11ff7e924
children 7ae507e37c51
files test/ProblemList.txt test/java/rmi/server/RemoteServer/setLogPermission/java.policy
diffstat 83 files changed, 1889 insertions(+), 548 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Jan 08 10:44:54 2015 +0100
+++ b/.hgtags	Sat Jan 10 12:38:18 2015 -0800
@@ -285,3 +285,5 @@
 f1ed1540da70a066527fd043413107e47721edbf jdk9-b40
 e336cbd8b15e959e70ed02f0f5e93fa76ebd4c07 jdk9-b41
 6b2314173433467245261364a52fb8e347fe6342 jdk9-b42
+8c6ad41974f9ab6c33d544b088648314963f2a50 jdk9-b43
+8cc4dc300041eb70a7a40e4b2431a8f4d4965ea4 jdk9-b44
--- a/make/src/classes/build/tools/module/boot.modules	Thu Jan 08 10:44:54 2015 +0100
+++ b/make/src/classes/build/tools/module/boot.modules	Sat Jan 10 12:38:18 2015 -0800
@@ -17,10 +17,10 @@
 java.smartcardio
 java.sql
 java.sql.rowset
+java.transaction
 java.xml
 java.xml.bind
 java.xml.crypto
-java.xml.soap
 java.xml.ws
 jdk.charsets
 jdk.deploy
--- a/src/java.base/share/classes/java/io/FilterOutputStream.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/share/classes/java/io/FilterOutputStream.java	Sat Jan 10 12:38:18 2015 -0800
@@ -48,6 +48,8 @@
      */
     protected OutputStream out;
 
+    private boolean closed;
+
     /**
      * Creates an output stream filter built on top of the specified
      * underlying output stream.
@@ -144,9 +146,9 @@
      * Closes this output stream and releases any system resources
      * associated with the stream.
      * <p>
-     * The <code>close</code> method of <code>FilterOutputStream</code>
-     * calls its <code>flush</code> method, and then calls the
-     * <code>close</code> method of its underlying output stream.
+     * When not already closed, the {@code close} method of {@code
+     * FilterOutputStream} calls its {@code flush} method, and then
+     * calls the {@code close} method of its underlying output stream.
      *
      * @exception  IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#flush()
@@ -154,6 +156,9 @@
      */
     @SuppressWarnings("try")
     public void close() throws IOException {
+        if (closed)
+            return;
+        closed = true;
         try (OutputStream ostream = out) {
             flush();
         }
--- a/src/java.base/share/classes/java/lang/Deprecated.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/share/classes/java/lang/Deprecated.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,9 +34,13 @@
  * or because a better alternative exists.  Compilers warn when a
  * deprecated program element is used or overridden in non-deprecated code.
  *
+ * <p>Use of the &#64;Deprecated annotation on a local variable
+ * declaration or on a parameter declaration or a package declaration
+ * has no effect.
+ *
  * @author  Neal Gafter
  * @since 1.5
- * @jls 9.6.3.6 @Deprecated
+ * @jls 9.6.4.6 @Deprecated
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
--- a/src/java.base/share/classes/java/math/BigDecimal.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/share/classes/java/math/BigDecimal.java	Sat Jan 10 12:38:18 2015 -0800
@@ -393,7 +393,7 @@
      * <p>Note that if the sequence of characters is already available
      * within a character array, using this constructor is faster than
      * converting the {@code char} array to string and using the
-     * {@code BigDecimal(String)} constructor .
+     * {@code BigDecimal(String)} constructor.
      *
      * @param  in {@code char} array that is the source of characters.
      * @param  offset first character in the array to inspect.
@@ -466,7 +466,8 @@
                     } else if (c == '.') {   // have dot
                         // have dot
                         if (dot) // two dots
-                            throw new NumberFormatException();
+                            throw new NumberFormatException("Character array"
+                                + " contains more than one decimal point.");
                         dot = true;
                     } else if (Character.isDigit(c)) { // slow path
                         int digit = Character.digit(c, 10);
@@ -488,14 +489,16 @@
                         exp = parseExp(in, offset, len);
                         // Next test is required for backwards compatibility
                         if ((int) exp != exp) // overflow
-                            throw new NumberFormatException();
+                            throw new NumberFormatException("Exponent overflow.");
                         break; // [saves a test]
                     } else {
-                        throw new NumberFormatException();
+                        throw new NumberFormatException("Character " + c
+                            + " is neither a decimal digit number, decimal point, nor"
+                            + " \"e\" notation exponential mark.");
                     }
                 }
                 if (prec == 0) // no digits found
-                    throw new NumberFormatException();
+                    throw new NumberFormatException("No digits found.");
                 // Adjust scale if exp is not zero.
                 if (exp != 0) { // had significant exponent
                     scl = adjustScale(scl, exp);
@@ -541,22 +544,24 @@
                     if (c == '.') {
                         // have dot
                         if (dot) // two dots
-                            throw new NumberFormatException();
+                            throw new NumberFormatException("Character array"
+                                + " contains more than one decimal point.");
                         dot = true;
                         continue;
                     }
                     // exponent expected
                     if ((c != 'e') && (c != 'E'))
-                        throw new NumberFormatException();
+                        throw new NumberFormatException("Character array"
+                            + " is missing \"e\" notation exponential mark.");
                     exp = parseExp(in, offset, len);
                     // Next test is required for backwards compatibility
                     if ((int) exp != exp) // overflow
-                        throw new NumberFormatException();
+                        throw new NumberFormatException("Exponent overflow.");
                     break; // [saves a test]
                 }
                 // here when no characters left
                 if (prec == 0) // no digits found
-                    throw new NumberFormatException();
+                    throw new NumberFormatException("No digits found.");
                 // Adjust scale if exp is not zero.
                 if (exp != 0) { // had significant exponent
                     scl = adjustScale(scl, exp);
@@ -592,10 +597,10 @@
                     }
                 }
             }
-        } catch (ArrayIndexOutOfBoundsException e) {
-            throw new NumberFormatException();
-        } catch (NegativeArraySizeException e) {
-            throw new NumberFormatException();
+        } catch (ArrayIndexOutOfBoundsException | NegativeArraySizeException e) {
+            NumberFormatException nfe = new NumberFormatException();
+            nfe.initCause(e);
+            throw nfe;
         }
         this.scale = scl;
         this.precision = prec;
@@ -627,7 +632,7 @@
             len--;
         }
         if (len <= 0) // no exponent digits
-            throw new NumberFormatException();
+            throw new NumberFormatException("No exponent digits.");
         // skip leading zeros in the exponent
         while (len > 10 && (c=='0' || (Character.digit(c, 10) == 0))) {
             offset++;
@@ -635,7 +640,7 @@
             len--;
         }
         if (len > 10) // too many nonzero exponent digits
-            throw new NumberFormatException();
+            throw new NumberFormatException("Too many nonzero exponent digits.");
         // c now holds first digit of exponent
         for (;; len--) {
             int v;
@@ -644,7 +649,7 @@
             } else {
                 v = Character.digit(c, 10);
                 if (v < 0) // not a digit
-                    throw new NumberFormatException();
+                    throw new NumberFormatException("Not a digit.");
             }
             exp = exp * 10 + v;
             if (len == 1)
--- a/src/java.base/share/classes/java/util/Formatter.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/share/classes/java/util/Formatter.java	Sat Jan 10 12:38:18 2015 -0800
@@ -3727,29 +3727,29 @@
                             exp = new StringBuilder("+00");
                         }
                     }
-                    return;
-                }
-                long adjusted = -(long) scale + (len - 1);
-                if (form == BigDecimalLayoutForm.DECIMAL_FLOAT) {
+                } else if (form == BigDecimalLayoutForm.DECIMAL_FLOAT) {
                     // count of padding zeros
-                    int pad = scale - len;
-                    if (pad >= 0) {
+
+                    if (scale >= len) {
                         // 0.xxx form
                         mant.append("0.");
                         dot = true;
-                        trailingZeros(mant, pad);
+                        trailingZeros(mant, scale - len);
                         mant.append(coeff);
                     } else {
-                        if (-pad < len) {
+                        if (scale > 0) {
                             // xx.xx form
-                            mant.append(coeff, 0, -pad);
+                            int pad = len - scale;
+                            mant.append(coeff, 0, pad);
                             mant.append('.');
                             dot = true;
-                            mant.append(coeff, -pad, -pad + scale);
-                        } else {
+                            mant.append(coeff, pad, len);
+                        } else { // scale < 0
                             // xx form
                             mant.append(coeff, 0, len);
-                            trailingZeros(mant, -scale);
+                            if (intVal.signum() != 0) {
+                                trailingZeros(mant, -scale);
+                            }
                             this.scale = 0;
                         }
                     }
@@ -3762,6 +3762,7 @@
                         mant.append(coeff, 1, len);
                     }
                     exp = new StringBuilder();
+                    long adjusted = -(long) scale + (len - 1);
                     if (adjusted != 0) {
                         long abs = Math.abs(adjusted);
                         // require sign
--- a/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 
 /**
  * This class specifies the parameters used with the
- * <a href="http://www.ietf.org/rfc/rfc2040.txt"><i>RC5</i></a>
+ * <a href="http://tools.ietf.org/html/rfc2040"><i>RC5</i></a>
  * algorithm.
  *
  * <p> The parameters consist of a version number, a rounds count, a word
@@ -37,7 +37,7 @@
  *
  * <p> This class can be used to initialize a <code>Cipher</code> object that
  * implements the <i>RC5</i> algorithm as supplied by
- * <a href="http://www.rsasecurity.com">RSA Security Inc.</a>,
+ * <a href="http://www.rsa.com">RSA Security LLC</a>,
  * or any parties authorized by RSA Security.
  *
  * @author Jan Luehe
--- a/src/java.base/share/classes/sun/security/provider/DSA.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/share/classes/sun/security/provider/DSA.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -117,7 +117,6 @@
         if (params == null) {
             throw new InvalidKeyException("DSA private key lacks parameters");
         }
-        checkKey(params);
 
         this.params = params;
         this.presetX = priv.getX();
@@ -149,7 +148,6 @@
         if (params == null) {
             throw new InvalidKeyException("DSA public key lacks parameters");
         }
-        checkKey(params);
 
         this.params = params;
         this.presetY = pub.getY();
@@ -291,16 +289,6 @@
         return null;
     }
 
-    protected void checkKey(DSAParams params) throws InvalidKeyException {
-        // FIPS186-3 states in sec4.2 that a hash function which provides
-        // a lower security strength than the (L, N) pair ordinarily should
-        // not be used.
-        int valueN = params.getQ().bitLength();
-        if (valueN > md.getDigestLength()*8) {
-            throw new InvalidKeyException("Key is too strong for this signature algorithm");
-        }
-    }
-
     private BigInteger generateR(BigInteger p, BigInteger q, BigInteger g,
                          BigInteger k) {
         BigInteger temp = g.modPow(k, p);
@@ -480,14 +468,6 @@
            }
         }
 
-        @Override
-        protected void checkKey(DSAParams params) throws InvalidKeyException {
-            int valueL = params.getP().bitLength();
-            if (valueL > 1024) {
-                throw new InvalidKeyException("Key is too long for this algorithm");
-            }
-        }
-
         /*
          * Please read bug report 4044247 for an alternative, faster,
          * NON-FIPS approved method to generate K
--- a/src/java.base/share/native/libzip/Deflater.c	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/share/native/libzip/Deflater.c	Sat Jan 10 12:38:18 2015 -0800
@@ -76,10 +76,11 @@
         JNU_ThrowOutOfMemoryError(env, 0);
         return jlong_zero;
     } else {
-        char *msg;
-        switch (deflateInit2(strm, level, Z_DEFLATED,
-                             nowrap ? -MAX_WBITS : MAX_WBITS,
-                             DEF_MEM_LEVEL, strategy)) {
+        const char *msg;
+        int ret = deflateInit2(strm, level, Z_DEFLATED,
+                               nowrap ? -MAX_WBITS : MAX_WBITS,
+                               DEF_MEM_LEVEL, strategy);
+        switch (ret) {
           case Z_OK:
             return ptr_to_jlong(strm);
           case Z_MEM_ERROR:
@@ -91,7 +92,11 @@
             JNU_ThrowIllegalArgumentException(env, 0);
             return jlong_zero;
           default:
-            msg = strm->msg;
+            msg = ((strm->msg != NULL) ? strm->msg :
+                   (ret == Z_VERSION_ERROR) ?
+                   "zlib returned Z_VERSION_ERROR: "
+                   "compile time and runtime zlib implementations differ" :
+                   "unknown error initializing zlib library");
             free(strm);
             JNU_ThrowInternalError(env, msg);
             return jlong_zero;
--- a/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Sat Jan 10 12:38:18 2015 -0800
@@ -123,7 +123,7 @@
             new PrivilegedAction<String>() {
                 @Override
                 public String run() {
-                    return System.getProperty("jdk.net.enableFastFileTransfer");
+                    return System.getProperty("jdk.nio.enableFastFileTransfer");
                 }
             });
         boolean enable;
--- a/src/java.base/windows/native/libnet/NetworkInterface_winXP.c	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.base/windows/native/libnet/NetworkInterface_winXP.c	Sat Jan 10 12:38:18 2015 -0800
@@ -81,9 +81,17 @@
     DWORD ret, flags;
     IP_ADAPTER_ADDRESSES *adapterInfo;
     ULONG len;
+    char *error_msg_buf = NULL;
+    size_t error_msg_buf_size =
+            strlen("IP Helper Library GetAdaptersAddresses function failed"
+                   " with error == ") + 10;
+    int _ret = 0;
+
+
     adapterInfo = (IP_ADAPTER_ADDRESSES *)malloc (bufsize);
     if (adapterInfo == NULL) {
-        JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+        JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+            "Native heap allocation failure");
         return -1;
     }
 
@@ -94,10 +102,12 @@
     ret = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len);
 
     if (ret == ERROR_BUFFER_OVERFLOW) {
-        IP_ADAPTER_ADDRESSES * newAdapterInfo = (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
+        IP_ADAPTER_ADDRESSES * newAdapterInfo =
+            (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
         if (newAdapterInfo == NULL) {
             free(adapterInfo);
-            JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+            JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+                "Native heap allocation failure");
             return -1;
         }
 
@@ -109,8 +119,32 @@
 
     if (ret != ERROR_SUCCESS) {
         free (adapterInfo);
-        JNU_ThrowByName(env, "java/lang/Error",
-                "IP Helper Library GetAdaptersAddresses function failed");
+        if (ret == ERROR_INSUFFICIENT_BUFFER) {
+            JNU_ThrowByName(env, "java/lang/Error",
+                "IP Helper Library GetAdaptersAddresses function failed "
+                "with ERROR_INSUFFICIENT_BUFFER");
+        } else if (ret == ERROR_ADDRESS_NOT_ASSOCIATED ) {
+            JNU_ThrowByName(env, "java/lang/Error",
+                "IP Helper Library GetAdaptersAddresses function failed "
+                "with ERROR_ADDRESS_NOT_ASSOCIATED");
+        } else {
+            error_msg_buf = (char *)malloc(error_msg_buf_size);
+            if (error_msg_buf != NULL) {
+                memset(error_msg_buf, 0, error_msg_buf_size);
+                _ret = _snprintf_s(error_msg_buf, error_msg_buf_size,
+                    _TRUNCATE, "IP Helper Library GetAdaptersAddresses "
+                                "function failed with error == %d", ret);
+                if (_ret != -1) {
+                    JNU_ThrowByName(env, "java/lang/Error", error_msg_buf);
+                } else {
+                    JNU_ThrowByName(env, "java/lang/Error",
+                        "IP Helper Library GetAdaptersAddresses function failure");
+                }
+            } else {
+                JNU_ThrowByName(env, "java/lang/Error",
+                    "IP Helper Library GetAdaptersAddresses function failed");
+            }
+        }
         return -1;
     }
     *adapters = adapterInfo;
@@ -126,9 +160,14 @@
     DWORD flags, val;
     IP_ADAPTER_ADDRESSES *adapterInfo, *ptr, *ret;
     ULONG len;
+    char *error_msg_buf = NULL;
+    size_t error_msg_buf_size =
+        strlen("IP Helper Library GetAdaptersAddresses function failed with error == ") + 10;
+    int _ret = 0;
     adapterInfo = (IP_ADAPTER_ADDRESSES *)malloc (bufsize);
     if (adapterInfo == NULL) {
-        JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+        JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+            "Native heap allocation failure");
         return NULL;
     }
     len = bufsize;
@@ -137,10 +176,12 @@
     flags |= GAA_FLAG_INCLUDE_PREFIX;
     val = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len);
     if (val == ERROR_BUFFER_OVERFLOW) {
-        IP_ADAPTER_ADDRESSES * newAdapterInfo = (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
+        IP_ADAPTER_ADDRESSES * newAdapterInfo =
+                (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
         if (newAdapterInfo == NULL) {
             free(adapterInfo);
-            JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+            JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+                "Native heap allocation failure");
             return NULL;
         }
 
@@ -152,10 +193,35 @@
 
     if (val != ERROR_SUCCESS) {
         free (adapterInfo);
-        JNU_ThrowByName(env, "java/lang/Error",
-                "IP Helper Library GetAdaptersAddresses function failed");
+        if (val == ERROR_INSUFFICIENT_BUFFER) {
+            JNU_ThrowByName(env, "java/lang/Error",
+                "IP Helper Library GetAdaptersAddresses function failed "
+                "with ERROR_INSUFFICIENT_BUFFER");
+        } else if (val == ERROR_ADDRESS_NOT_ASSOCIATED ) {
+            JNU_ThrowByName(env, "java/lang/Error",
+                "IP Helper Library GetAdaptersAddresses function failed "
+                "with ERROR_ADDRESS_NOT_ASSOCIATED");
+        } else {
+            error_msg_buf = (char *)malloc(error_msg_buf_size);
+            if (error_msg_buf != NULL) {
+                memset(error_msg_buf, 0, error_msg_buf_size);
+                _ret = _snprintf_s(error_msg_buf, error_msg_buf_size,
+                    _TRUNCATE, "IP Helper Library GetAdaptersAddresses function failed "
+                               "with error == %d", val);
+                if (_ret != -1) {
+                    JNU_ThrowByName(env, "java/lang/Error", error_msg_buf);
+                } else {
+                    JNU_ThrowByName(env, "java/lang/Error",
+                        "IP Helper Library GetAdaptersAddresses function failure");
+                }
+            } else {
+                JNU_ThrowByName(env, "java/lang/Error",
+                    "IP Helper Library GetAdaptersAddresses function failed");
+            }
+        }
         return NULL;
     }
+
     ptr = adapterInfo;
     ret = NULL;
     while (ptr != NULL) {
@@ -168,7 +234,8 @@
         ret = (IP_ADAPTER_ADDRESSES *) malloc(sizeof(IP_ADAPTER_ADDRESSES));
         if (ret == NULL) {
             free(adapterInfo);
-            JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+            JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+                "Native heap allocation failure");
             return NULL;
         }
 
--- a/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java	Sat Jan 10 12:38:18 2015 -0800
@@ -85,7 +85,7 @@
     public List<String> getNames();
 
     /**
-     * Returns the name of the scripting langauge supported by this
+     * Returns the name of the scripting language supported by this
      * <code>ScriptEngine</code>.
      * @return The name of the supported language.
      */
@@ -104,14 +104,15 @@
      * <ul>
      * <li>ScriptEngine.ENGINE</li>
      * <li>ScriptEngine.ENGINE_VERSION</li>
-     * <li>ScriptEngine.NAME</li>
      * <li>ScriptEngine.LANGUAGE</li>
      * <li>ScriptEngine.LANGUAGE_VERSION</li>
+     * <li>ScriptEngine.NAME</li>
      * </ul>
      * <p>
      * The values for these keys are the Strings returned by <code>getEngineName</code>,
-     * <code>getEngineVersion</code>, <code>getName</code>, <code>getLanguageName</code> and
-     * <code>getLanguageVersion</code> respectively.<br><br>
+     * <code>getEngineVersion</code>, <code>getLanguageName</code>,
+     * <code>getLanguageVersion</code> for the first four keys respectively. For NAME, one of the Strings
+     * returned by <code>getNames</code> is returned.<br><br>
      * A reserved key, <code><b>THREADING</b></code>, whose value describes the behavior of the engine
      * with respect to concurrent execution of scripts and maintenance of state is also defined.
      * These values for the <code><b>THREADING</b></code> key are:<br><br>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.sql/share/classes/javax/transaction/xa/XAException.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.transaction.xa;
+
+/**
+ * The XAException is thrown by the Resource Manager (RM) to inform the
+ * Transaction Manager of an error encountered by the involved transaction.
+ *
+ */
+public class XAException extends Exception {
+    //private static final long serialVersionUID = -8249683284832867751L;
+
+    /**
+     * The error code with which to create the SystemException.
+     *
+     * @serial The error code for the exception
+     */
+    public int errorCode;
+
+    /**
+     * Create an XAException.
+     */
+    public XAException() {
+        super();
+    }
+
+    /**
+     * Create an XAException with a given string.
+     *
+     * @param s The <code>String</code> object containing the exception
+     *          message.
+     */
+    public XAException(String s) {
+        super(s);
+    }
+
+    /**
+     * Create an XAException with a given error code.
+     *
+     * @param errcode The error code identifying the exception.
+     */
+    public XAException(int errcode) {
+        super();
+        errorCode = errcode;
+    }
+
+    /**
+     * The inclusive lower bound of the rollback codes.
+     */
+    public final static int XA_RBBASE = 100;
+
+    /**
+     * Indicates that the rollback was caused by an unspecified reason.
+     */
+    public final static int XA_RBROLLBACK = XA_RBBASE;
+
+    /**
+     * Indicates that the rollback was caused by a communication failure.
+     */
+    public final static int XA_RBCOMMFAIL = XA_RBBASE + 1;
+
+    /**
+     * A deadlock was detected.
+     */
+    public final static int XA_RBDEADLOCK = XA_RBBASE + 2;
+
+    /**
+     * A condition that violates the integrity of the resource was detected.
+     */
+    public final static int XA_RBINTEGRITY = XA_RBBASE + 3;
+
+    /**
+     * The resource manager rolled back the transaction branch for a reason
+     * not on this list.
+     */
+    public final static int XA_RBOTHER = XA_RBBASE + 4;
+
+    /**
+     * A protocol error occurred in the resource manager.
+     */
+    public final static int XA_RBPROTO = XA_RBBASE + 5;
+
+    /**
+     * A transaction branch took too long.
+     */
+    public final static int XA_RBTIMEOUT = XA_RBBASE + 6;
+
+    /**
+     * May retry the transaction branch.
+     */
+    public final static int XA_RBTRANSIENT = XA_RBBASE + 7;
+
+    /**
+     * The inclusive upper bound of the rollback error code.
+     */
+    public final static int XA_RBEND = XA_RBTRANSIENT;
+
+    /**
+     * Resumption must occur where the suspension occurred.
+     */
+    public final static int XA_NOMIGRATE = 9;
+
+    /**
+     * The transaction branch may have been heuristically completed.
+     */
+    public final static int XA_HEURHAZ = 8;
+
+    /**
+     * The transaction branch has been heuristically committed.
+     */
+    public final static int XA_HEURCOM = 7;
+
+    /**
+     * The transaction branch has been heuristically rolled back.
+     */
+    public final static int XA_HEURRB = 6;
+
+    /**
+     * The transaction branch has been heuristically committed and
+     * rolled back.
+     */
+    public final static int XA_HEURMIX = 5;
+
+    /**
+     * Routine returned with no effect and may be reissued.
+     */
+    public final static int XA_RETRY = 4;
+
+    /**
+     * The transaction branch was read-only and has been committed.
+     */
+    public final static int XA_RDONLY = 3;
+
+    /**
+     * There is an asynchronous operation already outstanding.
+     */
+    public final static int XAER_ASYNC = -2;
+
+    /**
+     * A resource manager error has occurred in the transaction branch.
+     */
+    public final static int XAER_RMERR = -3;
+
+    /**
+     * The XID is not valid.
+     */
+    public final static int XAER_NOTA = -4;
+
+    /**
+     * Invalid arguments were given.
+     */
+    public final static int XAER_INVAL = -5;
+
+    /**
+     * Routine was invoked in an inproper context.
+     */
+    public final static int XAER_PROTO = -6;
+
+    /**
+     * Resource manager is unavailable.
+     */
+    public final static int XAER_RMFAIL = -7;
+
+    /**
+     * The XID already exists.
+     */
+    public final static int XAER_DUPID = -8;
+
+    /**
+     * The resource manager is doing work outside a global transaction.
+     */
+    public final static int XAER_OUTSIDE = -9;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.sql/share/classes/javax/transaction/xa/XAResource.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,305 @@
+/*
+ * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.transaction.xa;
+
+/**
+ * The XAResource interface is a Java mapping of the industry standard
+ * XA interface based on the X/Open CAE Specification (Distributed
+ * Transaction Processing: The XA Specification).
+ *
+ * <p>The XA interface defines the contract between a Resource Manager
+ * and a Transaction Manager in a distributed transaction processing
+ * (DTP) environment. A JDBC driver or a JMS provider implements
+ * this interface to support the association between a global transaction
+ * and a database or message service connection.
+ *
+ * <p>The XAResource interface can be supported by any transactional
+ * resource that is intended to be used by application programs in an
+ * environment where transactions are controlled by an external
+ * transaction manager. An example of such a resource is a database
+ * management system. An application may access data through multiple
+ * database connections. Each database connection is enlisted with
+ * the transaction manager as a transactional resource. The transaction
+ * manager obtains an XAResource for each connection participating
+ * in a global transaction. The transaction manager uses the
+ * <code>start</code> method
+ * to associate the global transaction with the resource, and it uses the
+ * <code>end</code> method to disassociate the transaction from
+ * the resource. The resource
+ * manager is responsible for associating the global transaction to all
+ * work performed on its data between the start and end method invocations.
+ *
+ * <p>At transaction commit time, the resource managers are informed by
+ * the transaction manager to prepare, commit, or rollback a transaction
+ * according to the two-phase commit protocol.</p>
+ *
+ */
+public interface XAResource {
+
+    /**
+     * Commits the global transaction specified by xid.
+     *
+     * @param xid A global transaction identifier
+     *
+     * @param onePhase If true, the resource manager should use a one-phase
+     * commit protocol to commit the work done on behalf of xid.
+     *
+     * @exception XAException An error has occurred. Possible XAExceptions
+     * are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR,
+     * XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
+     *
+     * <P>If the resource manager did not commit the transaction and the
+     *  paramether onePhase is set to true, the resource manager may throw
+     *  one of the XA_RB* exceptions. Upon return, the resource manager has
+     *  rolled back the branch's work and has released all held resources.
+     */
+    void commit(Xid xid, boolean onePhase) throws XAException;
+
+    /**
+     * Ends the work performed on behalf of a transaction branch.
+     * The resource manager disassociates the XA resource from the
+     * transaction branch specified and lets the transaction
+     * complete.
+     *
+     * <p>If TMSUSPEND is specified in the flags, the transaction branch
+     * is temporarily suspended in an incomplete state. The transaction
+     * context is in a suspended state and must be resumed via the
+     * <code>start</code> method with TMRESUME specified.</p>
+     *
+     * <p>If TMFAIL is specified, the portion of work has failed.
+     * The resource manager may mark the transaction as rollback-only</p>
+     *
+     * <p>If TMSUCCESS is specified, the portion of work has completed
+     * successfully.</p>
+     *
+     * @param xid A global transaction identifier that is the same as
+     * the identifier used previously in the <code>start</code> method.
+     *
+     * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND.
+     *
+     * @exception XAException An error has occurred. Possible XAException
+     * values are XAER_RMERR, XAER_RMFAILED, XAER_NOTA, XAER_INVAL,
+     * XAER_PROTO, or XA_RB*.
+     */
+    void end(Xid xid, int flags) throws XAException;
+
+    /**
+     * Tells the resource manager to forget about a heuristically
+     * completed transaction branch.
+     *
+     * @param xid A global transaction identifier.
+     *
+     * @exception XAException An error has occurred. Possible exception
+     * values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or
+     * XAER_PROTO.
+     */
+    void forget(Xid xid) throws XAException;
+
+    /**
+     * Obtains the current transaction timeout value set for this
+     * XAResource instance. If <CODE>XAResource.setTransactionTimeout</CODE>
+     * was not used prior to invoking this method, the return value
+     * is the default timeout set for the resource manager; otherwise,
+     * the value used in the previous <CODE>setTransactionTimeout</CODE>
+     * call is returned.
+     *
+     * @return the transaction timeout value in seconds.
+     *
+     * @exception XAException An error has occurred. Possible exception
+     * values are XAER_RMERR and XAER_RMFAIL.
+     */
+    int getTransactionTimeout() throws XAException;
+
+    /**
+     * This method is called to determine if the resource manager
+     * instance represented by the target object is the same as the
+     * resouce manager instance represented by the parameter <i>xares</i>.
+     *
+     * @param xares An XAResource object whose resource manager instance
+     *      is to be compared with the resource manager instance of the
+     *      target object.
+     *
+     * @return <i>true</i> if it's the same RM instance; otherwise
+     *       <i>false</i>.
+     *
+     * @exception XAException An error has occurred. Possible exception
+     * values are XAER_RMERR and XAER_RMFAIL.
+     */
+    boolean isSameRM(XAResource xares) throws XAException;
+
+    /**
+     * Ask the resource manager to prepare for a transaction commit
+     * of the transaction specified in xid.
+     *
+     * @param xid A global transaction identifier.
+     *
+     * @exception XAException An error has occurred. Possible exception
+     * values are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL,
+     * or XAER_PROTO.
+     *
+     * @return A value indicating the resource manager's vote on the
+     * outcome of the transaction. The possible values are: XA_RDONLY
+     * or XA_OK. If the resource manager wants to roll back the
+     * transaction, it should do so by raising an appropriate XAException
+     * in the prepare method.
+     */
+    int prepare(Xid xid) throws XAException;
+
+    /**
+     * Obtains a list of prepared transaction branches from a resource
+     * manager. The transaction manager calls this method during recovery
+     * to obtain the list of transaction branches that are currently in
+     * prepared or heuristically completed states.
+     *
+     * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+     * must be used when no other flags are set in the parameter.
+     *
+     * @exception XAException An error has occurred. Possible values are
+     * XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.
+     *
+     * @return The resource manager returns zero or more XIDs of the
+     * transaction branches that are currently in a prepared or
+     * heuristically completed state. If an error occurs during the
+     * operation, the resource manager should throw the appropriate
+     * XAException.
+     */
+    Xid[] recover(int flag) throws XAException;
+
+    /**
+     * Informs the resource manager to roll back work done on behalf
+     * of a transaction branch.
+     *
+     * @param xid A global transaction identifier.
+     *
+     * @exception XAException An error has occurred.
+     */
+    void rollback(Xid xid) throws XAException;
+
+    /**
+     * Sets the current transaction timeout value for this <CODE>XAResource</CODE>
+     * instance. Once set, this timeout value is effective until
+     * <code>setTransactionTimeout</code> is invoked again with a different
+     * value. To reset the timeout value to the default value used by the resource
+     * manager, set the value to zero.
+     *
+     * If the timeout operation is performed successfully, the method returns
+     * <i>true</i>; otherwise <i>false</i>. If a resource manager does not
+     * support explicitly setting the transaction timeout value, this method
+     * returns <i>false</i>.
+     *
+     * @param seconds The transaction timeout value in seconds.
+     *
+     * @return <i>true</i> if the transaction timeout value is set successfully;
+     *       otherwise <i>false</i>.
+     *
+     * @exception XAException An error has occurred. Possible exception values
+     * are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
+     */
+    boolean setTransactionTimeout(int seconds) throws XAException;
+
+    /**
+     * Starts work on behalf of a transaction branch specified in
+     * <code>xid</code>.
+     *
+     * If TMJOIN is specified, the start applies to joining a transaction
+     * previously seen by the resource manager. If TMRESUME is specified,
+     * the start applies to resuming a suspended transaction specified in the
+     * parameter <code>xid</code>.
+     *
+     * If neither TMJOIN nor TMRESUME is specified and the transaction
+     * specified by <code>xid</code> has previously been seen by the resource
+     * manager, the resource manager throws the XAException exception with
+     * XAER_DUPID error code.
+     *
+     * @param xid A global transaction identifier to be associated
+     * with the resource.
+     *
+     * @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME.
+     *
+     * @exception XAException An error has occurred. Possible exceptions
+     * are XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE,
+     * XAER_NOTA, XAER_INVAL, or XAER_PROTO.
+     */
+    void start(Xid xid, int flags) throws XAException;
+
+    /**
+     * Ends a recovery scan.
+     */
+    public final static int TMENDRSCAN =   0x00800000;
+
+    /**
+     * Disassociates the caller and marks the transaction branch
+     * rollback-only.
+     */
+    public final static int TMFAIL =       0x20000000;
+
+    /**
+     * Caller is joining existing transaction branch.
+     */
+    public final static int TMJOIN =       0x00200000;
+
+    /**
+     * Use TMNOFLAGS to indicate no flags value is selected.
+     */
+    public final static int TMNOFLAGS =     0x00000000;
+
+    /**
+     * Caller is using one-phase optimization.
+     */
+    public final static int TMONEPHASE =   0x40000000;
+
+    /**
+     * Caller is resuming association with a suspended
+     * transaction branch.
+     */
+    public final static int TMRESUME =     0x08000000;
+
+    /**
+      * Starts a recovery scan.
+      */
+    public final static int TMSTARTRSCAN = 0x01000000;
+
+    /**
+     * Disassociates caller from a transaction branch.
+     */
+    public final static int TMSUCCESS =    0x04000000;
+
+    /**
+     * Caller is suspending (not ending) its association with
+     * a transaction branch.
+     */
+    public final static int TMSUSPEND =    0x02000000;
+
+    /**
+     * The transaction branch has been read-only and has been committed.
+     */
+    public final static int XA_RDONLY = 0x00000003;
+
+    /**
+     * The transaction work has been prepared normally.
+     */
+    public final static int XA_OK = 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.sql/share/classes/javax/transaction/xa/Xid.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.transaction.xa;
+
+/**
+ * The Xid interface is a Java mapping of the X/Open transaction identifier
+ * XID structure. This interface specifies three accessor methods to
+ * retrieve a global transaction format ID, global transaction ID,
+ * and branch qualifier. The Xid interface is used by the transaction
+ * manager and the resource managers. This interface is not visible to
+ * the application programs.
+ */
+public interface Xid {
+
+    /**
+     * Maximum number of bytes returned by getGtrid.
+     */
+    final static int MAXGTRIDSIZE = 64;
+
+    /**
+     * Maximum number of bytes returned by getBqual.
+     */
+    final static int MAXBQUALSIZE = 64;
+
+    /**
+     * Obtain the format identifier part of the XID.
+     *
+     * @return Format identifier. O means the OSI CCR format.
+     */
+    int getFormatId();
+
+    /**
+     * Obtain the global transaction identifier part of XID as an array
+     * of bytes.
+     *
+     * @return Global transaction identifier.
+     */
+    byte[] getGlobalTransactionId();
+
+    /**
+     * Obtain the transaction branch identifier part of XID as an array
+     * of bytes.
+     *
+     * @return Global transaction identifier.
+     */
+    byte[] getBranchQualifier();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.sql/share/classes/javax/transaction/xa/package.html	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+</head>
+<body bgcolor="white">
+
+Provides the API that defines the contract between the transaction 
+manager and the resource manager, which allows the transaction 
+manager to enlist and delist resource objects (supplied by the 
+resource manager driver) in JTA transactions. The driver vendor 
+for a specific resource manager provides the implementation of 
+this API.
+<p>
+@since 1.4
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.transaction/share/classes/javax/transaction/InvalidTransactionException.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ * Licensed Materials - Property of IBM
+ * RMI-IIOP v1.0
+ * Copyright IBM Corp. 1998 1999  All Rights Reserved
+ *
+ */
+
+package javax.transaction;
+
+/**
+ * This exception indicates that the request carried an invalid transaction
+ * context. For example, this exception could be raised if an error
+ * occured when trying to register a resource.
+ */
+@SuppressWarnings("serial")             // serialVersionUID intentionally omitted
+public class InvalidTransactionException extends java.rmi.RemoteException {
+
+    public InvalidTransactionException() {
+        super();
+    }
+
+    public InvalidTransactionException(String msg) {
+        super(msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.transaction/share/classes/javax/transaction/TransactionRequiredException.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ * Licensed Materials - Property of IBM
+ * RMI-IIOP v1.0
+ * Copyright IBM Corp. 1998 1999  All Rights Reserved
+ *
+ */
+
+package javax.transaction;
+
+/**
+ * This exception indicates that a request carried a null transaction context,
+ * but the target object requires an activate transaction.
+ */
+@SuppressWarnings("serial")             // serialVersionUID intentionally omitted
+public class TransactionRequiredException extends java.rmi.RemoteException {
+
+    public TransactionRequiredException() {
+        super();
+    }
+
+    public TransactionRequiredException(String msg) {
+        super(msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.transaction/share/classes/javax/transaction/TransactionRolledbackException.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ * Licensed Materials - Property of IBM
+ * RMI-IIOP v1.0
+ * Copyright IBM Corp. 1998 1999  All Rights Reserved
+ *
+ */
+
+package javax.transaction;
+
+/**
+ * This exception indicates that the transaction associated with processing
+ * of the request has been rolled back, or marked to roll back. Thus the
+ * requested operation either could not be performed or was not performed
+ * because further computation on behalf of the transaction would be
+ * fruitless
+ */
+@SuppressWarnings("serial")             // serialVersionUID intentionally omitted
+public class TransactionRolledbackException extends java.rmi.RemoteException {
+
+    public TransactionRolledbackException() {
+        super();
+    }
+
+    public TransactionRolledbackException(String msg) {
+        super(msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.transaction/share/classes/javax/transaction/package.html	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+</head>
+<body bgcolor="white">
+
+Contains three exceptions thrown by the ORB machinery during unmarshalling.
+<p>
+@since 1.3
+</body>
+</html>
--- a/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AliasFileParser.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AliasFileParser.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
  */
 public class AliasFileParser {
     private static final String ALIAS = "alias";
-    private static final boolean DEBUG = false;
+    // 8028357 removed old, inefficient debug logging
 
     // other variables
     private URL inputfile;
@@ -64,21 +64,12 @@
         }
     }
 
-    private void logln(String s) {
-        if (DEBUG) {
-            System.err.println(s);
-        }
-    }
-
     /**
      * method to get the next token as a Token type
      */
     private void nextToken() throws IOException {
         st.nextToken();
         currentToken = new Token(st.ttype, st.sval);
-
-        logln("Read token: type = " + currentToken.ttype
-              + " string = " + currentToken.sval);
     }
 
     /**
@@ -90,8 +81,6 @@
 
         if ((currentToken.ttype == ttype)
                 && (currentToken.sval.compareTo(token) == 0)) {
-            logln("matched type: " + ttype + " and token = "
-                  + currentToken.sval);
             nextToken();
         } else {
             throw new SyntaxException(st.lineno());
@@ -105,7 +94,6 @@
      */
     private void match(int ttype) throws IOException, SyntaxException {
         if (currentToken.ttype == ttype) {
-            logln("matched type: " + ttype + ", token = " + currentToken.sval);
             nextToken();
         } else {
             throw new SyntaxException(st.lineno());
@@ -157,8 +145,6 @@
             } while ((currentToken.ttype != StreamTokenizer.TT_EOF)
                      && (currentToken.sval.compareTo(ALIAS) != 0));
 
-            logln("adding map entry for " + name + " values = " + aliases);
-
             map.put(name, aliases);
         }
     }
--- a/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/CountedTimerTaskUtils.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/CountedTimerTaskUtils.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
  */
 public class CountedTimerTaskUtils {
 
-    private static final boolean DEBUG = false;
+    // 8028357 removed old, inefficient debug logging
 
     /**
      * Reschedule a CountedTimeTask at a different interval. Probably not
@@ -58,14 +58,6 @@
         long lastRun = oldTask.scheduledExecutionTime();
         long expired = now - lastRun;
 
-        if (DEBUG) {
-            System.err.println("computing timer delay: "
-                               + " oldInterval = " + oldInterval
-                               + " newInterval = " + newInterval
-                               + " samples = " + oldTask.executionCount()
-                               + " expired = " + expired);
-        }
-
         /*
          * check if original task ever ran - if not, then lastRun is
          * undefined and we simply set the delay to 0.
@@ -76,12 +68,6 @@
             delay = remainder >= 0 ? remainder : 0;
         }
 
-        if (DEBUG) {
-            System.err.println("rescheduling sampler task: interval = "
-                               + newInterval
-                               + " delay = " + delay);
-        }
-
         timer.schedule(newTask, delay, newInterval);
     }
 }
--- a/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java	Sat Jan 10 12:38:18 2015 -0800
@@ -44,7 +44,8 @@
  */
 public class PerfDataBuffer extends PerfDataBufferImpl {
 
-    private static final boolean DEBUG = false;
+    // 8028357 removed old, inefficient debug logging
+
     private static final int syncWaitMs =
             Integer.getInteger("sun.jvmstat.perdata.syncWaitMs", 5000);
     private static final ArrayList<Monitor> EMPTY_LIST = new ArrayList<Monitor>(0);
@@ -268,18 +269,13 @@
          * loop waiting for the ticks counter to be non zero. This is
          * an indication that the jvm is initialized.
          */
-        log("synchWithTarget: " + lvmid + " ");
         while (ticks.longValue() == 0) {
-            log(".");
-
             try { Thread.sleep(20); } catch (InterruptedException e) { }
 
             if (System.currentTimeMillis() > timeLimit) {
-                lognl("failed: " + lvmid);
                 throw new MonitorException("Could Not Synchronize with target");
             }
         }
-        lognl("success: " + lvmid);
     }
 
     /**
@@ -291,24 +287,18 @@
                       throws MonitorException {
         Monitor monitor = null;
 
-        log("polling for: " + lvmid + "," + name + " ");
-
         pollForEntry = nextEntry;
         while ((monitor = map.get(name)) == null) {
-            log(".");
 
             try { Thread.sleep(20); } catch (InterruptedException e) { }
 
             long t = System.currentTimeMillis();
             if ((t > timeLimit) || (overflow.intValue() > 0)) {
-                lognl("failed: " + lvmid + "," + name);
-                dumpAll(map, lvmid);
                 throw new MonitorException("Could not find expected counter");
             }
 
             getNewMonitors(map);
         }
-        lognl("success: " + lvmid + "," + name);
         return monitor;
     }
 
@@ -481,8 +471,6 @@
 
         // check for the end of the buffer
         if (nextEntry == buffer.limit()) {
-            lognl("getNextMonitorEntry():"
-                  + " nextEntry == buffer.limit(): returning");
             return null;
         }
 
@@ -614,37 +602,4 @@
         nextEntry = entryStart + entryLength;
         return monitor;
     }
-
-    /**
-     * Method to dump debugging information
-     */
-    private void dumpAll(Map<String, Monitor> map, int lvmid) {
-        if (DEBUG) {
-            Set<String> keys = map.keySet();
-
-            System.err.println("Dump for " + lvmid);
-            int j = 0;
-            for (Iterator<String> i = keys.iterator(); i.hasNext(); j++) {
-                Monitor monitor = map.get(i.next());
-                System.err.println(j + "\t" + monitor.getName()
-                                   + "=" + monitor.getValue());
-            }
-            System.err.println("nextEntry = " + nextEntry
-                               + " pollForEntry = " + pollForEntry);
-            System.err.println("Buffer info:");
-            System.err.println("buffer = " + buffer);
-        }
-    }
-
-    private void lognl(String s) {
-        if (DEBUG) {
-            System.err.println(s);
-        }
-    }
-
-    private void log(String s) {
-        if (DEBUG) {
-            System.err.print(s);
-        }
-    }
 }
--- a/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java	Sat Jan 10 12:38:18 2015 -0800
@@ -62,7 +62,8 @@
  */
 public class PerfDataBuffer extends PerfDataBufferImpl {
 
-    private static final boolean DEBUG = false;
+    // 8028357 removed old, inefficient debug logging
+
     private static final int syncWaitMs =
             Integer.getInteger("sun.jvmstat.perdata.syncWaitMs", 5000);
     private static final ArrayList<Monitor> EMPTY_LIST = new ArrayList<>(0);
@@ -264,20 +265,15 @@
         long timeLimit = System.currentTimeMillis() + syncWaitMs;
 
         // loop waiting for the accessible indicater to be non-zero
-        log("synchWithTarget: " + lvmid + " ");
         while (!prologue.isAccessible()) {
 
-            log(".");
-
             // give the target jvm a chance to complete initializatoin
             try { Thread.sleep(20); } catch (InterruptedException e) { }
 
             if (System.currentTimeMillis() > timeLimit) {
-                logln("failed: " + lvmid);
                 throw new MonitorException("Could not synchronize with target");
             }
         }
-        logln("success: " + lvmid);
     }
 
     /**
@@ -306,8 +302,6 @@
 
         // check for end of the buffer
         if (nextEntry == buffer.limit()) {
-            logln("getNextMonitorEntry():"
-                  + " nextEntry == buffer.limit(): returning");
             return null;
         }
 
@@ -346,9 +340,6 @@
         byte varByte = buffer.get();
         int dataOffset = buffer.getInt();
 
-        dump_entry_fixed(entryStart, nameOffset, vectorLength, typeCodeByte,
-                         flags, unitsByte, varByte, dataOffset);
-
         // convert common attributes to their object types
         Units units = Units.toUnits(unitsByte);
         Variability variability = Variability.toVariability(varByte);
@@ -439,8 +430,6 @@
         // set the position to the start of the data item
         buffer.position(entryStart + dataOffset);
 
-        dump_entry_variable(name, buffer, dataSize);
-
         if (vectorLength == 0) {
             // create a scalar Monitor object
             if (typeCode == TypeCode.LONG) {
@@ -514,103 +503,4 @@
         nextEntry = entryStart + entryLength;
         return monitor;
     }
-
-    /**
-     * Method to dump debugging information
-     */
-    private void dumpAll(Map<String, Monitor> map, int lvmid) {
-        if (DEBUG) {
-            Set<String> keys = map.keySet();
-
-            System.err.println("Dump for " + lvmid);
-            int j = 0;
-            for (Iterator<String> i = keys.iterator(); i.hasNext(); j++) {
-                Monitor monitor = map.get(i.next());
-                System.err.println(j + "\t" + monitor.getName()
-                                   + "=" + monitor.getValue());
-            }
-            System.err.println("nextEntry = " + nextEntry);
-            System.err.println("Buffer info:");
-            System.err.println("buffer = " + buffer);
-        }
-    }
-
-    /**
-     * Method to dump the fixed portion of an entry.
-     */
-    private void dump_entry_fixed(int entry_start, int nameOffset,
-                                  int vectorLength, byte typeCodeByte,
-                                  byte flags, byte unitsByte, byte varByte,
-                                  int dataOffset) {
-        if (DEBUG) {
-            System.err.println("Entry at offset: 0x"
-                               + Integer.toHexString(entry_start));
-            System.err.println("\tname_offset = 0x"
-                               + Integer.toHexString(nameOffset));
-            System.err.println("\tvector_length = 0x"
-                               + Integer.toHexString(vectorLength));
-            System.err.println("\tdata_type = 0x"
-                               + Integer.toHexString(typeCodeByte));
-            System.err.println("\tflags = 0x"
-                               + Integer.toHexString(flags));
-            System.err.println("\tdata_units = 0x"
-                               + Integer.toHexString(unitsByte));
-            System.err.println("\tdata_variability = 0x"
-                               + Integer.toHexString(varByte));
-            System.err.println("\tdata_offset = 0x"
-                               + Integer.toHexString(dataOffset));
-        }
-    }
-
-    private void dump_entry_variable(String name, ByteBuffer bb, int size) {
-        if (DEBUG) {
-            char[] toHex = new char[] { '0', '1', '2', '3',
-                                        '4', '5', '6', '7',
-                                        '8', '9', 'a', 'b',
-                                        'c', 'd', 'e', 'f' };
-
-            ByteBuffer data = bb.slice();
-            data.limit(size);
-
-            System.err.println("\tname = " + name);
-            System.err.println("\tdata = ");
-
-            int count=0;
-            while (data.hasRemaining()) {
-                byte b = data.get();
-                byte high = (byte)((b >> 8) & 0x0f);
-                byte low = (byte)(b & 0x0f);
-
-                if (count % 16 == 0) {
-                    System.err.print("\t\t" + Integer.toHexString(count / 16)
-                                     + ": ");
-                }
-
-                System.err.print(String.valueOf(toHex[high])
-                                 + String.valueOf(toHex[low]));
-
-                count++;
-                if (count % 16 == 0) {
-                    System.err.println();
-                } else {
-                    System.err.print(" ");
-                }
-            }
-            if (count % 16 != 0) {
-                System.err.println();
-            }
-        }
-    }
-
-    private void logln(String s) {
-        if (DEBUG) {
-            System.err.println(s);
-        }
-    }
-
-    private void log(String s) {
-        if (DEBUG) {
-            System.err.print(s);
-        }
-    }
 }
--- a/test/ProblemList.txt	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/ProblemList.txt	Sat Jan 10 12:38:18 2015 -0800
@@ -120,6 +120,10 @@
 
 # jdk_lang
 
+# 8029891
+java/lang/ClassLoader/deadlock/GetResource.java                 generic-all
+
+
 ############################################################################
 
 # jdk_instrument
@@ -261,7 +265,7 @@
 
 # Tests take too long, on sparcs see 7143279
 # also see 8059906
-tools/pack200/CommandLineTests.java
+tools/pack200/CommandLineTests.java                             generic-all
 tools/pack200/Pack200Test.java                                  solaris-all,macosx-all
 
 # 8007410
--- a/test/com/sun/corba/5036554/TestCorbaBug.sh	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/com/sun/corba/5036554/TestCorbaBug.sh	Sat Jan 10 12:38:18 2015 -0800
@@ -75,13 +75,13 @@
 mkdir bug
 
 cp ${TESTSRC}${FS}bug.idl .
-${TESTJAVA}${FS}bin${FS}idlj bug.idl
+${COMPILEJAVA}${FS}bin${FS}idlj bug.idl
 
 cp ${TESTSRC}${FS}JavaBug.java bug
 
 chmod -fR 777 bug
 
-${TESTJAVA}${FS}bin${FS}javac -d . bug${FS}*.java
+${COMPILEJAVA}${FS}bin${FS}javac -d . bug${FS}*.java
 
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . bug/JavaBug > test.out 2>&1 
 
--- a/test/com/sun/corba/cachedSocket/7056731.sh	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/com/sun/corba/cachedSocket/7056731.sh	Sat Jan 10 12:38:18 2015 -0800
@@ -55,8 +55,8 @@
 cp -r ${TESTSRC}${FS}*.java  ${TESTSRC}${FS}Hello.idl .
 echo "Testing...please wait"
 
-${TESTJAVA}${FS}bin${FS}idlj -fall Hello.idl
-${TESTJAVA}${FS}bin${FS}javac *.java HelloApp/*.java
+${COMPILEJAVA}${FS}bin${FS}idlj -fall Hello.idl
+${COMPILEJAVA}${FS}bin${FS}javac *.java HelloApp/*.java
 
 echo "starting orbd"
 ${TESTJAVA}${FS}bin${FS}orbd -ORBInitialPort $PORT -ORBInitialHost localhost &
--- a/test/com/sun/crypto/provider/Cipher/DES/TestUtility.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/com/sun/crypto/provider/Cipher/DES/TestUtility.java	Sat Jan 10 12:38:18 2015 -0800
@@ -27,39 +27,52 @@
 
 public class TestUtility {
 
-    private static final String digits = "0123456789abcdef";
+    private static final String DIGITS = "0123456789abcdef";
 
-    public TestUtility() {
+    private TestUtility() {
 
     }
 
     public static String hexDump(byte[] bytes) {
 
-        StringBuffer buf = new StringBuffer (bytes.length * 2);
-        int  i;
+        StringBuilder buf = new StringBuilder(bytes.length * 2);
+        int i;
 
-        buf.append ("    ");                    // four spaces
+        buf.append("    "); // four spaces
         for (i = 0; i < bytes.length; i++) {
-            buf.append (digits.charAt ((bytes[i] >> 4) & 0x0f));
-            buf.append (digits.charAt (bytes[i] & 0x0f));
-            if (((i + 1) % 32) == 0) {
-                if ((i +  1) != bytes.length)
-                    buf.append ("\n    ");      // line after four words
-            } else if (((i + 1) % 4) == 0)
-                buf.append (' ');               // space between words
+            buf.append(DIGITS.charAt(bytes[i] >> 4 & 0x0f));
+            buf.append(DIGITS.charAt(bytes[i] & 0x0f));
+            if ((i + 1) % 32 == 0) {
+                if (i + 1 != bytes.length) {
+                    buf.append("\n    "); // line after four words
+                }
+            } else if ((i + 1) % 4 == 0) {
+                buf.append(' '); // space between words
+            }
         }
-        return buf.toString ();
+        return buf.toString();
     }
 
+    public static String hexDump(byte[] bytes, int index) {
+        StringBuilder buf = new StringBuilder(bytes.length * 2);
+        int i;
+
+        buf.append("    "); // four spaces
+        buf.append(DIGITS.charAt(bytes[index] >> 4 & 0x0f));
+        buf.append(DIGITS.charAt(bytes[index] & 0x0f));
+        return buf.toString();
+    }
 
     public static boolean equalsBlock(byte[] b1, byte[] b2) {
 
-        if (b1.length != b2.length)
+        if (b1.length != b2.length) {
             return false;
+        }
 
-        for (int i=0; i<b1.length; i++) {
-            if (b1[i] != b2[i])
+        for (int i = 0; i < b1.length; i++) {
+            if (b1[i] != b2[i]) {
                 return false;
+            }
         }
 
         return true;
@@ -67,9 +80,10 @@
 
     public static boolean equalsBlock(byte[] b1, byte[] b2, int len) {
 
-        for (int i=0; i<len; i++) {
-            if (b1[i] != b2[i])
+        for (int i = 0; i < len; i++) {
+            if (b1[i] != b2[i]) {
                 return false;
+            }
         }
 
         return true;
--- a/test/java/io/etc/FailingFlushAndClose.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/io/etc/FailingFlushAndClose.java	Sat Jan 10 12:38:18 2015 -0800
@@ -25,7 +25,7 @@
 
 /**
  * @test
- * @bug 7015589
+ * @bug 7015589 8054565
  * @summary Test that buffering streams are considered closed even when the
  *    close or flush from the underlying stream fails.
  */
@@ -165,7 +165,7 @@
         }
     }
 
-    static void testFailingClose(InputStream in) throws IOException {
+    static InputStream testFailingClose(InputStream in) throws IOException {
         System.out.println(in.getClass());
         in.read(new byte[100]);
         try {
@@ -176,9 +176,10 @@
             in.read(new byte[100]);
             fail("read did not fail");
         } catch (IOException expected) { }
+        return in;
     }
 
-    static void testFailingClose(OutputStream out) throws IOException {
+    static OutputStream testFailingClose(OutputStream out) throws IOException {
         System.out.println(out.getClass());
         out.write(1);
         try {
@@ -190,9 +191,10 @@
             if (!(out instanceof BufferedOutputStream))
                 fail("write did not fail");
         } catch (IOException expected) { }
+        return out;
     }
 
-    static void testFailingFlush(OutputStream out) throws IOException {
+    static OutputStream testFailingFlush(OutputStream out) throws IOException {
         System.out.println(out.getClass());
         out.write(1);
         try {
@@ -206,9 +208,27 @@
                 fail("close did not fail");
             } catch (IOException expected) { }
         }
+        return out;
     }
 
-    static void testFailingClose(Reader r) throws IOException {
+    static void closeAgain(InputStream in) throws IOException {
+        // assert the given stream should already be closed.
+        try {
+            in.close();
+        } catch (IOException expected) {
+            fail("unexpected IOException from subsequent close");
+        }
+    }
+    static void closeAgain(OutputStream out) throws IOException {
+        // assert the given stream should already be closed.
+        try {
+            out.close();
+        } catch (IOException expected) {
+            fail("unexpected IOException from subsequent close");
+        }
+    }
+
+    static Reader testFailingClose(Reader r) throws IOException {
         System.out.println(r.getClass());
         r.read(new char[100]);
         try {
@@ -219,9 +239,10 @@
             r.read(new char[100]);
             fail("read did not fail");
         } catch (IOException expected) { }
+        return r;
     }
 
-    static void testFailingClose(Writer w) throws IOException {
+    static Writer testFailingClose(Writer w) throws IOException {
         System.out.println(w.getClass());
         w.write("message");
         try {
@@ -232,9 +253,10 @@
             w.write("another message");
             fail("write did not fail");
         } catch (IOException expected) { }
+        return w;
     }
 
-    static void testFailingFlush(Writer w) throws IOException {
+    static Writer testFailingFlush(Writer w) throws IOException {
         System.out.println(w.getClass());
         w.write("message");
         try {
@@ -249,18 +271,38 @@
                 fail("close did not fail");
             } catch (IOException expected) { }
         }
+        return w;
+    }
+
+    static Reader closeAgain(Reader r) throws IOException {
+        // assert the given stream should already be closed.
+        try {
+            r.close();
+        } catch (IOException expected) {
+            fail("unexpected IOException from subsequent close");
+        }
+        return r;
+    }
+    static Writer closeAgain(Writer w) throws IOException {
+        // assert the given stream should already be closed.
+        try {
+            w.close();
+        } catch (IOException expected) {
+            fail("unexpected IOException from subsequent close");
+        }
+        return w;
     }
 
     public static void main(String[] args) throws IOException {
 
-        testFailingClose(new BufferedInputStream(new FailingCloseInputStream()));
-        testFailingClose(new BufferedOutputStream(new FailingCloseOutputStream()));
+        closeAgain(testFailingClose(new BufferedInputStream(new FailingCloseInputStream())));
+        closeAgain(testFailingClose(new BufferedOutputStream(new FailingCloseOutputStream())));
 
-        testFailingClose(new BufferedReader(new FailingCloseReader()));
-        testFailingClose(new BufferedWriter(new FailingCloseWriter()));
+        closeAgain(testFailingClose(new BufferedReader(new FailingCloseReader())));
+        closeAgain(testFailingClose(new BufferedWriter(new FailingCloseWriter())));
 
-        testFailingFlush(new BufferedOutputStream(new FailingFlushOutputStream()));
-        testFailingFlush(new BufferedWriter(new FailingFlushWriter()));
+        closeAgain(testFailingFlush(new BufferedOutputStream(new FailingFlushOutputStream())));
+        closeAgain(testFailingFlush(new BufferedWriter(new FailingFlushWriter())));
 
         if (failed > 0)
             throw new RuntimeException(failed + " test(s) failed - see log for details");
--- a/test/java/nio/channels/FileChannel/TransferToChannel.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/nio/channels/FileChannel/TransferToChannel.java	Sat Jan 10 12:38:18 2015 -0800
@@ -25,7 +25,7 @@
  * @bug 4652496
  * @summary Test transferTo with different target channels
  * @run main TransferToChannel
- * @run main/othervm -Djdk.net.enableFastFileTransfer TransferToChannel
+ * @run main/othervm -Djdk.nio.enableFastFileTransfer TransferToChannel
  */
 
 import java.nio.channels.FileChannel;
--- a/test/java/rmi/activation/Activatable/checkActivateRef/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/checkActivateRef/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -4,8 +4,8 @@
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
+  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 
-  // test needs to communicate with the activation system
-  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
   permission java.lang.RuntimePermission "getClassLoader";
 };
--- a/test/java/rmi/activation/Activatable/checkAnnotations/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/checkAnnotations/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,10 +1,9 @@
 /*
- * security policy used by activation groups.
+ * security policy used by activation groups
  */
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // test needs to communicate with the activation system
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/checkRegisterInLog/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/checkRegisterInLog/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -4,10 +4,6 @@
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // allow remote objects to be exported on arbitrary ports.
-  permission java.net.SocketPermission "*:1024-", "connect,accept";
-
-  // allow exporting object with non-public remote interface
-  permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/createPrivateActivable/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/createPrivateActivable/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,13 +1,9 @@
 /*
- * security policy used activation groups
+ * security policy used by activation groups
  */
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // test needs to communicate with the activation system
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-
-  // allow exporting object with non-public remote interface
-  permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/downloadParameterClass/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/downloadParameterClass/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,14 +1,15 @@
 /*
- * security policy used exec'ed activation groups
+ * security policy used by activation groups
  */
 
 grant {
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
+  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
+
   // need to load custom security manager and activation group from a new codebase
   permission java.io.FilePermission ".${/}codebase1", "read,write,delete";
   permission java.io.FilePermission ".${/}codebase1${/}-", "read,write";
   permission java.io.FilePermission ".${/}codebase2", "read,write,delete";
   permission java.io.FilePermission ".${/}codebase2${/}-", "read,write,delete";
-
-  // allow remote objects to be exported on arbitrary ports.
-  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
 };
--- a/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,12 +1,13 @@
 /*
- * security policy used activation groups
+ * security policy used by activation groups
  */
 
 grant {
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
+  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
+
   // Needed because of bug#: 4182104
   permission java.lang.RuntimePermission "modifyThreadGroup";
   permission java.lang.RuntimePermission "modifyThread";
-
-  // allow remote objects to be exported on arbitrary ports.
-  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
 };
--- a/test/java/rmi/activation/Activatable/extLoadedImpl/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/extLoadedImpl/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,8 +1,9 @@
 /*
- * security policy used exec'ed activation groups
+ * security policy used by activation groups
  */
 
 grant {
-  // allow remote objects to be exported on arbitrary ports.
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/forceLogSnapshot/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/forceLogSnapshot/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -3,9 +3,7 @@
  */
 
 grant {
-  // allow remote objects to be exported on arbitrary ports.
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-
-  // allow exporting object with non-public remote interface
-  permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/inactiveGroup/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/inactiveGroup/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -4,10 +4,6 @@
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // allow remote objects to be exported on arbitrary ports.
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-
-  // allow exporting object with non-public remote interface
-  permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/nestedActivate/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/nestedActivate/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,13 +1,9 @@
 /*
- * security policy used by test activation groups
+ * security policy used by activation groups
  */
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // allow remote objects to be exported on arbitrary ports.
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-
-  // allow exporting of non-public remote interface
-  permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/nonExistentActivatable/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/nonExistentActivatable/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -4,7 +4,6 @@
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // allow remote objects to be exported on arbitrary ports.
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/restartCrashedService/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/restartCrashedService/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,8 +1,9 @@
 /*
- * security policy used by test activation groups
+ * security policy used by activation groups
  */
 
 grant {
-  // test needs to communicate with the activation system
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/restartLatecomer/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/restartLatecomer/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -3,6 +3,7 @@
  */
 
 grant {
-  // allow remote objects to be exported on arbitrary ports.
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/restartService/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/restartService/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -3,6 +3,7 @@
  */
 
 grant {
-  // allow remote objects to be exported on arbitrary ports.
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/shutdownGracefully/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/shutdownGracefully/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,10 +1,9 @@
 /*
- * security policy used activation groups
+ * security policy used by activation groups
  */
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // test needs to communicate with the activation system
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/Activatable/unregisterInactive/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/Activatable/unregisterInactive/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -4,7 +4,6 @@
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // allow remote objects to be exported on arbitrary ports.
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/ActivateFailedException/activateFails/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/ActivateFailedException/activateFails/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,8 +1,9 @@
 /*
- * security policy used activation groups
+ * security policy used by activation groups
  */
 
 grant {
-  // test needs to communicate with the activation system
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,10 +1,11 @@
 /*
- * security policy used by downloaded activation group
+ * security policy used by activation groups
  */
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
+  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 
   permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
-  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
 };
--- a/test/java/rmi/activation/ActivationSystem/modifyDescriptor/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/ActivationSystem/modifyDescriptor/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -4,10 +4,6 @@
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // accomodate property used by this test.
-  permission java.util.PropertyPermission "test.message", "read";
-
-  // test needs to communicate with the activation system
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,13 +1,11 @@
 /*
- * security policy used by activation groups.
+ * security policy used by activation groups
  */
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
+  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 
-  // give the group permission to create a class that the main test process can not create
   permission java.lang.RuntimePermission "accessClassInPackage.sun.security.provider";
-
-  // test needs to communicate with the activation system
-  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
 };
--- a/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -4,8 +4,6 @@
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // test needs to communicate with the activation system
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-  permission java.util.PropertyPermission "unregisterGroup.port", "read";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/activation/CommandEnvironment/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/activation/CommandEnvironment/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,8 +1,9 @@
 /*
- * security policy used by activation groups.
+ * security policy used by activation groups
  */
 
 grant {
-  // test needs to communicate with the activation system
+  permission java.io.FilePermission "..${/}..${/}test.props", "read";
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/group.security.policy	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/group.security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -1,11 +1,9 @@
 /*
- * security policy used by the rmid process exec'ed by a running
- * instance of the test.
+ * security policy used by activation groups
  */
 
 grant {
   permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
-  // test needs to communicate with the activation system
   permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+  permission java.util.PropertyPermission "test.*", "read";
 };
--- a/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
  * The RemoteServer.setLog method requires
  * java.util.log.LoggingPermission("control").
  * @author Ann Wollrath
- * @run main/othervm/policy=java.policy SetLogPermission
+ * @run main/othervm/policy=security.policy SetLogPermission
  */
 
 import java.rmi.server.RemoteServer;
--- a/test/java/rmi/server/RemoteServer/setLogPermission/java.policy	Thu Jan 08 10:44:54 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-grant {
-    permission java.util.logging.LoggingPermission "control";
-};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/rmi/server/RemoteServer/setLogPermission/security.policy	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,3 @@
+grant {
+    permission java.util.logging.LoggingPermission "control";
+};
--- a/test/java/rmi/testlibrary/ActivationLibrary.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/testlibrary/ActivationLibrary.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,20 +40,6 @@
  * objects.
  */
 public class ActivationLibrary {
-    /** time safeDestroy should wait before failing on shutdown rmid */
-    private static final int SAFE_WAIT_TIME;
-    static {
-        int slopFactor = 1;
-        try {
-            slopFactor = Integer.valueOf(
-                TestLibrary.getExtraProperty("jcov.sleep.multiplier","1"));
-        } catch (NumberFormatException ignore) {}
-        SAFE_WAIT_TIME = 60000 * slopFactor;
-    }
-
-    private static final String SYSTEM_NAME =
-        ActivationSystem.class.getName();
-
     private static void mesg(Object mesg) {
         System.err.println("ACTIVATION_LIBRARY: " + mesg.toString());
     }
@@ -63,20 +49,19 @@
      */
     public static void deactivate(Remote remote,
                                   ActivationID id) {
-        // We do as much as 50 deactivation trials, each separated by
-        // at least 100 milliseconds sleep time (max sleep time of 5 secs).
-        final long deactivateSleepTime = 100;
-        long stopTime = System.currentTimeMillis() + deactivateSleepTime * 50;
-        while (System.currentTimeMillis() < stopTime) {
+        final long POLLTIME_MS = 100L;
+        final long DEACTIVATE_TIME_MS = 30_000L;
+
+        long startTime = System.currentTimeMillis();
+        long deadline = TestLibrary.computeDeadline(startTime, DEACTIVATE_TIME_MS);
+
+        while (System.currentTimeMillis() < deadline) {
             try {
                 if (Activatable.inactive(id) == true) {
                     mesg("inactive successful");
                     return;
                 } else {
-                    mesg("inactive trial failed. Sleeping " +
-                         deactivateSleepTime +
-                         " milliseconds before next trial");
-                    Thread.sleep(deactivateSleepTime);
+                    Thread.sleep(POLLTIME_MS);
                 }
             } catch (InterruptedException e) {
                 Thread.currentThread().interrupt();
@@ -95,7 +80,8 @@
             }
         }
 
-        mesg("unable to inactivate after several attempts");
+        mesg("unable to inactivate after " +
+            (System.currentTimeMillis() - startTime) + "ms.");
         mesg("unexporting object forcibly instead");
 
         try {
--- a/test/java/rmi/testlibrary/JavaVM.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/testlibrary/JavaVM.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -194,7 +194,7 @@
             throws InterruptedException, TimeoutException {
         if (vm == null)
             throw new IllegalStateException("can't wait for JavaVM that isn't running");
-        long deadline = computeDeadline(System.currentTimeMillis(), timeout);
+        long deadline = TestLibrary.computeDeadline(System.currentTimeMillis(), timeout);
 
         while (true) {
             try {
@@ -218,21 +218,4 @@
         start();
         return waitFor();
     }
-
-    /**
-     * Computes a deadline from a timestamp and a timeout value.
-     * Maximum timeout (before multipliers are applied) is one hour.
-     */
-    public static long computeDeadline(long timestamp, long timeout) {
-        final long MAX_TIMEOUT_MS = 3_600_000L;
-
-        if (timeout < 0L || timeout > MAX_TIMEOUT_MS) {
-            throw new IllegalArgumentException("timeout " + timeout + "ms out of range");
-        }
-
-        // TODO apply test.timeout.factor (and possibly jcov.sleep.multiplier)
-        // here instead of upstream
-
-        return timestamp + timeout;
-    }
 }
--- a/test/java/rmi/testlibrary/RMID.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/testlibrary/RMID.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -249,15 +249,15 @@
         mesg("Starting rmid on port " + port + ".");
         super.start();
 
-        int slopFactor = 1;
-        try {
-            slopFactor = Integer.valueOf(
-                TestLibrary.getExtraProperty("jcov.sleep.multiplier","1"));
-        } catch (NumberFormatException ignore) {}
-        waitTime = waitTime * slopFactor;
+        // int slopFactor = 1;
+        // try {
+        //     slopFactor = Integer.valueOf(
+        //         TestLibrary.getExtraProperty("jcov.sleep.multiplier","1"));
+        // } catch (NumberFormatException ignore) {}
+        // waitTime = waitTime * slopFactor;
 
         long startTime = System.currentTimeMillis();
-        long deadline = computeDeadline(startTime, waitTime);
+        long deadline = TestLibrary.computeDeadline(startTime, waitTime);
 
         while (true) {
             try {
--- a/test/java/rmi/testlibrary/TestLibrary.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/rmi/testlibrary/TestLibrary.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -135,7 +135,8 @@
      */
 
     public static boolean checkIfRegistryRunning(int port, int msTimeout) {
-        long stopTime = System.currentTimeMillis() + msTimeout;
+        final long POLLTIME_MS = 100L;
+        long stopTime = computeDeadline(System.currentTimeMillis(), msTimeout);
         do {
             try {
                 Registry r = LocateRegistry.getRegistry(port);
@@ -145,12 +146,12 @@
             } catch (RemoteException e) {
                 // problem - not ready ? Try again
                 try {
-                    Thread.sleep(500);
+                    Thread.sleep(POLLTIME_MS);
                 } catch (InterruptedException ie) {
                     // not expected
                 }
             }
-        } while (stopTime > System.currentTimeMillis());
+        } while (System.currentTimeMillis() < stopTime);
         return false;
     }
 
@@ -169,6 +170,31 @@
         }
     }
 
+    public static double getTimeoutFactor() {
+        String prop = getProperty("test.timeout.factor", "1.0");
+        double timeoutFactor = 1.0;
+
+        try {
+            timeoutFactor = Double.parseDouble(prop);
+        } catch (NumberFormatException ignore) { }
+
+        return timeoutFactor;
+    }
+
+    /**
+     * Computes a deadline from a timestamp and a timeout value.
+     * Maximum timeout (before multipliers are applied) is one hour.
+     */
+    public static long computeDeadline(long timestamp, long timeout) {
+        final long MAX_TIMEOUT_MS = 3_600_000L;
+
+        if (timeout < 0L || timeout > MAX_TIMEOUT_MS) {
+            throw new IllegalArgumentException("timeout " + timeout + "ms out of range");
+        }
+
+        return timestamp + (long)(timeout * getTimeoutFactor());
+    }
+
     /**
      * Property mutators
      */
--- a/test/java/util/Formatter/Basic-X.java.template	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/util/Formatter/Basic-X.java.template	Sat Jan 10 12:38:18 2015 -0800
@@ -1154,6 +1154,10 @@
         test("%.5f", "0.99960", val);
         test("%.6f", "0.999600", val);
 
+        val = new BigDecimal(BigInteger.ZERO, 6);
+        test("%.4f", "0.0000", val);
+        val = new BigDecimal(BigInteger.ZERO, -6);
+        test("%.4f", "0.0000", val);
 #end[BigDecimal]
 
 #if[float]
--- a/test/java/util/Formatter/Basic.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/util/Formatter/Basic.java	Sat Jan 10 12:38:18 2015 -0800
@@ -26,6 +26,7 @@
  * @bug 4906370 4962433 4973103 4989961 5005818 5031150 4970931 4989491 5002937
  *      5005104 5007745 5061412 5055180 5066788 5088703 6317248 6318369 6320122
  *      6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 6476168
+ *      8059175
  *
  * @run shell/timeout=240 Basic.sh
  */
--- a/test/java/util/Formatter/BasicBigDecimal.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/java/util/Formatter/BasicBigDecimal.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1154,6 +1154,11 @@
         test("%.5f", "0.99960", val);
         test("%.6f", "0.999600", val);
 
+        val = new BigDecimal(BigInteger.ZERO, 6);
+        test("%.4f", "0.0000", val);
+
+        val = new BigDecimal(BigInteger.ZERO, -6);
+        test("%.4f", "0.0000", val);
 
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/crypto/KeyGenerator/TestKGParity.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.PrintStream;
+import java.lang.String;
+import java.lang.System;
+import java.security.Provider;
+import java.security.SecureRandom;
+import java.security.Security;
+import javax.crypto.KeyGenerator;
+import static java.lang.System.out;
+
+/*
+ * @test
+ * @bug 8048607
+ * @compile ../../../com/sun/crypto/provider/Cipher/DES/TestUtility.java
+ * @summary Test key generation of DES and DESEDE
+ */
+public class TestKGParity {
+
+    private static final String[] ALGORITHM_ARR = {
+        "deS", "DesEDE"
+    };
+
+    public static void main(String argv[]) throws Exception {
+
+        TestKGParity test = new TestKGParity();
+        test.run();
+    }
+
+    private void run() throws Exception {
+        Provider[] providers = Security.getProviders();
+        for (Provider p : providers) {
+            String prvName = p.getName();
+            if (prvName.startsWith("SunJCE")
+                    || prvName.startsWith("SunPKCS11-")) {
+                for (String algorithm : ALGORITHM_ARR) {
+                    if (!runTest(p, algorithm)) {
+                        throw new RuntimeException(
+                                "Test failed with provider/algorithm:"
+                                        + p.getName() + "/" + algorithm);
+                    } else {
+                        out.println("Test passed with provider/algorithm:"
+                                + p.getName() + "/" + algorithm);
+                    }
+                }
+            }
+        }
+    }
+
+    public boolean runTest(Provider p, String algo) throws Exception {
+        byte[] keyValue = null;
+        try {
+            // Initialization
+            SecureRandom sRdm = new SecureRandom();
+            KeyGenerator kg = KeyGenerator.getInstance(algo, p);
+            kg.init(sRdm);
+
+            // Generate a SecretKey and retrieve its value
+            keyValue = kg.generateKey().getEncoded();
+
+            // Verify its parity in the unit of byte
+            for (int i = 0; i < keyValue.length; i++) {
+                if (!checkParity(keyValue[i])) {
+                    out.println("Testing: "
+                        + p.getName()
+                        + "/"
+                        + algo
+                        + " failed when verify its parity in the unit of byte:"
+                        + TestUtility.hexDump(keyValue, i));
+                    return false;
+                }
+            }
+            return true;
+        } catch (Exception ex) {
+            out.println("Testing: " + p.getName() + "/" + algo
+                    + " failed with unexpected exception");
+            ex.printStackTrace();
+            throw ex;
+        }
+    }
+
+    private boolean checkParity(byte keyByte) {
+        boolean even = false;
+        byte[] PARITY_BIT_MASK = {
+                (byte) 0x40, (byte) 0x20, (byte) 0x10, (byte) 0x08,
+                (byte) 0x04, (byte) 0x02, (byte) 0x01
+        };
+
+        for (int i = 0; i < 7; i++) {
+            if ((keyByte & PARITY_BIT_MASK[i]) > 0) {
+                even = !even;
+            }
+        }
+        if (keyByte < 0) {
+            even = !even;
+        }
+
+        return even;
+    }
+}
--- a/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
 /*
  * @test
  * @bug 6239400
- * @summary Tests NotificationBuffer doesn't hold locks when adding listeners.
+ * @summary Tests NotificationBuffer doesn't hold locks when adding listeners,
+ *  if test times out then deadlock is suspected.
  * @author Eamonn McManus
  * @run clean NotificationBufferDeadlockTest
  * @run build NotificationBufferDeadlockTest
@@ -38,6 +39,7 @@
 import java.util.List;
 import java.util.Set;
 import java.util.Vector;
+import java.util.concurrent.CountDownLatch;
 import javax.management.*;
 import javax.management.remote.*;
 
@@ -173,9 +175,7 @@
         for (ObjectName name : names)
             mbsc.invoke(name, "send", null, null);
 
-        if (!countListener.waiting(MAX_WAITING_TIME)) {
-            return "did not get " + names.size() + " notifs as expected\n";
-        }
+        countListener.waiting();
 
         if (!sources.containsAll(names))
             return "missing names: " + sources;
@@ -202,13 +202,13 @@
                 }
             };
             t.start();
+            System.out.println("DeadlockTest-addNotificationListener waiting for the sending thread to die...");
             try {
-                t.join(5000L);
+                t.join(); //if times out here then deadlock is suspected
+                System.out.println("DeadlockTest-addNotificationListener OK.");
             } catch (Exception e) {
                 thisFailure = "Join exception: " + e;
             }
-            if (t.isAlive())
-                thisFailure = "Deadlock detected";
         }
 
         public void send() {
@@ -244,9 +244,9 @@
                     }
                 };
                 t.start();
-                t.join(5000);
-                if (t.isAlive())
-                    failure = "Query deadlock detected";
+                System.out.println("CreateDuringQueryInvocationHandler-createMBeanIfQuery waiting for the creating thread to die...");
+                t.join();  // if times out here then deadlock is suspected
+                System.out.println("CreateDuringQueryInvocationHandler-createMBeanIfQuery OK");
             }
         }
 
@@ -264,50 +264,30 @@
 
     private static class MyListener implements NotificationListener {
         public MyListener(int waitNB) {
-            this.waitNB= waitNB;
+            count = new CountDownLatch(waitNB);
         }
 
         public void handleNotification(Notification n, Object h) {
-            System.out.println("MyListener got: "+n.getSource()+" "+n.getType());
+            System.out.println("MyListener got: " + n.getSource() + " " + n.getType());
 
-            synchronized(this) {
-                if (TESTING_TYPE.equals(n.getType())) {
-                    sources.add((ObjectName) n.getSource());
-
-                    if (sources.size() == waitNB) {
-                        this.notifyAll();
-                    }
-                }
+            if (TESTING_TYPE.equals(n.getType())) {
+                sources.add((ObjectName) n.getSource());
+                count.countDown();
             }
         }
 
-        public boolean waiting(long timeout) {
-            final long startTime = System.currentTimeMillis();
-            long toWait = timeout;
-
-            synchronized(this) {
-                while(sources.size() < waitNB && toWait > 0) {
-                    try {
-                        this.wait(toWait);
-                    } catch (InterruptedException ire) {
-                        break;
-                    }
-
-                    toWait = timeout -
-                        (System.currentTimeMillis() - startTime);
-                }
-            }
-
-            return sources.size() == waitNB;
+        public void waiting() throws InterruptedException {
+            System.out.println("MyListener-waiting ...");
+            count.await(); // if times out here then deadlock is suspected
+            System.out.println("MyListener-waiting done!");
         }
 
-        private final int waitNB;
+        private final CountDownLatch count;
     }
 
     static String thisFailure;
     static String failure;
     static int nextNameIndex;
-    static final long MAX_WAITING_TIME = 10000;
 
     private static MyListener countListener;
     private static final List<ObjectName> sources = new Vector();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/smartcardio/CommandAPDUTest.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049021
+ * @summary Test different constructors for CommandAPDU and check CLA,INS,NC,NE,
+ * P1,and P2
+ * @run testng CommandAPDUTest
+ */
+import java.nio.ByteBuffer;
+import javax.smartcardio.CommandAPDU;
+import static org.testng.Assert.*;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class CommandAPDUTest {
+
+    static final byte[] C1 = {(byte) 0x00, (byte) 0xA4, (byte) 0x04,
+        (byte) 0x00, (byte) 0x07, (byte) 0xA0, (byte) 0x00, (byte) 0x00,
+        (byte) 0x00, (byte) 0x62, (byte) 0x81, (byte) 0x01, (byte) 0x00};
+    static int cla, ins, nc, ne, p1, p2;
+    static byte[] apdu, data;
+    static CommandAPDU cm1, cm2, cm3, cm4, cm5, cm6, cm7, cm8, cm9;
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+        //expected values of apdu, data, headers, nc, ne
+        CommandAPDU capdu = new CommandAPDU(C1);
+        apdu = capdu.getBytes();
+        data = capdu.getData();
+
+        cla = capdu.getCLA();
+        if (cla != (C1[0] & 0xff)) {
+            throw new RuntimeException("Failure: cla is not right");
+        }
+
+        ins = capdu.getINS();
+        if (ins != (C1[1] & 0xff)) {
+            throw new RuntimeException("Failure: ins is not right");
+        }
+
+        p1 = capdu.getP1();
+        if (p1 != (C1[2] & 0xff)) {
+            throw new RuntimeException("Failure: p1 is not right");
+        }
+
+        p2 = capdu.getP2();
+        if (p2 != (C1[3] & 0xff)) {
+            throw new RuntimeException("Failure: p2 is not right");
+        }
+
+        nc = capdu.getNc();
+        ne = capdu.getNe();
+
+        //Test on following constructors
+        cm1 = new CommandAPDU(apdu);
+        cm2 = new CommandAPDU(cla, ins, p1, p2);
+        cm3 = new CommandAPDU(cla, ins, p1, p2, data);
+        cm4 = new CommandAPDU(cla, ins, p1, p2, data, ne);
+        cm5 = new CommandAPDU(cla, ins, p1, p2, ne);
+        cm6 = new CommandAPDU(ByteBuffer.wrap(apdu));
+        cm7 = new CommandAPDU(apdu, 0, apdu.length);
+        cm8 = new CommandAPDU(cla, ins, p1, p2, data, 0, nc);
+        cm9 = new CommandAPDU(cla, ins, p1, p2, data, 0, nc, ne);
+    }
+
+    @Test(dataProvider = "provider1")
+    public static void testHeaders(CommandAPDU cm) {
+        assertEquals(cla, cm.getCLA());
+        assertEquals(ins, cm.getINS());
+        assertEquals(p1, cm.getP1());
+        assertEquals(p2, cm.getP2());
+    }
+
+    @Test(dataProvider = "provider2")
+    public static void testAPDU(CommandAPDU cm) {
+        assertEquals(apdu, cm.getBytes());
+    }
+
+    @Test(dataProvider = "provider3")
+    public static void testData(CommandAPDU cm) {
+        assertEquals(data, cm.getData());
+    }
+
+    @Test(dataProvider = "provider3")
+    public static void testNC(CommandAPDU cm) {
+        assertEquals(nc, cm.getNc());
+    }
+
+    @Test(dataProvider = "provider4")
+    public static void testNE(CommandAPDU cm) {
+        assertEquals(ne, cm.getNe());
+    }
+
+    @DataProvider
+    public Object[][] provider1() {
+        return new Object[][]{{cm1}, {cm2}, {cm3}, {cm4}, {cm5}, {cm6}, {cm7},
+        {cm8}, {cm9}};
+    }
+
+    @DataProvider
+    public Object[][] provider2() {
+        return new Object[][]{{cm1}, {cm6}, {cm7}};
+    }
+
+    @DataProvider
+    public Object[][] provider3() {
+        return new Object[][]{{cm1}, {cm3}, {cm4}, {cm6}, {cm7}, {cm8}, {cm9}};
+    }
+
+    @DataProvider
+    public Object[][] provider4() {
+        return new Object[][]{{cm1}, {cm4}, {cm5}, {cm6}, {cm7}, {cm9}};
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/smartcardio/ResponseAPDUTest.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049021
+ * @summary Construct ResponseAPDU from byte array and check NR< SW, SW1 and SW2
+ * @run testng ResponseAPDUTest
+ */
+import javax.smartcardio.ResponseAPDU;
+import static org.testng.Assert.*;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class ResponseAPDUTest {
+
+    static final byte[] R1 = {(byte) 0x07, (byte) 0xA0, (byte) 0x00,
+        (byte) 0x00, (byte) 0x00, (byte) 0x62, (byte) 0x81, (byte) 0x01,
+        (byte) 0x04, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x24,
+        (byte) 0x05, (byte) 0x00, (byte) 0x0B, (byte) 0x04, (byte) 0xB0,
+        (byte) 0x25, (byte) 0x90, (byte) 0x00};
+    static final ResponseAPDU RAPDU = new ResponseAPDU(R1);
+    static byte[] expectedData;
+    static int expectedNr, expectedSw1, expectedSw2, expectedSw;
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+        //expected values for data,nr,sw1,sw2 and sw
+
+        int apduLen = R1.length;
+        expectedData = new byte[apduLen - 2];
+        for (int i = 0; i < (apduLen - 2); i++) {
+            expectedData[i] = R1[i];
+        }
+
+        expectedNr = expectedData.length;
+        expectedSw1 = R1[apduLen - 2] & 0xff;
+        expectedSw2 = R1[apduLen - 1] & 0xff;
+        expectedSw = (expectedSw1 << 8) | expectedSw2;
+    }
+
+    @Test
+    public static void test() {
+        assertEquals(RAPDU.getBytes(), R1);
+        assertEquals(RAPDU.getData(), expectedData);
+        assertEquals(RAPDU.getNr(), expectedNr);
+        assertEquals(RAPDU.getSW(), expectedSw);
+        assertEquals(RAPDU.getSW1(), expectedSw1);
+        assertEquals(RAPDU.getSW2(), expectedSw2);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/smartcardio/TerminalFactorySpiTest.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049021
+ * @summary Test if we can write new provider for smart card
+ * @run main/othervm/policy=policy TerminalFactorySpiTest
+ */
+import java.security.Provider;
+import java.security.Security;
+import java.util.Arrays;
+import javax.smartcardio.CardTerminals;
+import javax.smartcardio.TerminalFactory;
+import javax.smartcardio.TerminalFactorySpi;
+
+public class TerminalFactorySpiTest {
+
+    static boolean callMethod = false;
+
+    public static void main(String[] args) throws Exception {
+        Provider myProvider = new MyProvider();
+        Security.addProvider(myProvider);
+        System.out.println(Arrays.asList(Security.getProviders()));
+
+        TerminalFactory.getInstance("MyType", new Object()).terminals();
+        if (!callMethod) {
+            throw new RuntimeException("Expected engineTerminals() not called");
+        }
+    }
+
+    public static class MyProvider extends Provider {
+
+        MyProvider() {
+            super("MyProvider", 1.0d, "smart Card Example");
+            put("TerminalFactory.MyType", "TerminalFactorySpiTest$MyTerminalFactorySpi");
+        }
+    }
+
+    public static class MyTerminalFactorySpi extends TerminalFactorySpi {
+
+        public MyTerminalFactorySpi(Object ob) {
+        }
+
+        protected CardTerminals engineTerminals() {
+            System.out.println("MyTerminalFactory.engineTerminals()");
+            callMethod = true;
+            return null;
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/smartcardio/policy	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,4 @@
+grant {
+        permission java.security.SecurityPermission "insertProvider.MyProvider";
+        permission java.security.SecurityPermission "putProviderProperty.MyProvider";
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/jdk/testlibrary/FilterClassLoader.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.testlibrary;
+
+import java.util.function.Predicate;
+/**
+ * A classloader, which using target classloader in case provided condition
+ * for class name is met, and using parent otherwise
+ */
+public class FilterClassLoader extends ClassLoader {
+
+    private final ClassLoader target;
+    private final Predicate<String> condition;
+
+    public FilterClassLoader(ClassLoader target, ClassLoader parent,
+            Predicate<String> condition) {
+        super(parent);
+        this.condition = condition;
+        this.target = target;
+    }
+
+    @Override
+    public Class<?> loadClass(String name) throws ClassNotFoundException {
+        if (condition.test(name)) {
+            return target.loadClass(name);
+        }
+        return super.loadClass(name);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/testlibrary/jdk/testlibrary/ParentLastURLClassLoader.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.testlibrary;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+/**
+ * An url classloader, which trying to load class from provided URL[] first,
+ * and using parent classloader in case it failed
+ */
+public class ParentLastURLClassLoader extends URLClassLoader {
+
+    public ParentLastURLClassLoader(URL urls[], ClassLoader parent) {
+        super(urls, parent);
+    }
+
+    @Override
+    public Class<?> loadClass(String name) throws ClassNotFoundException {
+        try {
+            Class c = findClass(name);
+            if (c != null) {
+                return c;
+            }
+        } catch (ClassNotFoundException e) {
+            // ignore
+        }
+        return super.loadClass(name);
+    }
+}
--- a/test/lib/testlibrary/jdk/testlibrary/Platform.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/lib/testlibrary/jdk/testlibrary/Platform.java	Sat Jan 10 12:38:18 2015 -0800
@@ -28,6 +28,15 @@
     private static final String dataModel   = System.getProperty("sun.arch.data.model");
     private static final String vmVersion   = System.getProperty("java.vm.version");
     private static final String osArch      = System.getProperty("os.arch");
+    private static final String vmName      = System.getProperty("java.vm.name");
+
+    public static boolean isClient() {
+        return vmName.endsWith(" Client VM");
+    }
+
+    public static boolean isServer() {
+        return vmName.endsWith(" Server VM");
+    }
 
     public static boolean is32bit() {
         return dataModel.equals("32");
--- a/test/lib/testlibrary/jdk/testlibrary/Utils.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/lib/testlibrary/jdk/testlibrary/Utils.java	Sat Jan 10 12:38:18 2015 -0800
@@ -39,6 +39,7 @@
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
 import java.util.concurrent.TimeUnit;
+import java.util.function.BooleanSupplier;
 
 /**
  * Common library for various test helper functions.
@@ -271,25 +272,6 @@
     }
 
     /**
-     * Returns file content as a list of strings
-     *
-     * @param file File to operate on
-     * @return List of strings
-     * @throws IOException
-     */
-    public static List<String> fileAsList(File file) throws IOException {
-        assertTrue(file.exists() && file.isFile(),
-                file.getAbsolutePath() + " does not exist or not a file");
-        List<String> output = new ArrayList<>();
-        try (BufferedReader reader = new BufferedReader(new FileReader(file.getAbsolutePath()))) {
-            while (reader.ready()) {
-                output.add(reader.readLine().replace(NEW_LINE, ""));
-            }
-        }
-        return output;
-    }
-
-    /**
      * Adjusts the provided timeout value for the TIMEOUT_FACTOR
      * @param tOut the timeout value to be adjusted
      * @return The timeout value adjusted for the value of "test.timeout.factor"
@@ -298,4 +280,50 @@
     public static long adjustTimeout(long tOut) {
         return Math.round(tOut * Utils.TIMEOUT_FACTOR);
     }
+
+    /**
+     * Wait for condition to be true
+     *
+     * @param condition, a condition to wait for
+     */
+    public static final void waitForCondition(BooleanSupplier condition) {
+        waitForCondition(condition, -1L, 100L);
+    }
+
+    /**
+     * Wait until timeout for condition to be true
+     *
+     * @param condition, a condition to wait for
+     * @param timeout a time in milliseconds to wait for condition to be true
+     * specifying -1 will wait forever
+     * @return condition value, to determine if wait was successfull
+     */
+    public static final boolean waitForCondition(BooleanSupplier condition,
+            long timeout) {
+        return waitForCondition(condition, timeout, 100L);
+    }
+
+    /**
+     * Wait until timeout for condition to be true for specified time
+     *
+     * @param condition, a condition to wait for
+     * @param timeout a time in milliseconds to wait for condition to be true,
+     * specifying -1 will wait forever
+     * @param sleepTime a time to sleep value in milliseconds
+     * @return condition value, to determine if wait was successfull
+     */
+    public static final boolean waitForCondition(BooleanSupplier condition,
+            long timeout, long sleepTime) {
+        long startTime = System.currentTimeMillis();
+        while (!(condition.getAsBoolean() || (timeout != -1L
+                && ((System.currentTimeMillis() - startTime) > timeout)))) {
+            try {
+                Thread.sleep(sleepTime);
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+                throw new Error(e);
+            }
+        }
+        return condition.getAsBoolean();
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/rmi/rmic/iiopCompilation/IIOPCompilation.java	Sat Jan 10 12:38:18 2015 -0800
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8065957
+ * @library ../../../../java/rmi/testlibrary
+ * @build TestLibrary
+ * @summary Compiles a PortableRemoteObject with rmic -iiop and ensures that stub and tie classes are generated.
+ * @run main IIOPCompilation
+ * @author Felix Yang
+ *
+ */
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.rmi.RemoteException;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.rmi.PortableRemoteObject;
+
+public class IIOPCompilation {
+
+    public static void main(String args[]) throws IOException, InterruptedException {
+        IIOPCompilation test = new IIOPCompilation();
+        test.doTest();
+    }
+
+    private void doTest() throws IOException, InterruptedException {
+        String className = DummyImpl.class.getName();
+        int exitCode = runRmic(className);
+        if (exitCode != 0) {
+            throw new RuntimeException("Rmic failed. The exit code is " + exitCode);
+        }
+
+        // Check the stub class generated correctly
+        String stubFile = "_" + Dummy.class.getName() + "_Stub.class";
+        assertFileExists(stubFile);
+
+        // Check the tie class generated correctly
+        String tieFile = "_" + className + "_Tie.class";
+        assertFileExists(tieFile);
+    }
+
+    private void assertFileExists(String fileName) throws FileNotFoundException {
+        if (!new File(fileName).exists()) {
+            throw new FileNotFoundException(fileName + " doesn't exist!");
+        }
+    }
+
+    private int runRmic(String classname) throws IOException, InterruptedException {
+        String rmicProgramStr = TestLibrary.getProperty("java.home", "") + File.separator + "bin" + File.separator + "rmic";
+        String testClasses = TestLibrary.getProperty("test.classes", "");
+        List<String> command = Arrays.asList(rmicProgramStr, "-iiop", "-classpath", testClasses, classname);
+        System.out.println("Running command: " + command);
+
+        Process p = null;
+        try {
+            p = new ProcessBuilder(command).inheritIO().start();
+            p.waitFor();
+            return p.exitValue();
+        } finally {
+            if (p != null && p.isAlive()) {
+                p.destroy();
+            }
+        }
+    }
+}
+
+interface Dummy extends java.rmi.Remote {
+}
+
+class DummyImpl extends PortableRemoteObject implements Dummy {
+    public DummyImpl() throws RemoteException {
+    }
+}
--- a/test/sun/security/provider/DSA/TestDSA2.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/sun/security/provider/DSA/TestDSA2.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
     public static void main(String[] args) throws Exception {
         boolean[] expectedToPass = { true, true, true };
         test(1024, expectedToPass);
-        boolean[] expectedToPass2 = { false, true, true };
+        boolean[] expectedToPass2 = { true, true, true };
         test(2048, expectedToPass2);
     }
 
--- a/test/sun/tools/jcmd/TestJcmdDefaults.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/sun/tools/jcmd/TestJcmdDefaults.java	Sat Jan 10 12:38:18 2015 -0800
@@ -25,6 +25,9 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.List;
 
 import jdk.testlibrary.JcmdBase;
@@ -95,11 +98,11 @@
     }
 
     private static void verifyOutputAgainstFile(OutputAnalyzer output) throws IOException {
-        File file = new File(TEST_SRC, "usage.out");
-        List<String> fileOutput = Utils.fileAsList(file);
+        Path path = Paths.get(TEST_SRC, "usage.out");
+        List<String> fileOutput = Files.readAllLines(path);
         List<String> outputAsLines = output.asLines();
         assertTrue(outputAsLines.containsAll(fileOutput),
-                "The ouput should contain all content of " + file.getAbsolutePath());
+                "The ouput should contain all content of " + path.toAbsolutePath());
     }
 
 }
--- a/test/sun/tools/jcmd/TestJcmdSanity.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/sun/tools/jcmd/TestJcmdSanity.java	Sat Jan 10 12:38:18 2015 -0800
@@ -25,6 +25,9 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.List;
 
 import jdk.testlibrary.JcmdBase;
@@ -160,11 +163,11 @@
     }
 
     private static void verifyOutputAgainstFile(OutputAnalyzer output) throws IOException {
-        File file = new File(TEST_SRC, "help_help.out");
-        List<String> fileOutput = Utils.fileAsList(file);
+        Path path = Paths.get(TEST_SRC, "help_help.out");
+        List<String> fileOutput = Files.readAllLines(path);
         List<String> outputAsLines = output.asLines();
         assertTrue(outputAsLines.containsAll(fileOutput),
-                "The ouput should contain all content of " + file.getAbsolutePath());
+                "The ouput should contain all content of " + path.toAbsolutePath());
     }
 
 }
--- a/test/sun/tools/jps/JpsHelper.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/sun/tools/jps/JpsHelper.java	Sat Jan 10 12:38:18 2015 -0800
@@ -28,6 +28,9 @@
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -189,11 +192,11 @@
      */
     public static void verifyOutputAgainstFile(OutputAnalyzer output) throws IOException {
         String testSrc = System.getProperty("test.src", "?");
-        File file = new File(testSrc, "usage.out");
-        List<String> fileOutput = Utils.fileAsList(file);
+        Path path = Paths.get(testSrc, "usage.out");
+        List<String> fileOutput = Files.readAllLines(path);
         List<String> outputAsLines = output.asLines();
         assertTrue(outputAsLines.containsAll(fileOutput),
-                "The ouput should contain all content of " + file.getAbsolutePath());
+                "The ouput should contain all content of " + path.toAbsolutePath());
     }
 
     private static File getManifest(String className) throws IOException {
--- a/test/tools/pack200/Pack200Test.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/tools/pack200/Pack200Test.java	Sat Jan 10 12:38:18 2015 -0800
@@ -127,7 +127,7 @@
         // select the jars carefully, adding more jars will increase the
         // testing time, especially for jprt.
         jarList.add(Utils.createRtJar());
-        jarList.add(Utils.locateJar("golden.jar"));
+        jarList.add(Utils.getGoldenJar());
         System.out.println(jarList);
         doPackUnpack();
     }
--- a/test/tools/pack200/PackTestZip64.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/tools/pack200/PackTestZip64.java	Sat Jan 10 12:38:18 2015 -0800
@@ -52,7 +52,7 @@
         // make a copy of the test specimen to local directory
         File testFile = new File("tools_java.jar");
         // Add a large number of small files to the golden jar
-        generateLargeJar(testFile, Utils.locateJar("golden.jar"));
+        generateLargeJar(testFile, Utils.getGoldenJar());
 
         List<String> cmdsList = new ArrayList<>();
 
--- a/test/tools/pack200/RepackTest.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/tools/pack200/RepackTest.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
 
         // make a copy of the test specimen to local directory
         File testFile = new File("src_tools.jar");
-        Utils.copyFile(Utils.locateJar("golden.jar"), testFile);
+        Utils.copyFile(Utils.getGoldenJar(), testFile);
         List<String> cmdsList = new ArrayList<>();
 
         // case 1:
--- a/test/tools/pack200/TimeStamp.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/tools/pack200/TimeStamp.java	Sat Jan 10 12:38:18 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
     public static void main(String... args) throws IOException {
 
         // make a local copy of our test file
-        File srcFile = Utils.locateJar("golden.jar");
+        File srcFile = Utils.getGoldenJar();
         File goldenFile = new File("golden.jar");
         Utils.copyFile(srcFile, goldenFile);
 
--- a/test/tools/pack200/Utils.java	Thu Jan 08 10:44:54 2015 +0100
+++ b/test/tools/pack200/Utils.java	Sat Jan 10 12:38:18 2015 -0800
@@ -63,7 +63,7 @@
             System.getProperty("os.name").startsWith("Windows");
     static final boolean Is64Bit =
             System.getProperty("sun.arch.data.model", "32").equals("64");
-    static final File   JavaSDK =  new File(JavaHome).getParentFile();
+    static final File   JavaSDK =  new File(JavaHome);
 
     static final String PACK_FILE_EXT   = ".pack";
     static final String JAVA_FILE_EXT   = ".java";
@@ -82,11 +82,7 @@
         if (VerifierJar.exists()) {
             return;
         }
-        File srcDir = new File(TEST_SRC_DIR, VERIFIER_DIR_NAME);
-        if (!srcDir.exists()) {
-            // if not available try one level above
-            srcDir = new File(TEST_SRC_DIR.getParentFile(), VERIFIER_DIR_NAME);
-        }
+        File srcDir = new File(getVerifierDir(), "src");
         List<File> javaFileList = findFiles(srcDir, createFilter(JAVA_FILE_EXT));
         File tmpFile = File.createTempFile("javac", ".tmp");
         XCLASSES.mkdirs();
@@ -115,6 +111,18 @@
             ".");
     }
 
+    private static File getVerifierDir() {
+        File srcDir = new File(TEST_SRC_DIR, VERIFIER_DIR_NAME);
+        if (!srcDir.exists()) {
+            // if not available try one level above
+            srcDir = new File(TEST_SRC_DIR.getParentFile(), VERIFIER_DIR_NAME);
+        }
+        return srcDir;
+    }
+
+    static File getGoldenJar() {
+        return new File(new File(getVerifierDir(), "data"), "golden.jar");
+    }
     static void dirlist(File dir) {
         File[] files = dir.listFiles();
         System.out.println("--listing " + dir.getAbsolutePath() + "---");
@@ -564,7 +572,8 @@
         File rtJar = new File("rt.jar");
         cmdList.clear();
         cmdList.add(getJarCmd());
-        cmdList.add("cvf");
+        // cmdList.add("cvf"); too noisy
+        cmdList.add("cf");
         cmdList.add(rtJar.getName());
         cmdList.add("-C");
         cmdList.add("out");
@@ -574,24 +583,4 @@
         recursiveDelete(new File("out"));
         return rtJar;
     }
-    private static List<File> locaterCache = null;
-    // search the source dir and jdk dir for requested file and returns
-    // the first location it finds.
-    static File locateJar(String name) {
-        try {
-            if (locaterCache == null) {
-                locaterCache = new ArrayList<File>();
-                locaterCache.addAll(findFiles(TEST_SRC_DIR, createFilter(JAR_FILE_EXT)));
-                locaterCache.addAll(findFiles(JavaSDK, createFilter(JAR_FILE_EXT)));
-            }
-            for (File f : locaterCache) {
-                if (f.getName().equals(name)) {
-                    return f;
-                }
-            }
-            throw new IOException("file not found: " + name);
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
 }