changeset 11305:ebb2eb7f1aec jdk9-b48

Merge
author lana
date Sat, 24 Jan 2015 23:23:25 -0800
parents 2c3cf5bdd3ba e57fae04212b
children ee47a5aac84e 6529898873a9
files
diffstat 122 files changed, 9854 insertions(+), 1533 deletions(-) [+]
line wrap: on
line diff
--- a/make/gendata/GendataPolicyJars.gmk	Fri Jan 23 18:50:48 2015 -0800
+++ b/make/gendata/GendataPolicyJars.gmk	Sat Jan 24 23:23:25 2015 -0800
@@ -35,65 +35,62 @@
 US_EXPORT_POLICY_JAR_DST := \
     $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/US_export_policy.jar
 
-ifneq ($(BUILD_CRYPTO), no)
+US_EXPORT_POLICY_JAR_LIMITED := \
+    $(SUPPORT_OUTPUTDIR)/jce/policy/limited/US_export_policy.jar
+US_EXPORT_POLICY_JAR_UNLIMITED := \
+    $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy.jar
 
-  US_EXPORT_POLICY_JAR_LIMITED := \
-      $(SUPPORT_OUTPUTDIR)/jce/policy/limited/US_export_policy.jar
-  US_EXPORT_POLICY_JAR_UNLIMITED := \
-      $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy.jar
+ifndef OPENJDK
+  #
+  # In past releases, Oracle JDK has had a separately downloadable set of
+  # policy files which has been a nightmare for deployment.
+  #
+  # Now if we're closed and limited (default for Oracle JDK), create
+  # an "unlimited_policy" directory that contains the unlimited policy
+  # files.  It will be up to the user/deployer to make an informed choice
+  # as to whether they are legally entitled to use the unlimited policy
+  # file in their environment.  Users/deployers simply need to overwrite
+  # the files.  Consult README.txt (below) for more info.
+  #
+  UNLIMITED_POLICY_DIR := \
+      $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/unlimited_policy
+endif
 
-  ifndef OPENJDK
-    #
-    # In past releases, Oracle JDK has had a separately downloadable set of
-    # policy files which has been a nightmare for deployment.
-    #
-    # Now if we're closed and limited (default for Oracle JDK), create
-    # an "unlimited_policy" directory that contains the unlimited policy
-    # files.  It will be up to the user/deployer to make an informed choice
-    # as to whether they are legally entitled to use the unlimited policy
-    # file in their environment.  Users/deployers simply need to overwrite
-    # the files.  Consult README.txt (below) for more info.
-    #
-    UNLIMITED_POLICY_DIR := \
-        $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/unlimited_policy
-  endif
+#
+# TODO fix so that SetupArchive does not write files into SRCS
+# then we don't need this extra copying
+#
+# NOTE: We currently do not place restrictions on our limited export
+# policy. This was not a typo. This means we are shipping the same file
+# for both limited and unlimited US_export_policy.jar.  Only the local
+# policy file currently has restrictions.
+#
+US_EXPORT_POLICY_JAR_SRC_DIR := \
+    $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
+US_EXPORT_POLICY_JAR_TMP := \
+    $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy_jar.tmp
 
-  #
-  # TODO fix so that SetupArchive does not write files into SRCS
-  # then we don't need this extra copying
-  #
-  # NOTE: We currently do not place restrictions on our limited export
-  # policy. This was not a typo. This means we are shipping the same file
-  # for both limited and unlimited US_export_policy.jar.  Only the local
-  # policy file currently has restrictions.
-  #
-  US_EXPORT_POLICY_JAR_SRC_DIR := \
-      $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
-  US_EXPORT_POLICY_JAR_TMP := \
-      $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy_jar.tmp
-
-  $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
+$(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
 	$(install-file)
 
-  US_EXPORT_POLICY_JAR_DEPS := \
-      $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
+US_EXPORT_POLICY_JAR_DEPS := \
+    $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
 
-  $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \
-      $(US_EXPORT_POLICY_JAR_DEPS), \
-      SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
-      SUFFIXES := .policy, \
-      JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \
-      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
-      SKIP_METAINF := true))
+$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \
+    $(US_EXPORT_POLICY_JAR_DEPS), \
+    SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
+    SUFFIXES := .policy, \
+    JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \
+    EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+    SKIP_METAINF := true))
 
-  $(US_EXPORT_POLICY_JAR_LIMITED): \
-      $(US_EXPORT_POLICY_JAR_UNLIMITED)
-		$(ECHO) $(LOG_INFO) \
-		    Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-		$(install-file)
+$(US_EXPORT_POLICY_JAR_LIMITED): \
+    $(US_EXPORT_POLICY_JAR_UNLIMITED)
+	$(ECHO) $(LOG_INFO) \
+	    Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
 
-  TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED)
-endif
+TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED)
 
 ifeq ($(UNLIMITED_CRYPTO), true)
   $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED)
@@ -119,57 +116,54 @@
 LOCAL_POLICY_JAR_DST := \
     $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/local_policy.jar
 
-ifneq ($(BUILD_CRYPTO), no)
+LOCAL_POLICY_JAR_LIMITED := \
+    $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy.jar
+LOCAL_POLICY_JAR_UNLIMITED := \
+    $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar
 
-  LOCAL_POLICY_JAR_LIMITED := \
-      $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy.jar
-  LOCAL_POLICY_JAR_UNLIMITED := \
-      $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar
+#
+# TODO fix so that SetupArchive does not write files into SRCS
+# then we don't need this extra copying
+#
+LOCAL_POLICY_JAR_LIMITED_TMP := \
+    $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy_jar.tmp
+LOCAL_POLICY_JAR_UNLIMITED_TMP := \
+    $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy_jar.tmp
 
-  #
-  # TODO fix so that SetupArchive does not write files into SRCS
-  # then we don't need this extra copying
-  #
-  LOCAL_POLICY_JAR_LIMITED_TMP := \
-      $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy_jar.tmp
-  LOCAL_POLICY_JAR_UNLIMITED_TMP := \
-      $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy_jar.tmp
+$(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \
+    $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
+	$(install-file)
 
-  $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \
-      $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
+$(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \
+    $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
+	$(install-file)
+
+$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
+    $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
+    $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
+    SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
+    SUFFIXES := .policy, \
+    JAR := $(LOCAL_POLICY_JAR_LIMITED), \
+    EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
+    SKIP_METAINF := true))
+
+$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
+    $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
+    SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
+    SUFFIXES := .policy, \
+    JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \
+    EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+    SKIP_METAINF := true))
+
+TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED)
+
+ifndef OPENJDK
+  ifneq ($(UNLIMITED_CRYPTO), true)
+    $(UNLIMITED_POLICY_DIR)/README.txt: \
+        $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt
 		$(install-file)
 
-  $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \
-      $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
-		$(install-file)
-
-  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
-      $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
-      $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
-      SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
-      SUFFIXES := .policy, \
-      JAR := $(LOCAL_POLICY_JAR_LIMITED), \
-      EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
-      SKIP_METAINF := true))
-
-  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
-      $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
-      SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
-      SUFFIXES := .policy, \
-      JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \
-      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
-      SKIP_METAINF := true))
-
-  TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED)
-
-  ifndef OPENJDK
-    ifneq ($(UNLIMITED_CRYPTO), true)
-      $(UNLIMITED_POLICY_DIR)/README.txt: \
-          $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt
-		$(install-file)
-
-      TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt
-    endif
+    TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt
   endif
 endif
 
--- a/make/lib/Awt2dLibraries.gmk	Fri Jan 23 18:50:48 2015 -0800
+++ b/make/lib/Awt2dLibraries.gmk	Sat Jan 24 23:23:25 2015 -0800
@@ -300,7 +300,6 @@
 
     LIBAWT_XAWT_DIRS := \
         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt_xawt \
-        $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt \
         $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
         $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/utility \
         $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
--- a/make/src/classes/build/tools/module/ext.modules	Fri Jan 23 18:50:48 2015 -0800
+++ b/make/src/classes/build/tools/module/ext.modules	Sat Jan 24 23:23:25 2015 -0800
@@ -6,4 +6,4 @@
 jdk.naming.dns
 jdk.scripting.nashorn
 jdk.zipfs
-oracle.accessbridge
+jdk.accessbridge
--- a/src/java.base/macosx/classes/java/lang/ClassLoaderHelper.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/macosx/classes/java/lang/ClassLoaderHelper.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -31,6 +31,11 @@
     private ClassLoaderHelper() {}
 
     /**
+     * Indicates, whether PATH env variable is allowed to contain quoted entries.
+     */
+    static final boolean allowsQuotedPathElements = false;
+
+    /**
      * Returns an alternate path name for the given file
      * such that if the original pathname did not exist, then the
      * file may be located at the alternate location.
--- a/src/java.base/share/classes/java/lang/Class.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/lang/Class.java	Sat Jan 24 23:23:25 2015 -0800
@@ -149,7 +149,8 @@
      * {@code getName}.  If this {@code Class} object represents a
      * primitive type, this method returns the name of the primitive type.  If
      * this {@code Class} object represents void this method returns
-     * "void".
+     * "void". If this {@code Class} object represents an array type,
+     * this method returns "class " followed by {@code getName}.
      *
      * @return a string representation of this class object.
      */
@@ -174,6 +175,12 @@
      * occur in canonical order. If there are no type parameters, the
      * type parameter list is elided.
      *
+     * For an array type, the string starts with the type name,
+     * followed by an angle-bracketed comma-separated list of the
+     * type's type parameters, if any, followed by a sequence of
+     * {@code []} characters, one set of brackets per dimension of
+     * the array.
+     *
      * <p>Note that since information about the runtime representation
      * of a type is being generated, modifiers not present on the
      * originating source code or illegal on the originating source
@@ -189,29 +196,39 @@
             return toString();
         } else {
             StringBuilder sb = new StringBuilder();
-
-            // Class modifiers are a superset of interface modifiers
-            int modifiers = getModifiers() & Modifier.classModifiers();
-            if (modifiers != 0) {
-                sb.append(Modifier.toString(modifiers));
+            Class<?> component = this;
+            int arrayDepth = 0;
+
+            if (isArray()) {
+                do {
+                    arrayDepth++;
+                    component = component.getComponentType();
+                } while (component.isArray());
+                sb.append(component.getName());
+            } else {
+                // Class modifiers are a superset of interface modifiers
+                int modifiers = getModifiers() & Modifier.classModifiers();
+                if (modifiers != 0) {
+                    sb.append(Modifier.toString(modifiers));
+                    sb.append(' ');
+                }
+
+                if (isAnnotation()) {
+                    sb.append('@');
+                }
+                if (isInterface()) { // Note: all annotation types are interfaces
+                    sb.append("interface");
+                } else {
+                    if (isEnum())
+                        sb.append("enum");
+                    else
+                        sb.append("class");
+                }
                 sb.append(' ');
+                sb.append(getName());
             }
 
-            if (isAnnotation()) {
-                sb.append('@');
-            }
-            if (isInterface()) { // Note: all annotation types are interfaces
-                sb.append("interface");
-            } else {
-                if (isEnum())
-                    sb.append("enum");
-                else
-                    sb.append("class");
-            }
-            sb.append(' ');
-            sb.append(getName());
-
-            TypeVariable<?>[] typeparms = getTypeParameters();
+            TypeVariable<?>[] typeparms = component.getTypeParameters();
             if (typeparms.length > 0) {
                 boolean first = true;
                 sb.append('<');
@@ -224,6 +241,9 @@
                 sb.append('>');
             }
 
+            for (int i = 0; i < arrayDepth; i++)
+                sb.append("[]");
+
             return sb.toString();
         }
     }
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -1360,7 +1360,10 @@
             return null;
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            checkClassLoaderPermission(this, Reflection.getCallerClass());
+            // Check access to the parent class loader
+            // If the caller's class loader is same as this class loader,
+            // permission check is performed.
+            checkClassLoaderPermission(parent, Reflection.getCallerClass());
         }
         return parent;
     }
@@ -1503,6 +1506,11 @@
         return caller.getClassLoader0();
     }
 
+    /*
+     * Checks RuntimePermission("getClassLoader") permission
+     * if caller's class loader is not null and caller's class loader
+     * is not the same as or an ancestor of the given cl argument.
+     */
     static void checkClassLoaderPermission(ClassLoader cl, Class<?> caller) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
@@ -1747,35 +1755,54 @@
     private static String usr_paths[];
     private static String sys_paths[];
 
-    private static String[] initializePath(String propname) {
-        String ldpath = System.getProperty(propname, "");
-        String ps = File.pathSeparator;
-        int ldlen = ldpath.length();
-        int i, j, n;
-        // Count the separators in the path
-        i = ldpath.indexOf(ps);
-        n = 0;
-        while (i >= 0) {
-            n++;
-            i = ldpath.indexOf(ps, i + 1);
+    private static String[] initializePath(String propName) {
+        String ldPath = System.getProperty(propName, "");
+        int ldLen = ldPath.length();
+        char ps = File.pathSeparatorChar;
+        int psCount = 0;
+
+        if (ClassLoaderHelper.allowsQuotedPathElements &&
+                ldPath.indexOf('\"') >= 0) {
+            // First, remove quotes put around quoted parts of paths.
+            // Second, use a quotation mark as a new path separator.
+            // This will preserve any quoted old path separators.
+            char[] buf = new char[ldLen];
+            int bufLen = 0;
+            for (int i = 0; i < ldLen; ++i) {
+                char ch = ldPath.charAt(i);
+                if (ch == '\"') {
+                    while (++i < ldLen &&
+                            (ch = ldPath.charAt(i)) != '\"') {
+                        buf[bufLen++] = ch;
+                    }
+                } else {
+                    if (ch == ps) {
+                        psCount++;
+                        ch = '\"';
+                    }
+                    buf[bufLen++] = ch;
+                }
+            }
+            ldPath = new String(buf, 0, bufLen);
+            ldLen = bufLen;
+            ps = '\"';
+        } else {
+            for (int i = ldPath.indexOf(ps); i >= 0;
+                    i = ldPath.indexOf(ps, i + 1)) {
+                psCount++;
+            }
         }
 
-        // allocate the array of paths - n :'s = n + 1 path elements
-        String[] paths = new String[n + 1];
-
-        // Fill the array with paths from the ldpath
-        n = i = 0;
-        j = ldpath.indexOf(ps);
-        while (j >= 0) {
-            if (j - i > 0) {
-                paths[n++] = ldpath.substring(i, j);
-            } else if (j - i == 0) {
-                paths[n++] = ".";
-            }
-            i = j + 1;
-            j = ldpath.indexOf(ps, i);
+        String[] paths = new String[psCount + 1];
+        int pathStart = 0;
+        for (int j = 0; j < psCount; ++j) {
+            int pathEnd = ldPath.indexOf(ps, pathStart);
+            paths[j] = (pathStart < pathEnd) ?
+                    ldPath.substring(pathStart, pathEnd) : ".";
+            pathStart = pathEnd + 1;
         }
-        paths[n] = ldpath.substring(i, ldlen);
+        paths[psCount] = (pathStart < ldLen) ?
+                ldPath.substring(pathStart, ldLen) : ".";
         return paths;
     }
 
--- a/src/java.base/share/classes/java/net/MulticastSocket.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/net/MulticastSocket.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -569,7 +569,7 @@
     public NetworkInterface getNetworkInterface() throws SocketException {
         NetworkInterface ni
             = (NetworkInterface)getImpl().getOption(SocketOptions.IP_MULTICAST_IF2);
-        if (ni.getIndex() == 0) {
+        if ((ni.getIndex() == 0) || (ni.getIndex() == -1)) {
             InetAddress[] addrs = new InetAddress[1];
             addrs[0] = InetAddress.anyLocalAddress();
             return new NetworkInterface(addrs[0].getHostName(), 0, addrs);
--- a/src/java.base/share/classes/java/net/URI.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/net/URI.java	Sat Jan 24 23:23:25 2015 -0800
@@ -2637,6 +2637,11 @@
     private static final long H_URIC_NO_SLASH
         = H_UNRESERVED | H_ESCAPED | highMask(";?:@&=+$,");
 
+    // scope_id = alpha | digit | "_" | "."
+    private static final long L_SCOPE_ID
+        = L_ALPHANUM | lowMask("_.");
+    private static final long H_SCOPE_ID
+        = H_ALPHANUM | highMask("_.");
 
     // -- Escaping and encoding --
 
@@ -3226,7 +3231,7 @@
                         if (r+1 == q) {
                             fail ("scope id expected");
                         }
-                        checkChars (r+1, q, L_ALPHANUM, H_ALPHANUM,
+                        checkChars (r+1, q, L_SCOPE_ID, H_SCOPE_ID,
                                                 "scope id");
                     } else {
                         parseIPv6Reference(p, q);
--- a/src/java.base/share/classes/java/nio/channels/Channels.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/nio/channels/Channels.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -579,12 +579,13 @@
      * charset and writes the resulting bytes to the given channel.
      *
      * <p> An invocation of this method of the form
-     * <p>
+     *
      * <pre> {@code
      *     Channels.newWriter(ch, csname)
      * } </pre>
+     *
      * behaves in exactly the same way as the expression
-     * <p>
+     *
      * <pre> {@code
      *     Channels.newWriter(ch, Charset.forName(csName).newEncoder(), -1)
      * } </pre>
--- a/src/java.base/share/classes/java/util/Formatter.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/util/Formatter.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1835,7 +1835,7 @@
  * <p> The maximum number of arguments is limited by the maximum dimension of a
  * Java array as defined by
  * <cite>The Java&trade; Virtual Machine Specification</cite>.
- * If the argument index is does not correspond to an
+ * If the argument index does not correspond to an
  * available argument, then a {@link MissingFormatArgumentException} is thrown.
  *
  * <p> If there are more arguments than format specifiers, the extra arguments
--- a/src/java.base/share/classes/java/util/Hashtable.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/util/Hashtable.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1137,10 +1137,10 @@
         Entry<Object, Object> entryStack = null;
 
         synchronized (this) {
-            // Write out the length, threshold, loadfactor
+            // Write out the threshold and loadFactor
             s.defaultWriteObject();
 
-            // Write out length, count of elements
+            // Write out the length and count of elements
             s.writeInt(table.length);
             s.writeInt(count);
 
@@ -1169,22 +1169,33 @@
     private void readObject(java.io.ObjectInputStream s)
          throws IOException, ClassNotFoundException
     {
-        // Read in the length, threshold, and loadfactor
+        // Read in the threshold and loadFactor
         s.defaultReadObject();
 
+        // Validate loadFactor (ignore threshold - it will be re-computed)
+        if (loadFactor <= 0 || Float.isNaN(loadFactor))
+            throw new StreamCorruptedException("Illegal Load: " + loadFactor);
+
         // Read the original length of the array and number of elements
         int origlength = s.readInt();
         int elements = s.readInt();
 
-        // Compute new size with a bit of room 5% to grow but
-        // no larger than the original size.  Make the length
+        // Validate # of elements
+        if (elements < 0)
+            throw new StreamCorruptedException("Illegal # of Elements: " + elements);
+
+        // Clamp original length to be more than elements / loadFactor
+        // (this is the invariant enforced with auto-growth)
+        origlength = Math.max(origlength, (int)(elements / loadFactor) + 1);
+
+        // Compute new length with a bit of room 5% + 3 to grow but
+        // no larger than the clamped original length.  Make the length
         // odd if it's large enough, this helps distribute the entries.
         // Guard against the length ending up zero, that's not valid.
-        int length = (int)(elements * loadFactor) + (elements / 20) + 3;
+        int length = (int)((elements + elements / 20) / loadFactor) + 3;
         if (length > elements && (length & 1) == 0)
             length--;
-        if (origlength > 0 && length > origlength)
-            length = origlength;
+        length = Math.min(length, origlength);
         table = new Entry<?,?>[length];
         threshold = (int)Math.min(length * loadFactor, MAX_ARRAY_SIZE + 1);
         count = 0;
@@ -1195,7 +1206,7 @@
                 K key = (K)s.readObject();
             @SuppressWarnings("unchecked")
                 V value = (V)s.readObject();
-            // synch could be eliminated for performance
+            // sync is eliminated for performance
             reconstitutionPut(table, key, value);
         }
     }
@@ -1207,9 +1218,9 @@
      *
      * <p>This differs from the regular put method in several ways. No
      * checking for rehashing is necessary since the number of elements
-     * initially in the table is known. The modCount is not incremented
-     * because we are creating a new instance. Also, no return value
-     * is needed.
+     * initially in the table is known. The modCount is not incremented and
+     * there's no synchronization because we are creating a new instance.
+     * Also, no return value is needed.
      */
     private void reconstitutionPut(Entry<?,?>[] tab, K key, V value)
         throws StreamCorruptedException
--- a/src/java.base/share/classes/java/util/Spliterator.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/util/Spliterator.java	Sat Jan 24 23:23:25 2015 -0800
@@ -125,7 +125,7 @@
  * are encountered.
  *
  * @apiNote
- * <p>Spliterators, like {@code Iterators}s, are for traversing the elements of
+ * <p>Spliterators, like {@code Iterator}s, are for traversing the elements of
  * a source.  The {@code Spliterator} API was designed to support efficient
  * parallel traversal in addition to sequential traversal, by supporting
  * decomposition as well as single-element iteration.  In addition, the
--- a/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java	Sat Jan 24 23:23:25 2015 -0800
@@ -978,7 +978,15 @@
             }
             try {
                 @SuppressWarnings("unchecked") T t = (T) r;
-                return f.apply(t).toCompletableFuture();
+                CompletableFuture<V> g = f.apply(t).toCompletableFuture();
+                Object s = g.result;
+                if (s != null)
+                    return new CompletableFuture<V>(encodeRelay(s));
+                CompletableFuture<V> d = new CompletableFuture<V>();
+                UniRelay<V> copy = new UniRelay<V>(d, g);
+                g.push(copy);
+                copy.tryFire(SYNC);
+                return d;
             } catch (Throwable ex) {
                 return new CompletableFuture<V>(encodeThrowable(ex));
             }
--- a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Sat Jan 24 23:23:25 2015 -0800
@@ -337,6 +337,7 @@
     /* try auth without calling Authenticator. Used for transparent NTLM authentication */
     private boolean tryTransparentNTLMServer = true;
     private boolean tryTransparentNTLMProxy = true;
+    private boolean useProxyResponseCode = false;
 
     /* Used by Windows specific code */
     private Object authObj;
@@ -2239,6 +2240,15 @@
                         if (tryTransparentNTLMProxy) {
                             tryTransparentNTLMProxy =
                                     NTLMAuthenticationProxy.supportsTransparentAuth;
+                            /* If the platform supports transparent authentication
+                             * then normally it's ok to do transparent auth to a proxy
+                                         * because we generally trust proxies (chosen by the user)
+                                         * But not in the case of 305 response where the server
+                             * chose it. */
+                            if (tryTransparentNTLMProxy && useProxyResponseCode) {
+                                tryTransparentNTLMProxy = false;
+                            }
+
                         }
                         a = null;
                         if (tryTransparentNTLMProxy) {
@@ -2610,6 +2620,10 @@
             requests.set(0, method + " " + getRequestURI()+" "  +
                              httpVersion, null);
             connected = true;
+            // need to remember this in case NTLM proxy authentication gets
+            // used. We can't use transparent authentication when user
+            // doesn't know about proxy.
+            useProxyResponseCode = true;
         } else {
             // maintain previous headers, just change the name
             // of the file we're getting
--- a/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java	Sat Jan 24 23:23:25 2015 -0800
@@ -192,22 +192,6 @@
         return userAgent;
     }
 
-    // should remove once HttpClient.newHttpProxy is putback
-    private static Proxy newHttpProxy(String proxyHost, int proxyPort) {
-        InetSocketAddress saddr = null;
-        final String phost = proxyHost;
-        final int pport = proxyPort < 0 ? httpsPortNumber : proxyPort;
-        try {
-            saddr = java.security.AccessController.doPrivileged(new
-                java.security.PrivilegedExceptionAction<InetSocketAddress>() {
-                public InetSocketAddress run() {
-                    return new InetSocketAddress(phost, pport);
-                }});
-        } catch (java.security.PrivilegedActionException pae) {
-        }
-        return new Proxy(Proxy.Type.HTTP, saddr);
-    }
-
     // CONSTRUCTOR, FACTORY
 
 
@@ -251,7 +235,7 @@
         throws IOException {
         this(sf, url,
              (proxyHost == null? null:
-                HttpsClient.newHttpProxy(proxyHost, proxyPort)),
+                HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
                 connectTimeout);
     }
 
@@ -261,6 +245,11 @@
     HttpsClient(SSLSocketFactory sf, URL url, Proxy proxy,
                 int connectTimeout)
         throws IOException {
+        PlatformLogger logger = HttpURLConnection.getHttpLogger();
+        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
+             logger.finest("Creating new HttpsClient with url:" + url + " and proxy:" + proxy +
+             " with connect timeout:" + connectTimeout);
+        }
         this.proxy = proxy;
         setSSLSocketFactory(sf);
         this.proxyDisabled = true;
@@ -317,7 +306,7 @@
 
         return HttpsClient.New(sf, url, hv,
                                (proxyHost == null? null :
-                                HttpsClient.newHttpProxy(proxyHost, proxyPort)),
+                                HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
                                useCache, connectTimeout, httpuc);
     }
 
@@ -329,6 +318,11 @@
         if (p == null) {
             p = Proxy.NO_PROXY;
         }
+        PlatformLogger logger = HttpURLConnection.getHttpLogger();
+        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
+            logger.finest("Looking for HttpClient for URL " + url +
+                " and proxy value of " + p);
+        }
         HttpsClient ret = null;
         if (useCache) {
             /* see if one's already around */
@@ -342,14 +336,13 @@
 
             if (ret != null) {
                 if ((ret.proxy != null && ret.proxy.equals(p)) ||
-                    (ret.proxy == null && p == null)) {
+                    (ret.proxy == null && p == Proxy.NO_PROXY)) {
                     synchronized (ret) {
                         ret.cachedHttpClient = true;
                         assert ret.inCache;
                         ret.inCache = false;
                         if (httpuc != null && ret.needsTunneling())
                             httpuc.setTunnelState(TUNNELING);
-                        PlatformLogger logger = HttpURLConnection.getHttpLogger();
                         if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                             logger.finest("KeepAlive stream retrieved from the cache, " + ret);
                         }
@@ -360,6 +353,9 @@
                     // This should be fine as it is very rare that a connection
                     // to the same host will not use the same proxy.
                     synchronized(ret) {
+                        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
+                            logger.finest("Not returning this connection to cache: " + ret);
+                        }
                         ret.inCache = false;
                         ret.closeServer();
                     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/sun/security/provider/FileInputStreamPool.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,159 @@
+/*
+ * 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.  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 sun.security.provider;
+
+import java.io.*;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * A pool of {@code InputStream}s opened from distinct files. Only a single
+ * instance is ever opened from the same file. This is used to read special
+ * infinite files like {@code /dev/random} where the current file pointer is not
+ * relevant, so multiple readers can share the same file descriptor and
+ * consequently the same {@code InputStream}.
+ */
+class FileInputStreamPool {
+
+    /**
+     * a pool of: StreamRef -> UnclosableInputStream -> FileInputStream(s)
+     */
+    private static final ConcurrentMap<File, StreamRef> pool =
+        new ConcurrentHashMap<>();
+
+    /**
+     * a reference queue of cleared StreamRef(s)
+     */
+    private static final ReferenceQueue<UnclosableInputStream> refQueue =
+        new ReferenceQueue<>();
+
+    /**
+     * This method opens an underlying {@link java.io.FileInputStream} for a
+     * given {@code file} and returns a wrapper over it. The wrapper is shared
+     * among multiple readers of the same {@code file} and ignores
+     * {@link java.io.InputStream#close()} requests. The underlying stream is
+     * closed when all references to the wrapper are relinquished.
+     *
+     * @param file the file to be opened for reading.
+     * @return a shared {@link java.io.InputStream} instance opened from given
+     * file.
+     * @throws FileNotFoundException if the file does not exist, is a directory
+     *                               rather than a regular file, or for some
+     *                               other reason cannot be opened for  reading.
+     * @throws SecurityException     if a security manager exists and its
+     *                               <code>checkRead</code> method denies read
+     *                               access to the file.
+     */
+    static InputStream getInputStream(File file) throws IOException {
+
+        // expunge any cleared references
+        StreamRef oldRref;
+        while ((oldRref = (StreamRef) refQueue.poll()) != null) {
+            pool.remove(oldRref.file, oldRref);
+        }
+
+        // canonicalize the path
+        // (this also checks the read permission on the file if SecurityManager
+        // is present, so no checking is needed later when we just return the
+        // already opened stream)
+        File cfile = file.getCanonicalFile();
+
+        // check if it exists in pool
+        oldRref = pool.get(cfile);
+        UnclosableInputStream oldStream = (oldRref == null)
+            ? null
+            : oldRref.get();
+        StreamRef newRef = null;
+        UnclosableInputStream newStream = null;
+
+        // retry loop
+        while (true) {
+            if (oldStream != null) {
+                // close our optimistically opened stream 1st (if we opened it)
+                if (newStream != null) {
+                    try {
+                        newStream.getWrappedStream().close();
+                    } catch (IOException ignore) {
+                        // can't do anything here
+                    }
+                }
+                // return it
+                return oldStream;
+            } else {
+                // we need to open new stream optimistically (if not already)
+                if (newStream == null) {
+                    newStream = new UnclosableInputStream(
+                        new FileInputStream(cfile));
+                    newRef = new StreamRef(cfile, newStream, refQueue);
+                }
+                // either try to install newRef or replace oldRef with newRef
+                if (oldRref == null) {
+                    oldRref = pool.putIfAbsent(cfile, newRef);
+                } else {
+                    oldRref = pool.replace(cfile, oldRref, newRef)
+                        ? null
+                        : pool.get(cfile);
+                }
+                if (oldRref == null) {
+                    // success
+                    return newStream;
+                } else {
+                    // lost race
+                    oldStream = oldRref.get();
+                    // another loop
+                }
+            }
+        }
+    }
+
+    private static class StreamRef extends WeakReference<UnclosableInputStream> {
+        final File file;
+
+        StreamRef(File file,
+                  UnclosableInputStream stream,
+                  ReferenceQueue<UnclosableInputStream> refQueue) {
+            super(stream, refQueue);
+            this.file = file;
+        }
+    }
+
+    private static final class UnclosableInputStream extends FilterInputStream {
+        UnclosableInputStream(InputStream in) {
+            super(in);
+        }
+
+        @Override
+        public void close() throws IOException {
+            // Ignore close attempts since underlying InputStream is shared.
+        }
+
+        InputStream getWrappedStream() {
+            return in;
+        }
+    }
+}
--- a/src/java.base/share/classes/sun/security/provider/SeedGenerator.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/provider/SeedGenerator.java	Sat Jan 24 23:23:25 2015 -0800
@@ -504,9 +504,10 @@
                         @Override
                         public InputStream run() throws IOException {
                             /*
-                             * return a FileInputStream for file URLs and
-                             * avoid buffering. The openStream() call wraps
-                             * InputStream in a BufferedInputStream which
+                             * return a shared InputStream for file URLs and
+                             * avoid buffering.
+                             * The URL.openStream() call wraps InputStream in a
+                             * BufferedInputStream which
                              * can buffer up to 8K bytes. This read is a
                              * performance issue for entropy sources which
                              * can be slow to replenish.
@@ -514,7 +515,8 @@
                             if (device.getProtocol().equalsIgnoreCase("file")) {
                                 File deviceFile =
                                     SunEntries.getDeviceFile(device);
-                                return new FileInputStream(deviceFile);
+                                return FileInputStreamPool
+                                    .getInputStream(deviceFile);
                             } else {
                                 return device.openStream();
                             }
--- a/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Sat Jan 24 23:23:25 2015 -0800
@@ -345,6 +345,13 @@
             break;
 
         case HandshakeMessage.ht_finished:
+            // A ChangeCipherSpec record must have been received prior to
+            // reception of the Finished message (RFC 5246, 7.4.9).
+            if (!receivedChangeCipherSpec()) {
+                fatalSE(Alerts.alert_handshake_failure,
+                    "Received Finished message before ChangeCipherSpec");
+            }
+
             this.serverFinished(
                 new Finished(protocolVersion, input, cipherSuite));
             break;
--- a/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -243,6 +243,7 @@
         protocolVersion = ProtocolVersion.valueOf(s.getInt8(), s.getInt8());
         clnt_random = new RandomCookie(s);
         sessionId = new SessionId(s.getBytes8());
+        sessionId.checkLength(protocolVersion);
         cipherSuites = new CipherSuiteList(s);
         compression_methods = s.getBytes8();
         if (messageLength() != messageLength) {
@@ -355,6 +356,7 @@
                                                   input.getInt8());
         svr_random = new RandomCookie(input);
         sessionId = new SessionId(input.getBytes8());
+        sessionId.checkLength(protocolVersion);
         cipherSuite = CipherSuite.valueOf(input.getInt8(), input.getInt8());
         compression_method = (byte)input.getInt8();
         if (messageLength() != messageLength) {
--- a/src/java.base/share/classes/sun/security/ssl/Handshaker.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/Handshaker.java	Sat Jan 24 23:23:25 2015 -0800
@@ -95,8 +95,6 @@
     Collection<SignatureAndHashAlgorithm> peerSupportedSignAlgs;
 
     /*
-
-    /*
      * List of active protocols
      *
      * Active protocols is a subset of enabled protocols, and will
@@ -114,10 +112,8 @@
     private CipherSuiteList    activeCipherSuites;
 
     // The server name indication and matchers
-    List<SNIServerName>         serverNames =
-                                    Collections.<SNIServerName>emptyList();
-    Collection<SNIMatcher>      sniMatchers =
-                                    Collections.<SNIMatcher>emptyList();
+    List<SNIServerName> serverNames = Collections.<SNIServerName>emptyList();
+    Collection<SNIMatcher> sniMatchers = Collections.<SNIMatcher>emptyList();
 
     private boolean             isClient;
     private boolean             needCertVerify;
@@ -139,12 +135,16 @@
     // current key exchange. Never null, initially K_NULL
     KeyExchange         keyExchange;
 
-    /* True if this session is being resumed (fast handshake) */
+    // True if this session is being resumed (fast handshake)
     boolean             resumingSession;
 
-    /* True if it's OK to start a new SSL session */
+    // True if it's OK to start a new SSL session
     boolean             enableNewSession;
 
+    // True if session keys have been calculated and the caller may receive
+    // and process a ChangeCipherSpec message
+    private boolean sessKeysCalculated;
+
     // Whether local cipher suites preference should be honored during
     // handshaking?
     //
@@ -253,6 +253,7 @@
         this.serverVerifyData = serverVerifyData;
         enableNewSession = true;
         invalidated = false;
+        sessKeysCalculated = false;
 
         setCipherSuite(CipherSuite.C_NULL);
         setEnabledProtocols(enabledProtocols);
@@ -359,6 +360,14 @@
         }
     }
 
+    final boolean receivedChangeCipherSpec() {
+        if (conn != null) {
+            return conn.receivedChangeCipherSpec();
+        } else {
+            return engine.receivedChangeCipherSpec();
+        }
+    }
+
     String getEndpointIdentificationAlgorithmSE() {
         SSLParameters paras;
         if (conn != null) {
@@ -491,7 +500,9 @@
 
         if (activeProtocols.collection().isEmpty() ||
                 activeProtocols.max.v == ProtocolVersion.NONE.v) {
-            throw new SSLHandshakeException("No appropriate protocol");
+            throw new SSLHandshakeException(
+                    "No appropriate protocol (protocol is disabled or " +
+                    "cipher suites are inappropriate)");
         }
 
         if (activeCipherSuites == null) {
@@ -676,6 +687,17 @@
                     continue;
                 }
 
+                if (!algorithmConstraints.permits(
+                        EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
+                        protocol.name, null)) {
+                    if (debug != null && Debug.isOn("verbose")) {
+                        System.out.println(
+                            "Ignoring disabled protocol: " + protocol);
+                    }
+
+                    continue;
+                }
+
                 boolean found = false;
                 for (CipherSuite suite : enabledCipherSuites.collection()) {
                     if (suite.isAvailable() && suite.obsoleted > protocol.v &&
@@ -1081,7 +1103,6 @@
         calculateConnectionKeys(master);
     }
 
-
     /*
      * Calculate the master secret from its various components.  This is
      * used for key exchange by all cipher suites.
@@ -1226,6 +1247,10 @@
             throw new ProviderException(e);
         }
 
+        // Mark a flag that allows outside entities (like SSLSocket/SSLEngine)
+        // determine if a ChangeCipherSpec message could be processed.
+        sessKeysCalculated = true;
+
         //
         // Dump the connection keys as they're generated.
         //
@@ -1280,6 +1305,15 @@
         }
     }
 
+    /**
+     * Return whether or not the Handshaker has derived session keys for
+     * this handshake.  This is used for determining readiness to process
+     * an incoming ChangeCipherSpec message.
+     */
+    boolean sessionKeysCalculated() {
+        return sessKeysCalculated;
+    }
+
     private static void printHex(HexDumpEncoder dump, byte[] bytes) {
         if (bytes == null) {
             System.out.println("(key bytes not available)");
--- a/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java	Sat Jan 24 23:23:25 2015 -0800
@@ -25,6 +25,9 @@
 
 package sun.security.ssl;
 
+import java.util.*;
+import java.security.CryptoPrimitive;
+
 /**
  * Type safe enum for an SSL/TLS protocol version. Instances are obtained
  * using the static factory methods or by referencing the static members
@@ -86,6 +89,11 @@
     // Default version for hello messages (SSLv2Hello)
     final static ProtocolVersion DEFAULT_HELLO = FIPS ? TLS10 : SSL30;
 
+    // Available protocols
+    //
+    // Including all supported protocols except the disabled ones.
+    final static Set<ProtocolVersion> availableProtocols;
+
     // version in 16 bit MSB format as it appears in records and
     // messages, i.e. 0x0301 for TLS 1.0
     public final int v;
@@ -96,6 +104,25 @@
     // name used in JSSE (e.g. TLSv1 for TLS 1.0)
     final String name;
 
+    // Initialize the available protocols.
+    static {
+        Set<ProtocolVersion> protocols = new HashSet<>(5);
+
+        ProtocolVersion[] pvs = new ProtocolVersion[] {
+                SSL20Hello, SSL30, TLS10, TLS11, TLS12};
+        EnumSet<CryptoPrimitive> cryptoPrimitives =
+            EnumSet.<CryptoPrimitive>of(CryptoPrimitive.KEY_AGREEMENT);
+        for (ProtocolVersion p : pvs) {
+            if (SSLAlgorithmConstraints.DEFAULT_SSL_ONLY.permits(
+                    cryptoPrimitives, p.name, null)) {
+                protocols.add(p);
+            }
+        }
+
+        availableProtocols =
+                Collections.<ProtocolVersion>unmodifiableSet(protocols);
+    }
+
     // private
     private ProtocolVersion(int v, String name) {
         this.v = v;
--- a/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, 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
@@ -55,6 +55,14 @@
 
     private boolean enabledX509DisabledAlgConstraints = true;
 
+    // the default algorithm constraints
+    final static AlgorithmConstraints DEFAULT =
+                        new SSLAlgorithmConstraints(null);
+
+    // the default SSL only algorithm constraints
+    final static AlgorithmConstraints DEFAULT_SSL_ONLY =
+                        new SSLAlgorithmConstraints((SSLSocket)null, false);
+
     SSLAlgorithmConstraints(AlgorithmConstraints algorithmConstraints) {
         userAlgConstraints = algorithmConstraints;
     }
--- a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -52,10 +52,6 @@
     private X509TrustManager trustManager;
     private SecureRandom secureRandom;
 
-    // The default algrithm constraints
-    private AlgorithmConstraints defaultAlgorithmConstraints =
-                                 new SSLAlgorithmConstraints(null);
-
     // supported and default protocols
     private ProtocolList defaultServerProtocolList;
     private ProtocolList defaultClientProtocolList;
@@ -350,7 +346,7 @@
                 if (suite.isAvailable() &&
                         suite.obsoleted > protocols.min.v &&
                         suite.supported <= protocols.max.v) {
-                    if (defaultAlgorithmConstraints.permits(
+                    if (SSLAlgorithmConstraints.DEFAULT.permits(
                             EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                             suite.name, null)) {
                         suites.add(suite);
@@ -431,11 +427,16 @@
      */
     private abstract static class AbstractSSLContext extends SSLContextImpl {
         // parameters
-        private final static SSLParameters defaultServerSSLParams;
-        private final static SSLParameters supportedSSLParams;
+        private static final SSLParameters defaultServerSSLParams;
+        private static final SSLParameters supportedSSLParams;
 
         static {
+            // supported SSL parameters
             supportedSSLParams = new SSLParameters();
+
+            // candidates for available protocols
+            ProtocolVersion[] candidates;
+
             if (SunJSSE.isFIPS()) {
                 supportedSSLParams.setProtocols(new String[] {
                     ProtocolVersion.TLS10.name,
@@ -443,7 +444,11 @@
                     ProtocolVersion.TLS12.name
                 });
 
-                defaultServerSSLParams = supportedSSLParams;
+                candidates = new ProtocolVersion[] {
+                    ProtocolVersion.TLS10,
+                    ProtocolVersion.TLS11,
+                    ProtocolVersion.TLS12
+                };
             } else {
                 supportedSSLParams.setProtocols(new String[] {
                     ProtocolVersion.SSL20Hello.name,
@@ -453,8 +458,18 @@
                     ProtocolVersion.TLS12.name
                 });
 
-                defaultServerSSLParams = supportedSSLParams;
+                candidates = new ProtocolVersion[] {
+                    ProtocolVersion.SSL20Hello,
+                    ProtocolVersion.SSL30,
+                    ProtocolVersion.TLS10,
+                    ProtocolVersion.TLS11,
+                    ProtocolVersion.TLS12
+                };
             }
+
+            defaultServerSSLParams = new SSLParameters();
+            defaultServerSSLParams.setProtocols(
+                    getAvailableProtocols(candidates));
         }
 
         @Override
@@ -466,6 +481,22 @@
         SSLParameters getSupportedSSLParams() {
             return supportedSSLParams;
         }
+
+        static String[] getAvailableProtocols(
+                ProtocolVersion[] protocolCandidates) {
+
+            List<String> availableProtocols = Collections.<String>emptyList();
+            if (protocolCandidates !=  null && protocolCandidates.length != 0) {
+                availableProtocols = new ArrayList<>(protocolCandidates.length);
+                for (ProtocolVersion p : protocolCandidates) {
+                    if (ProtocolVersion.availableProtocols.contains(p)) {
+                        availableProtocols.add(p.name);
+                    }
+                }
+            }
+
+            return availableProtocols.toArray(new String[0]);
+        }
     }
 
     /*
@@ -474,21 +505,25 @@
      * @see SSLContext
      */
     public static final class TLS10Context extends AbstractSSLContext {
-        private final static SSLParameters defaultClientSSLParams;
+        private static final SSLParameters defaultClientSSLParams;
 
         static {
+            // candidates for available protocols
+            ProtocolVersion[] candidates;
+            if (SunJSSE.isFIPS()) {
+                candidates = new ProtocolVersion[] {
+                    ProtocolVersion.TLS10
+                };
+            } else {
+                candidates = new ProtocolVersion[] {
+                    ProtocolVersion.SSL30,
+                    ProtocolVersion.TLS10
+                };
+            }
+
             defaultClientSSLParams = new SSLParameters();
-            if (SunJSSE.isFIPS()) {
-                defaultClientSSLParams.setProtocols(new String[] {
-                    ProtocolVersion.TLS10.name
-                });
-
-            } else {
-                defaultClientSSLParams.setProtocols(new String[] {
-                    ProtocolVersion.SSL30.name,
-                    ProtocolVersion.TLS10.name
-                });
-            }
+            defaultClientSSLParams.setProtocols(
+                    getAvailableProtocols(candidates));
         }
 
         @Override
@@ -503,23 +538,27 @@
      * @see SSLContext
      */
     public static final class TLS11Context extends AbstractSSLContext {
-        private final static SSLParameters defaultClientSSLParams;
+        private static final SSLParameters defaultClientSSLParams;
 
         static {
+            // candidates for available protocols
+            ProtocolVersion[] candidates;
+            if (SunJSSE.isFIPS()) {
+                candidates = new ProtocolVersion[] {
+                    ProtocolVersion.TLS10,
+                    ProtocolVersion.TLS11
+                };
+            } else {
+                candidates = new ProtocolVersion[] {
+                    ProtocolVersion.SSL30,
+                    ProtocolVersion.TLS10,
+                    ProtocolVersion.TLS11
+                };
+            }
+
             defaultClientSSLParams = new SSLParameters();
-            if (SunJSSE.isFIPS()) {
-                defaultClientSSLParams.setProtocols(new String[] {
-                    ProtocolVersion.TLS10.name,
-                    ProtocolVersion.TLS11.name
-                });
-
-            } else {
-                defaultClientSSLParams.setProtocols(new String[] {
-                    ProtocolVersion.SSL30.name,
-                    ProtocolVersion.TLS10.name,
-                    ProtocolVersion.TLS11.name
-                });
-            }
+            defaultClientSSLParams.setProtocols(
+                    getAvailableProtocols(candidates));
         }
 
         @Override
@@ -534,25 +573,29 @@
      * @see SSLContext
      */
     public static final class TLS12Context extends AbstractSSLContext {
-        private final static SSLParameters defaultClientSSLParams;
+        private static final SSLParameters defaultClientSSLParams;
 
         static {
+            // candidates for available protocols
+            ProtocolVersion[] candidates;
+            if (SunJSSE.isFIPS()) {
+                candidates = new ProtocolVersion[] {
+                    ProtocolVersion.TLS10,
+                    ProtocolVersion.TLS11,
+                    ProtocolVersion.TLS12
+                };
+            } else {
+                candidates = new ProtocolVersion[] {
+                    ProtocolVersion.SSL30,
+                    ProtocolVersion.TLS10,
+                    ProtocolVersion.TLS11,
+                    ProtocolVersion.TLS12
+                };
+            }
+
             defaultClientSSLParams = new SSLParameters();
-            if (SunJSSE.isFIPS()) {
-                defaultClientSSLParams.setProtocols(new String[] {
-                    ProtocolVersion.TLS10.name,
-                    ProtocolVersion.TLS11.name,
-                    ProtocolVersion.TLS12.name
-                });
-
-            } else {
-                defaultClientSSLParams.setProtocols(new String[] {
-                    ProtocolVersion.SSL30.name,
-                    ProtocolVersion.TLS10.name,
-                    ProtocolVersion.TLS11.name,
-                    ProtocolVersion.TLS12.name
-                });
-            }
+            defaultClientSSLParams.setProtocols(
+                    getAvailableProtocols(candidates));
         }
 
         @Override
@@ -567,8 +610,8 @@
      * @see SSLContext
      */
     private static class CustomizedSSLContext extends AbstractSSLContext {
-        private final static String PROPERTY_NAME = "jdk.tls.client.protocols";
-        private final static SSLParameters defaultClientSSLParams;
+        private static final String PROPERTY_NAME = "jdk.tls.client.protocols";
+        private static final SSLParameters defaultClientSSLParams;
         private static IllegalArgumentException reservedException = null;
 
         // Don't want a java.lang.LinkageError for illegal system property.
@@ -578,60 +621,74 @@
         // the provider service. Instead, let's handle the initialization
         // exception in constructor.
         static {
+            // candidates for available protocols
+            ProtocolVersion[] candidates;
+
             String property = AccessController.doPrivileged(
                     new GetPropertyAction(PROPERTY_NAME));
-            defaultClientSSLParams = new SSLParameters();
             if (property == null || property.length() == 0) {
                 // the default enabled client TLS protocols
                 if (SunJSSE.isFIPS()) {
-                    defaultClientSSLParams.setProtocols(new String[] {
-                        ProtocolVersion.TLS10.name,
-                        ProtocolVersion.TLS11.name,
-                        ProtocolVersion.TLS12.name
-                    });
-
+                    candidates = new ProtocolVersion[] {
+                        ProtocolVersion.TLS10,
+                        ProtocolVersion.TLS11,
+                        ProtocolVersion.TLS12
+                    };
                 } else {
-                    defaultClientSSLParams.setProtocols(new String[] {
-                        ProtocolVersion.SSL30.name,
-                        ProtocolVersion.TLS10.name,
-                        ProtocolVersion.TLS11.name,
-                        ProtocolVersion.TLS12.name
-                    });
+                    candidates = new ProtocolVersion[] {
+                        ProtocolVersion.SSL30,
+                        ProtocolVersion.TLS10,
+                        ProtocolVersion.TLS11,
+                        ProtocolVersion.TLS12
+                    };
                 }
             } else {
                 // remove double quote marks from beginning/end of the property
-                if (property.charAt(0) == '"' &&
+                if (property.length() > 1 && property.charAt(0) == '"' &&
                         property.charAt(property.length() - 1) == '"') {
                     property = property.substring(1, property.length() - 1);
                 }
 
-                String[] protocols = property.split(",");
+                String[] protocols = null;
+                if (property != null && property.length() != 0) {
+                    protocols = property.split(",");
+                } else {
+                    reservedException = new IllegalArgumentException(
+                        "No protocol specified in " +
+                        PROPERTY_NAME + " system property");
+                    protocols = new String[0];
+                }
+
+                candidates = new ProtocolVersion[protocols.length];
                 for (int i = 0; i < protocols.length; i++) {
                     protocols[i] = protocols[i].trim();
                     // Is it a supported protocol name?
                     try {
-                        ProtocolVersion.valueOf(protocols[i]);
+                        candidates[i] = ProtocolVersion.valueOf(protocols[i]);
                     } catch (IllegalArgumentException iae) {
                         reservedException = new IllegalArgumentException(
-                                PROPERTY_NAME + ": " + protocols[i] +
-                                " is not a standard SSL protocol name", iae);
+                            PROPERTY_NAME + ": " + protocols[i] +
+                            " is not a standard SSL/TLS protocol name", iae);
+                        break;
                     }
                 }
 
                 if ((reservedException == null) && SunJSSE.isFIPS()) {
-                    for (String protocol : protocols) {
-                        if (ProtocolVersion.SSL20Hello.name.equals(protocol) ||
-                                ProtocolVersion.SSL30.name.equals(protocol)) {
+                    for (ProtocolVersion protocolVersion : candidates) {
+                        if (ProtocolVersion.SSL20Hello.v == protocolVersion.v ||
+                                ProtocolVersion.SSL30.v == protocolVersion.v) {
                             reservedException = new IllegalArgumentException(
-                                    PROPERTY_NAME + ": " + protocol +
+                                    PROPERTY_NAME + ": " + protocolVersion +
                                     " is not FIPS compliant");
                         }
                     }
                 }
+            }
 
-                if (reservedException == null) {
-                    defaultClientSSLParams.setProtocols(protocols);
-               }
+            defaultClientSSLParams = new SSLParameters();
+            if (reservedException == null) {
+                defaultClientSSLParams.setProtocols(
+                        getAvailableProtocols(candidates));
             }
         }
 
--- a/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -212,6 +212,11 @@
     static final byte           clauth_required = 2;
 
     /*
+     * Flag indicating that the engine has received a ChangeCipherSpec message.
+     */
+    private boolean             receivedCCS;
+
+    /*
      * Flag indicating if the next record we receive MUST be a Finished
      * message. Temporarily set during the handshake to ensure that
      * a change cipher spec message is followed by a finished message.
@@ -372,6 +377,7 @@
          */
         roleIsServer = true;
         connectionState = cs_START;
+        receivedCCS = false;
 
         // default server name indication
         serverNames =
@@ -1021,6 +1027,7 @@
 
                     if (handshaker.invalidated) {
                         handshaker = null;
+                        receivedCCS = false;
                         // if state is cs_RENEGOTIATE, revert it to cs_DATA
                         if (connectionState == cs_RENEGOTIATE) {
                             connectionState = cs_DATA;
@@ -1039,6 +1046,7 @@
                         }
                         handshaker = null;
                         connectionState = cs_DATA;
+                        receivedCCS = false;
 
                         // No handshakeListeners here.  That's a
                         // SSLSocket thing.
@@ -1078,13 +1086,25 @@
                 case Record.ct_change_cipher_spec:
                     if ((connectionState != cs_HANDSHAKE
                                 && connectionState != cs_RENEGOTIATE)
-                            || inputRecord.available() != 1
+                            || !handshaker.sessionKeysCalculated()
+                            || receivedCCS) {
+                        // For the CCS message arriving in the wrong state
+                        fatal(Alerts.alert_unexpected_message,
+                                "illegal change cipher spec msg, conn state = "
+                                + connectionState + ", handshake state = "
+                                + handshaker.state);
+                    } else if (inputRecord.available() != 1
                             || inputRecord.read() != 1) {
+                        // For structural/content issues with the CCS
                         fatal(Alerts.alert_unexpected_message,
-                            "illegal change cipher spec msg, state = "
-                            + connectionState);
+                                "Malformed change cipher spec msg");
                     }
 
+                    // Once we've received CCS, update the flag.
+                    // If the remote endpoint sends it again in this handshake
+                    // we won't process it.
+                    receivedCCS = true;
+
                     //
                     // The first message after a change_cipher_spec
                     // record MUST be a "Finished" handshake record,
@@ -2121,6 +2141,14 @@
     }
 
     /**
+     * Returns a boolean indicating whether the ChangeCipherSpec message
+     * has been received for this handshake.
+     */
+    boolean receivedChangeCipherSpec() {
+        return receivedCCS;
+    }
+
+    /**
      * Returns a printable representation of this end of the connection.
      */
     @Override
--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Sat Jan 24 23:23:25 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
@@ -172,6 +172,12 @@
     private volatile int        connectionState;
 
     /*
+     * Flag indicating that the engine's handshaker has done the necessary
+     * steps so the engine may process a ChangeCipherSpec message.
+     */
+    private boolean             receivedCCS;
+
+    /*
      * Flag indicating if the next record we receive MUST be a Finished
      * message. Temporarily set during the handshake to ensure that
      * a change cipher spec message is followed by a finished message.
@@ -587,6 +593,7 @@
          */
         roleIsServer = isServer;
         connectionState = cs_START;
+        receivedCCS = false;
 
         /*
          * default read and write side cipher and MAC support
@@ -1045,6 +1052,7 @@
 
                     if (handshaker.invalidated) {
                         handshaker = null;
+                        receivedCCS = false;
                         // if state is cs_RENEGOTIATE, revert it to cs_DATA
                         if (connectionState == cs_RENEGOTIATE) {
                             connectionState = cs_DATA;
@@ -1060,6 +1068,7 @@
                         handshakeSession = null;
                         handshaker = null;
                         connectionState = cs_DATA;
+                        receivedCCS = false;
 
                         //
                         // Tell folk about handshake completion, but do
@@ -1107,13 +1116,24 @@
                 case Record.ct_change_cipher_spec:
                     if ((connectionState != cs_HANDSHAKE
                                 && connectionState != cs_RENEGOTIATE)
-                            || r.available() != 1
-                            || r.read() != 1) {
+                            || !handshaker.sessionKeysCalculated()
+                            || receivedCCS) {
+                        // For the CCS message arriving in the wrong state
                         fatal(Alerts.alert_unexpected_message,
-                            "illegal change cipher spec msg, state = "
-                            + connectionState);
+                                "illegal change cipher spec msg, conn state = "
+                                + connectionState + ", handshake state = "
+                                + handshaker.state);
+                    } else if (r.available() != 1 || r.read() != 1) {
+                        // For structural/content issues with the CCS
+                        fatal(Alerts.alert_unexpected_message,
+                                "Malformed change cipher spec msg");
                     }
 
+                    // Once we've received CCS, update the flag.
+                    // If the remote endpoint sends it again in this handshake
+                    // we won't process it.
+                    receivedCCS = true;
+
                     //
                     // The first message after a change_cipher_spec
                     // record MUST be a "Finished" handshake record,
@@ -2590,6 +2610,14 @@
     }
 
     /**
+     * Returns a boolean indicating whether the ChangeCipherSpec message
+     * has been received for this handshake.
+     */
+    boolean receivedChangeCipherSpec() {
+        return receivedCCS;
+    }
+
+    /**
      * Returns a printable representation of this end of the connection.
      */
     @Override
--- a/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java	Sat Jan 24 23:23:25 2015 -0800
@@ -287,6 +287,13 @@
                 break;
 
             case HandshakeMessage.ht_finished:
+                // A ChangeCipherSpec record must have been received prior to
+                // reception of the Finished message (RFC 5246, 7.4.9).
+                if (!receivedChangeCipherSpec()) {
+                    fatalSE(Alerts.alert_handshake_failure,
+                        "Received Finished message before ChangeCipherSpec");
+                }
+
                 this.clientFinished(
                     new Finished(protocolVersion, input, cipherSuite));
                 break;
--- a/src/java.base/share/classes/sun/security/ssl/SessionId.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SessionId.java	Sat Jan 24 23:23:25 2015 -0800
@@ -27,6 +27,7 @@
 package sun.security.ssl;
 
 import java.security.SecureRandom;
+import javax.net.ssl.SSLProtocolException;
 
 /**
  * Encapsulates an SSL session ID.  SSL Session IDs are not reused by
@@ -41,6 +42,7 @@
 final
 class SessionId
 {
+    static int MAX_LENGTH = 32;
     private byte sessionId [];          // max 32 bytes
 
     /** Constructs a new session ID ... perhaps for a rejoinable session */
@@ -114,4 +116,19 @@
         }
         return true;
     }
+
+    /**
+     * Checks the length of the session ID to make sure it sits within
+     * the range called out in the specification
+     */
+    void checkLength(ProtocolVersion pv) throws SSLProtocolException {
+        // As of today all versions of TLS have a 32-byte maximum length.
+        // In the future we can do more here to support protocol versions
+        // that may have longer max lengths.
+        if (sessionId.length > MAX_LENGTH) {
+            throw new SSLProtocolException("Invalid session ID length (" +
+                    sessionId.length + " bytes)");
+        }
+    }
+
 }
--- a/src/java.base/share/classes/sun/security/util/DerIndefLenConverter.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/util/DerIndefLenConverter.java	Sat Jan 24 23:23:25 2015 -0800
@@ -156,12 +156,18 @@
         }
         if (isLongForm(lenByte)) {
             lenByte &= LEN_MASK;
-            if (lenByte > 4)
+            if (lenByte > 4) {
                 throw new IOException("Too much data");
-            if ((dataSize - dataPos) < (lenByte + 1))
+            }
+            if ((dataSize - dataPos) < (lenByte + 1)) {
                 throw new IOException("Too little data");
-            for (int i = 0; i < lenByte; i++)
+            }
+            for (int i = 0; i < lenByte; i++) {
                 curLen = (curLen << 8) + (data[dataPos++] & 0xff);
+            }
+            if (curLen < 0) {
+                throw new IOException("Invalid length bytes");
+            }
         } else {
            curLen = (lenByte & LEN_MASK);
         }
@@ -188,10 +194,15 @@
         }
         if (isLongForm(lenByte)) {
             lenByte &= LEN_MASK;
-            for (int i = 0; i < lenByte; i++)
+            for (int i = 0; i < lenByte; i++) {
                 curLen = (curLen << 8) + (data[dataPos++] & 0xff);
-        } else
+            }
+            if (curLen < 0) {
+                throw new IOException("Invalid length bytes");
+            }
+        } else {
             curLen = (lenByte & LEN_MASK);
+        }
         writeLength(curLen);
         writeValue(curLen);
     }
--- a/src/java.base/share/classes/sun/security/util/DerInputStream.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/classes/sun/security/util/DerInputStream.java	Sat Jan 24 23:23:25 2015 -0800
@@ -577,6 +577,10 @@
                 value <<= 8;
                 value += 0x0ff & in.read();
             }
+            if (value < 0) {
+                throw new IOException("DerInputStream.getLength(): "
+                        + "Invalid length bytes");
+            }
         }
         return value;
     }
--- a/src/java.base/share/conf/security/java.security	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/share/conf/security/java.security	Sat Jan 24 23:23:25 2015 -0800
@@ -512,8 +512,12 @@
 #
 # In some environments, certain algorithms or key lengths may be undesirable
 # when using SSL/TLS.  This section describes the mechanism for disabling
-# algorithms during SSL/TLS security parameters negotiation, including cipher
-# suites selection, peer authentication and key exchange mechanisms.
+# algorithms during SSL/TLS security parameters negotiation, including
+# protocol version negotiation, cipher suites selection, peer authentication
+# and key exchange mechanisms.
+#
+# Disabled algorithms will not be negotiated for SSL/TLS connections, even
+# if they are enabled explicitly in an application.
 #
 # For PKI-based peer authentication and key exchange mechanisms, this list
 # of disabled algorithms will also be checked during certification path
@@ -528,4 +532,5 @@
 # It is not guaranteed to be examined and used by other implementations.
 #
 # Example:
-#   jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048
+#   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
+jdk.tls.disabledAlgorithms=SSLv3
--- a/src/java.base/unix/classes/java/lang/ClassLoaderHelper.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/unix/classes/java/lang/ClassLoaderHelper.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -31,6 +31,11 @@
     private ClassLoaderHelper() {}
 
     /**
+     * Indicates, whether PATH env variable is allowed to contain quoted entries.
+     */
+    static final boolean allowsQuotedPathElements = false;
+
+    /**
      * Returns an alternate path name for the given file
      * such that if the original pathname did not exist, then the
      * file may be located at the alternate location.
--- a/src/java.base/unix/classes/sun/security/provider/NativePRNG.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/unix/classes/sun/security/provider/NativePRNG.java	Sat Jan 24 23:23:25 2015 -0800
@@ -371,8 +371,8 @@
         // constructor, called only once from initIO()
         private RandomIO(File seedFile, File nextFile) throws IOException {
             this.seedFile = seedFile;
-            seedIn = new FileInputStream(seedFile);
-            nextIn = new FileInputStream(nextFile);
+            seedIn = FileInputStreamPool.getInputStream(seedFile);
+            nextIn = FileInputStreamPool.getInputStream(nextFile);
             nextBuffer = new byte[BUFFER_SIZE];
         }
 
--- a/src/java.base/unix/native/libnet/NetworkInterface.c	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/unix/native/libnet/NetworkInterface.c	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -274,7 +274,6 @@
     if (index <= 0) {
         return NULL;
     }
-
     ifs = enumInterfaces(env);
     if (ifs == NULL) {
         return NULL;
@@ -551,9 +550,14 @@
     jboolean isCopy;
     int ret = -1;
     int sock;
-    const char* name_utf;
+    const char* name_utf = NULL;
 
-    name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+    if (name != NULL) {
+        name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+    } else {
+        JNU_ThrowNullPointerException(env, "network interface name is NULL");
+        return ret;
+    }
     if (name_utf == NULL) {
        if (!(*env)->ExceptionCheck(env))
            JNU_ThrowOutOfMemoryError(env, NULL);
@@ -581,7 +585,13 @@
     const char* name_utf;
     int flags = 0;
 
-    name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+    if (name != NULL) {
+        name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+    } else {
+        JNU_ThrowNullPointerException(env, "network interface name is NULL");
+        return -1;
+    }
+
     if (name_utf == NULL) {
        if (!(*env)->ExceptionCheck(env))
            JNU_ThrowOutOfMemoryError(env, NULL);
@@ -1063,6 +1073,7 @@
  */
 
 #ifdef AF_INET6
+// unused arg ifname and struct if2
 static int openSocketWithFallback(JNIEnv *env, const char *ifname){
     int sock;
     struct ifreq if2;
@@ -1453,9 +1464,14 @@
 
 static int getMTU(JNIEnv *env, int sock,  const char *ifname) {
     struct ifreq if2;
+    memset((char *) &if2, 0, sizeof(if2));
 
-    memset((char *) &if2, 0, sizeof(if2));
-    strcpy(if2.ifr_name, ifname);
+    if (ifname != NULL) {
+        strcpy(if2.ifr_name, ifname);
+    } else {
+        JNU_ThrowNullPointerException(env, "network interface name is NULL");
+        return -1;
+    }
 
     if (ioctl(sock, SIOCGIFMTU, (char *)&if2) < 0) {
         NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFMTU failed");
--- a/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -62,7 +62,6 @@
 #include "jvm.h"
 #include "jni_util.h"
 #include "net_util.h"
-
 #include "java_net_SocketOptions.h"
 #include "java_net_PlainDatagramSocketImpl.h"
 #include "java_net_NetworkInterface.h"
@@ -83,6 +82,7 @@
 extern void setDefaultScopeID(JNIEnv *env, struct sockaddr *him);
 extern int getDefaultScopeID(JNIEnv *env);
 
+
 /*
  * Returns a java.lang.Integer based on 'i'
  */
@@ -1447,10 +1447,12 @@
         static jmethodID ni_ctrID;
         static jfieldID ni_indexID;
         static jfieldID ni_addrsID;
+        static jfieldID ni_nameID;
 
         jobjectArray addrArray;
         jobject addr;
         jobject ni;
+        jobject ni_name;
 
         struct in_addr in;
         struct in_addr *inP = &in;
@@ -1500,6 +1502,8 @@
             ni_addrsID = (*env)->GetFieldID(env, c, "addrs",
                                             "[Ljava/net/InetAddress;");
             CHECK_NULL_RETURN(ni_addrsID, NULL);
+            ni_nameID = (*env)->GetFieldID(env, c,"name", "Ljava/lang/String;");
+            CHECK_NULL_RETURN(ni_nameID, NULL);
             ni_class = (*env)->NewGlobalRef(env, c);
             CHECK_NULL_RETURN(ni_class, NULL);
         }
@@ -1521,6 +1525,10 @@
         CHECK_NULL_RETURN(addrArray, NULL);
         (*env)->SetObjectArrayElement(env, addrArray, 0, addr);
         (*env)->SetObjectField(env, ni, ni_addrsID, addrArray);
+        ni_name = (*env)->NewStringUTF(env, "");
+        if (ni_name != NULL) {
+            (*env)->SetObjectField(env, ni, ni_nameID, ni_name);
+        }
         return ni;
     }
 
@@ -1537,14 +1545,16 @@
         static jfieldID ni_indexID;
         static jfieldID ni_addrsID;
         static jclass ia_class;
+        static jfieldID ni_nameID;
         static jmethodID ia_anyLocalAddressID;
 
-        int index;
+        int index = 0;
         socklen_t len = sizeof(index);
 
         jobjectArray addrArray;
         jobject addr;
         jobject ni;
+        jobject ni_name;
 
         if (getsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
                        (char*)&index, &len) < 0) {
@@ -1573,6 +1583,8 @@
                                                              "anyLocalAddress",
                                                              "()Ljava/net/InetAddress;");
             CHECK_NULL_RETURN(ia_anyLocalAddressID, NULL);
+            ni_nameID = (*env)->GetFieldID(env, c,"name", "Ljava/lang/String;");
+            CHECK_NULL_RETURN(ni_nameID, NULL);
             ni_class = (*env)->NewGlobalRef(env, c);
             CHECK_NULL_RETURN(ni_class, NULL);
         }
@@ -1633,6 +1645,10 @@
         CHECK_NULL_RETURN(addrArray, NULL);
         (*env)->SetObjectArrayElement(env, addrArray, 0, addr);
         (*env)->SetObjectField(env, ni, ni_addrsID, addrArray);
+        ni_name = (*env)->NewStringUTF(env, "");
+        if (ni_name != NULL) {
+            (*env)->SetObjectField(env, ni, ni_nameID, ni_name);
+        }
         return ni;
     }
 #endif
--- a/src/java.base/windows/classes/java/lang/ClassLoaderHelper.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/windows/classes/java/lang/ClassLoaderHelper.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -31,6 +31,11 @@
     private ClassLoaderHelper() {}
 
     /**
+     * Indicates, whether PATH env variable is allowed to contain quoted entries.
+     */
+    static final boolean allowsQuotedPathElements = true;
+
+    /**
      * Returns an alternate path name for the given file
      * such that if the original pathname did not exist, then the
      * file may be located at the alternate location.
--- a/src/java.base/windows/native/libjava/ProcessImpl_md.c	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.base/windows/native/libjava/ProcessImpl_md.c	Sat Jan 24 23:23:25 2015 -0800
@@ -283,14 +283,10 @@
         FALSE, FALSE, FALSE,
         FALSE, FALSE, FALSE};
 
-    {
-        /* Extraction of current process standard IOE handles */
-        DWORD idsIOE[3] = {STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, STD_ERROR_HANDLE};
-        int i;
-        for (i = 0; i < 3; ++i)
-            /* Should not be closed by CloseHandle! */
-            stdIOE[i] = GetStdHandle(idsIOE[i]);
-    }
+    /* These three should not be closed by CloseHandle! */
+    stdIOE[0] = GetStdHandle(STD_INPUT_HANDLE);
+    stdIOE[1] = GetStdHandle(STD_OUTPUT_HANDLE);
+    stdIOE[2] = GetStdHandle(STD_ERROR_HANDLE);
 
     prepareIOEHandleState(stdIOE, inherit);
     {
@@ -319,11 +315,16 @@
 
                 if (success) {
                     PROCESS_INFORMATION pi;
-                    DWORD processFlag = CREATE_UNICODE_ENVIRONMENT;
+                    DWORD processFlag = CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT;
 
-                    /* Suppress popping-up of a console window for non-console applications */
-                    if (GetConsoleWindow() == NULL)
-                        processFlag |= CREATE_NO_WINDOW;
+                    /* If the standard I/O is inherited, CREATE_NO_WINDOW must not be used. */
+                    if (GetConsoleWindow() != NULL &&
+                        (si.hStdInput  == stdIOE[0] ||
+                         si.hStdOutput == stdIOE[1] ||
+                         si.hStdError  == (redirectErrorStream ? stdIOE[1] : stdIOE[2])))
+                    {
+                        processFlag &= ~CREATE_NO_WINDOW;
+                    }
 
                     si.dwFlags = STARTF_USESTDHANDLES;
                     if (!CreateProcessW(
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsButtonUI.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsButtonUI.java	Sat Jan 24 23:23:25 2015 -0800
@@ -248,7 +248,8 @@
 
         Part part = getXPButtonType(b);
 
-        if (b.isContentAreaFilled() && xp != null) {
+        if (b.isContentAreaFilled() && b.getBorder() != null
+                && b.isBorderPainted() && xp != null) {
 
             Skin skin = xp.getSkin(b, part);
 
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1081,16 +1081,9 @@
 
             directories.clear();
 
-            File[] baseFolders;
-            if (useShellFolder) {
-                baseFolders = AccessController.doPrivileged(new PrivilegedAction<File[]>() {
-                    public File[] run() {
-                        return (File[]) ShellFolder.get("fileChooserComboBoxFolders");
-                    }
-                });
-            } else {
-                baseFolders = fsv.getRoots();
-            }
+            File[] baseFolders = (useShellFolder)
+                    ? (File[]) ShellFolder.get("fileChooserComboBoxFolders")
+                    : fsv.getRoots();
             directories.addAll(Arrays.asList(baseFolders));
 
             // Get the canonical (full) path. This has the side
--- a/src/java.desktop/share/classes/java/beans/package.html	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/java/beans/package.html	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 <!--
- Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1998, 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
@@ -147,8 +147,8 @@
 
 For overview, architecture, and tutorial documentation, please see:
 <ul>
-  <li><a href="http://java.sun.com/docs/books/tutorial/javabeans/">JavaBeans</a>, a trail in <em>The Java Tutorial</em>.
-  <li><a href="http://java.sun.com/products/jfc/tsc/articles/persistence2/">Long-Term Persistence</a>, an article in <em>The Swing Connection</em>.
+  <li><a href="http://docs.oracle.com/javase/tutorial/javabeans/">JavaBeans</a>, a trail in <em>The Java Tutorial</em>.
+  <li><a href="http://www.oracle.com/technetwork/java/persistence2-141443.html">Long-Term Persistence</a>, an article in <em>The Swing Connection</em>.
 </ul>
 
 </body>
--- a/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Sat Jan 24 23:23:25 2015 -0800
@@ -28,6 +28,7 @@
 
 import java.awt.event.*;
 import java.awt.*;
+import java.util.Objects;
 
 /**
  * Manages all the <code>ToolTips</code> in the system.
@@ -476,8 +477,8 @@
                             preferredLocation.equals(newPreferredLocation) :
                             (newPreferredLocation == null);
 
-                if (!sameComponent || !toolTipText.equals(newToolTipText) ||
-                         !sameLoc) {
+                if (!sameComponent || !Objects.equals(toolTipText, newToolTipText)
+                        || !sameLoc) {
                     toolTipText = newToolTipText;
                     preferredLocation = newPreferredLocation;
                     showTipWindow();
--- a/src/java.desktop/share/classes/javax/swing/UIDefaults.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/javax/swing/UIDefaults.java	Sat Jan 24 23:23:25 2015 -0800
@@ -44,9 +44,7 @@
 import java.awt.Color;
 import java.awt.Insets;
 import java.awt.Dimension;
-import java.lang.reflect.Method;
 import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeEvent;
 import java.security.AccessController;
 import java.security.AccessControlContext;
 import java.security.PrivilegedAction;
@@ -76,7 +74,7 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class UIDefaults extends Hashtable<Object,Object>
 {
-    private static final Object PENDING = "Pending";
+    private static final Object PENDING = new Object();
 
     private SwingPropertyChangeSupport changeSupport;
 
@@ -170,7 +168,7 @@
      * Looks up the given key in our Hashtable and resolves LazyValues
      * or ActiveValues.
      */
-    private Object getFromHashtable(Object key) {
+    private Object getFromHashtable(final Object key) {
         /* Quickly handle the common case, without grabbing
          * a lock.
          */
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1020,16 +1020,9 @@
 
             directories.clear();
 
-            File[] baseFolders;
-            if (useShellFolder) {
-                baseFolders = AccessController.doPrivileged(new PrivilegedAction<File[]>() {
-                    public File[] run() {
-                        return (File[]) ShellFolder.get("fileChooserComboBoxFolders");
-                    }
-                });
-            } else {
-                baseFolders = fsv.getRoots();
-            }
+            File[] baseFolders = (useShellFolder)
+                    ? (File[]) ShellFolder.get("fileChooserComboBoxFolders")
+                    : fsv.getRoots();
             directories.addAll(Arrays.asList(baseFolders));
 
             // Get the canonical (full) path. This has the side
--- a/src/java.desktop/share/classes/sun/swing/FilePane.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/sun/swing/FilePane.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1993,20 +1993,24 @@
             return false;
         }
 
-        if (f instanceof ShellFolder) {
-            return f.canWrite();
-        } else {
-            if (usesShellFolder(getFileChooser())) {
-                try {
-                    return ShellFolder.getShellFolder(f).canWrite();
-                } catch (FileNotFoundException ex) {
-                    // File doesn't exist
-                    return false;
+        try {
+            if (f instanceof ShellFolder) {
+                return f.canWrite();
+            } else {
+                if (usesShellFolder(getFileChooser())) {
+                    try {
+                        return ShellFolder.getShellFolder(f).canWrite();
+                    } catch (FileNotFoundException ex) {
+                        // File doesn't exist
+                        return false;
+                    }
+                } else {
+                    // Ordinary file
+                    return f.canWrite();
                 }
-            } else {
-                // Ordinary file
-                return f.canWrite();
             }
+        } catch (SecurityException e) {
+            return false;
         }
     }
 
--- a/src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java	Sat Jan 24 23:23:25 2015 -0800
@@ -82,11 +82,7 @@
         setBackground(bgColor);
         FileSystemView fsv = fc.getFileSystemView();
 
-        files = AccessController.doPrivileged(new PrivilegedAction<File[]>() {
-            public File[] run() {
-                return (File[]) ShellFolder.get("fileChooserShortcutPanelFolders");
-            }
-        });
+        files = (File[]) ShellFolder.get("fileChooserShortcutPanelFolders");
 
         buttons = new JToggleButton[files.length];
         buttonGroup = new ButtonGroup();
--- a/src/java.desktop/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java	Sat Jan 24 23:23:25 2015 -0800
@@ -28,7 +28,6 @@
 import java.awt.*;
 import java.util.*;
 import javax.swing.*;
-import javax.swing.border.Border;
 import javax.swing.plaf.*;
 
 /**
@@ -44,7 +43,8 @@
  * @author Scott Violet
  */
 public class DefaultSynthStyle extends SynthStyle implements Cloneable {
-    private static final String PENDING = "Pending";
+
+    private static final Object PENDING = new Object();
 
     /**
      * Should the component be opaque?
--- a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java	Sat Jan 24 23:23:25 2015 -0800
@@ -771,16 +771,9 @@
                 fireIntervalRemoved(this, 0, oldSize);
             }
 
-            File[] baseFolders;
-            if (useShellFolder) {
-                baseFolders = AccessController.doPrivileged(new PrivilegedAction<File[]>() {
-                    public File[] run() {
-                        return (File[]) ShellFolder.get("fileChooserComboBoxFolders");
-                    }
-                });
-            } else {
-                baseFolders = fsv.getRoots();
-            }
+            File[] baseFolders = (useShellFolder)
+                    ? (File[]) ShellFolder.get("fileChooserComboBoxFolders")
+                    : fsv.getRoots();
             directories.addAll(Arrays.asList(baseFolders));
 
             // Get the canonical (full) path. This has the side
--- a/src/java.desktop/share/native/libfontmanager/layout/ContextualSubstSubtables.cpp	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/native/libfontmanager/layout/ContextualSubstSubtables.cpp	Sat Jan 24 23:23:25 2015 -0800
@@ -583,6 +583,8 @@
                 LEReferenceTo<ChainSubClassRuleTable>
                      chainSubClassRuleTable(chainSubClassSetTable, success, chainSubClassRuleTableOffset);
                 le_uint16 backtrackGlyphCount = SWAPW(chainSubClassRuleTable->backtrackGlyphCount);
+                LEReferenceToArrayOf<le_uint16>   backtrackClassArray(base, success, chainSubClassRuleTable->backtrackClassArray, backtrackGlyphCount);
+                if( LE_FAILURE(success) ) { return 0; }
                 le_uint16 inputGlyphCount = SWAPW(chainSubClassRuleTable->backtrackClassArray[backtrackGlyphCount]) - 1;
                 LEReferenceToArrayOf<le_uint16>   inputClassArray(base, success, &chainSubClassRuleTable->backtrackClassArray[backtrackGlyphCount + 1],inputGlyphCount+2); // +2 for the lookaheadGlyphCount count
                 le_uint16 lookaheadGlyphCount = SWAPW(inputClassArray.getObject(inputGlyphCount, success));
@@ -599,8 +601,6 @@
                 }
 
                 tempIterator.prev();
-                LEReferenceToArrayOf<le_uint16>   backtrackClassArray(base, success, chainSubClassRuleTable->backtrackClassArray, backtrackGlyphCount);
-                if( LE_FAILURE(success) ) { return 0; }
                 if (! matchGlyphClasses(backtrackClassArray, backtrackGlyphCount,
                                         &tempIterator, backtrackClassDefinitionTable, success, TRUE)) {
                     continue;
--- a/src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.cpp	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.cpp	Sat Jan 24 23:23:25 2015 -0800
@@ -45,6 +45,9 @@
     le_int32  coverageIndex = getGlyphCoverage(base, glyphID, success);
     le_uint16 eeCount       = SWAPW(entryExitCount);
 
+    LEReferenceToArrayOf<EntryExitRecord>
+        entryExitRecordsArrayRef(base, success, entryExitRecords, coverageIndex);
+
     if (coverageIndex < 0 || coverageIndex >= eeCount || LE_FAILURE(success)) {
         glyphIterator->setCursiveGlyph();
         return 0;
--- a/src/java.desktop/share/native/libfontmanager/layout/Features.cpp	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/native/libfontmanager/layout/Features.cpp	Sat Jan 24 23:23:25 2015 -0800
@@ -40,6 +40,9 @@
 
 LEReferenceTo<FeatureTable> FeatureListTable::getFeatureTable(const LETableReference &base, le_uint16 featureIndex, LETag *featureTag, LEErrorCode &success) const
 {
+    LEReferenceToArrayOf<FeatureRecord>
+        featureRecordArrayRef(base, success, featureRecordArray, featureIndex);
+
   if (featureIndex >= SWAPW(featureCount) || LE_FAILURE(success)) {
     return LEReferenceTo<FeatureTable>();
   }
--- a/src/java.desktop/share/native/libfontmanager/layout/LETableReference.h	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/native/libfontmanager/layout/LETableReference.h	Sat Jan 24 23:23:25 2015 -0800
@@ -470,7 +470,12 @@
 #endif
 
   const T& getObject(le_uint32 i, LEErrorCode &success) const {
-    return *getAlias(i,success);
+      const T *ret = getAlias(i, success);
+      if (LE_FAILURE(success) || ret==NULL) {
+          return *(new T(0));
+      } else {
+          return *ret;
+     }
   }
 
   /**
--- a/src/java.desktop/share/native/libfontmanager/layout/LigatureSubstSubtables.cpp	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/native/libfontmanager/layout/LigatureSubstSubtables.cpp	Sat Jan 24 23:23:25 2015 -0800
@@ -64,6 +64,9 @@
             LEReferenceTo<LigatureTable>   ligTable(ligSetTable, success, ligTableOffset);
             if(LE_FAILURE(success)) { return 0; }
             le_uint16 compCount = SWAPW(ligTable->compCount) - 1;
+            LEReferenceToArrayOf<TTGlyphID>
+                componentArrayRef(base, success, ligTable->componentArray, compCount);
+            if (LE_FAILURE(success)) { return 0; }
             le_int32 startPosition = glyphIterator->getCurrStreamPosition();
             TTGlyphID ligGlyph = SWAPW(ligTable->ligGlyph);
             le_uint16 comp;
--- a/src/java.desktop/share/native/libfontmanager/layout/MultipleSubstSubtables.cpp	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/share/native/libfontmanager/layout/MultipleSubstSubtables.cpp	Sat Jan 24 23:23:25 2015 -0800
@@ -61,6 +61,8 @@
 
     le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
     le_uint16 seqCount = SWAPW(sequenceCount);
+    LEReferenceToArrayOf<Offset>
+        sequenceTableOffsetArrayRef(base, success, sequenceTableOffsetArray, seqCount);
 
     if (LE_FAILURE(success)) {
         return 0;
--- a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Sat Jan 24 23:23:25 2015 -0800
@@ -36,6 +36,7 @@
 import java.util.*;
 import java.util.List;
 import java.util.concurrent.*;
+import java.util.stream.Stream;
 
 import static sun.awt.shell.Win32ShellFolder2.*;
 import sun.awt.OSInfo;
@@ -251,7 +252,7 @@
             if (file == null) {
                 file = getDesktop();
             }
-            return file;
+            return checkFile(file);
         } else if (key.equals("roots")) {
             // Should be "History" and "Desktop" ?
             if (roots == null) {
@@ -262,11 +263,11 @@
                     roots = (File[])super.get(key);
                 }
             }
-            return roots;
+            return checkFiles(roots);
         } else if (key.equals("fileChooserComboBoxFolders")) {
             Win32ShellFolder2 desktop = getDesktop();
 
-            if (desktop != null) {
+            if (desktop != null && checkFile(desktop) != null) {
                 ArrayList<File> folders = new ArrayList<File>();
                 Win32ShellFolder2 drives = getDrives();
 
@@ -277,7 +278,7 @@
 
                 folders.add(desktop);
                 // Add all second level folders
-                File[] secondLevelFolders = desktop.listFiles();
+                File[] secondLevelFolders = checkFiles(desktop.listFiles());
                 Arrays.sort(secondLevelFolders);
                 for (File secondLevelFolder : secondLevelFolders) {
                     Win32ShellFolder2 folder = (Win32ShellFolder2) secondLevelFolder;
@@ -285,7 +286,7 @@
                         folders.add(folder);
                         // Add third level for "My Computer"
                         if (folder.equals(drives)) {
-                            File[] thirdLevelFolders = folder.listFiles();
+                            File[] thirdLevelFolders = checkFiles(folder.listFiles());
                             if (thirdLevelFolders != null && thirdLevelFolders.length > 0) {
                                 List<File> thirdLevelFoldersList = Arrays.asList(thirdLevelFolders);
 
@@ -295,7 +296,7 @@
                         }
                     }
                 }
-                return folders.toArray(new File[folders.size()]);
+                return checkFiles(folders);
             } else {
                 return super.get(key);
             }
@@ -332,7 +333,7 @@
                     }
                 }
             }
-            return folders.toArray(new File[folders.size()]);
+            return checkFiles(folders);
         } else if (key.startsWith("fileChooserIcon ")) {
             String name = key.substring(key.indexOf(" ") + 1);
 
@@ -378,6 +379,41 @@
         return null;
     }
 
+    private File checkFile(File file) {
+        SecurityManager sm = System.getSecurityManager();
+        return (sm == null || file == null) ? file : checkFile(file, sm);
+    }
+
+    private File checkFile(File file, SecurityManager sm) {
+        try {
+            sm.checkRead(file.getPath());
+            return file;
+        } catch (SecurityException se) {
+            return null;
+        }
+    }
+
+    private File[] checkFiles(File[] files) {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm == null || files == null || files.length == 0) {
+            return files;
+        }
+        return checkFiles(Arrays.stream(files), sm);
+    }
+
+    private File[] checkFiles(List<File> files) {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm == null || files.isEmpty()) {
+            return files.toArray(new File[files.size()]);
+        }
+        return checkFiles(files.stream(), sm);
+    }
+
+    private File[] checkFiles(Stream<File> filesStream, SecurityManager sm) {
+        return filesStream.filter((file) -> checkFile(file, sm) != null)
+                .toArray(File[]::new);
+    }
+
     /**
      * Does <code>dir</code> represent a "computer" such as a node on the network, or
      * "My Computer" on the desktop.
--- a/src/java.naming/share/classes/com/sun/jndi/ldap/BerDecoder.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.naming/share/classes/com/sun/jndi/ldap/BerDecoder.java	Sat Jan 24 23:23:25 2015 -0800
@@ -95,6 +95,9 @@
             for( int i = 0; i < lengthbyte; i++) {
                 retval = (retval << 8) + (buf[offset++] & 0xff);
             }
+            if (retval < 0) {
+              throw new DecodeException("Invalid length bytes");
+            }
             return retval;
         } else {
             return lengthbyte;
--- a/src/java.rmi/share/classes/sun/rmi/transport/Transport.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.rmi/share/classes/sun/rmi/transport/Transport.java	Sat Jan 24 23:23:25 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
@@ -37,7 +37,10 @@
 import java.rmi.server.RemoteServer;
 import java.rmi.server.ServerNotActiveException;
 import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.Permissions;
 import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
 import sun.rmi.runtime.Log;
 import sun.rmi.server.Dispatcher;
 import sun.rmi.server.UnicastServerRef;
@@ -69,6 +72,15 @@
     /** ObjID for DGCImpl */
     private static final ObjID dgcID = new ObjID(ObjID.DGC_ID);
 
+    /** AccessControlContext for setting context ClassLoader */
+    private static final AccessControlContext SETCCL_ACC;
+    static {
+        Permissions perms = new Permissions();
+        perms.add(new RuntimePermission("setContextClassLoader"));
+        ProtectionDomain[] pd = { new ProtectionDomain(null, perms) };
+        SETCCL_ACC = new AccessControlContext(pd);
+    }
+
     /**
      * Returns a <I>Channel</I> that generates connections to the
      * endpoint <I>ep</I>. A Channel is an object that creates and
@@ -118,6 +130,16 @@
     protected abstract void checkAcceptPermission(AccessControlContext acc);
 
     /**
+     * Sets the context class loader for the current thread.
+     */
+    private static void setContextClassLoader(ClassLoader ccl) {
+        AccessController.doPrivileged((PrivilegedAction<Void>)() -> {
+                Thread.currentThread().setContextClassLoader(ccl);
+                return null;
+            }, SETCCL_ACC);
+    }
+
+    /**
      * Service an incoming remote call. When a message arrives on the
      * connection indicating the beginning of a remote call, the
      * threads are required to call the <I>serviceCall</I> method of
@@ -165,11 +187,10 @@
                     target.getAccessControlContext();
                 ClassLoader ccl = target.getContextClassLoader();
 
-                Thread t = Thread.currentThread();
-                ClassLoader savedCcl = t.getContextClassLoader();
+                ClassLoader savedCcl = Thread.currentThread().getContextClassLoader();
 
                 try {
-                    t.setContextClassLoader(ccl);
+                    setContextClassLoader(ccl);
                     currentTransport.set(this);
                     try {
                         java.security.AccessController.doPrivileged(
@@ -184,7 +205,7 @@
                         throw (IOException) pae.getException();
                     }
                 } finally {
-                    t.setContextClassLoader(savedCcl);
+                    setContextClassLoader(savedCcl);
                     currentTransport.set(null);
                 }
 
--- a/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Sat Jan 24 23:23:25 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
@@ -49,7 +49,9 @@
 import java.rmi.server.UID;
 import java.security.AccessControlContext;
 import java.security.AccessController;
+import java.security.Permissions;
 import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
@@ -120,6 +122,14 @@
     private static final ThreadLocal<ConnectionHandler>
         threadConnectionHandler = new ThreadLocal<>();
 
+    /** an AccessControlContext with no permissions */
+    private static final AccessControlContext NOPERMS_ACC;
+    static {
+        Permissions perms = new Permissions();
+        ProtectionDomain[] pd = { new ProtectionDomain(null, perms) };
+        NOPERMS_ACC = new AccessControlContext(pd);
+    }
+
     /** endpoints for this transport */
     private final LinkedList<TCPEndpoint> epList;
     /** number of objects exported on this transport */
@@ -664,7 +674,10 @@
                 t.setName("RMI TCP Connection(" +
                           connectionCount.incrementAndGet() +
                           ")-" + remoteHost);
-                run0();
+                AccessController.doPrivileged((PrivilegedAction<Void>)() -> {
+                    run0();
+                    return null;
+                }, NOPERMS_ACC);
             } finally {
                 t.setName(name);
             }
--- a/src/java.security.jgss/share/classes/sun/security/jgss/GSSHeader.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/GSSHeader.java	Sat Jan 24 23:23:25 2015 -0800
@@ -270,6 +270,9 @@
                 value <<= 8;
                 value += 0x0ff & in.read();
             }
+            if (value < 0) {
+                throw new IOException("Invalid length bytes");
+            }
         }
         return value;
     }
--- a/src/java.security.jgss/share/classes/sun/security/jgss/GSSNameImpl.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/GSSNameImpl.java	Sat Jan 24 23:23:25 2015 -0800
@@ -257,7 +257,8 @@
                               ((0xFF & bytes[pos++]) << 16) |
                               ((0xFF & bytes[pos++]) << 8) |
                               (0xFF & bytes[pos++]));
-        if (pos > bytes.length - mechPortionLen) {
+
+        if (mechPortionLen < 0 || pos > bytes.length - mechPortionLen) {
             throw new GSSExceptionImpl(GSSException.BAD_NAME,
                     "Exported name mech name is corrupted!");
         }
--- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java	Sat Jan 24 23:23:25 2015 -0800
@@ -233,6 +233,9 @@
                               ((0xFF & nameVal[pos++]) << 16) |
                               ((0xFF & nameVal[pos++]) << 8) |
                               (0xFF & nameVal[pos++]));
+        if (mechPortionLen < 0) {
+            throw new GSSException(GSSException.BAD_NAME);
+        }
         byte[] mechPortion = new byte[mechPortionLen];
         System.arraycopy(nameVal, pos, mechPortion, 0, mechPortionLen);
         return mechPortion;
--- a/src/java.security.jgss/share/classes/sun/security/krb5/SCDynamicStoreConfig.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/SCDynamicStoreConfig.java	Sat Jan 24 23:23:25 2015 -0800
@@ -113,15 +113,17 @@
 
     @SuppressWarnings("unchecked")
     private static Hashtable<String, Object> convertNativeConfig(
-            Hashtable<String, Object> stanzaTable) {
+            Hashtable<String, Object> stanzaTable) throws IOException {
         // convert SCDynamicStore realm structure to Java realm structure
         Hashtable<String, ?> realms =
                 (Hashtable<String, ?>) stanzaTable.get("realms");
-        if (realms != null) {
-            stanzaTable.remove("realms");
-            Hashtable<String, Object> realmsTable = convertRealmConfigs(realms);
-            stanzaTable.put("realms", realmsTable);
+        if (realms == null || realms.isEmpty()) {
+            throw new IOException(
+                    "SCDynamicStore contains an empty Kerberos setting");
         }
+        stanzaTable.remove("realms");
+        Hashtable<String, Object> realmsTable = convertRealmConfigs(realms);
+        stanzaTable.put("realms", realmsTable);
         WrapAllStringInVector(stanzaTable);
         if (DEBUG) System.out.println("stanzaTable : " + stanzaTable);
         return stanzaTable;
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java	Sat Jan 24 23:23:25 2015 -0800
@@ -118,7 +118,7 @@
         } else {
             type = read(4);
         }
-        length = read(4);
+        length = readLength4();
         List<String> result = new ArrayList<String>();
         /*
          * DCE includes the principal's realm in the count; the new format
@@ -127,7 +127,7 @@
         if (version == KRB5_FCC_FVNO_1)
             length--;
         for (int i = 0; i <= length; i++) {
-            namelength = read(4);
+            namelength = readLength4();
             byte[] bytes = IOUtils.readFully(this, namelength, true);
             result.add(new String(bytes));
         }
@@ -184,7 +184,7 @@
         keyType = read(2);
         if (version == KRB5_FCC_FVNO_3)
             read(2); /* keytype recorded twice in fvno 3 */
-        keyLen = read(4);
+        keyLen = readLength4();
         byte[] bytes = IOUtils.readFully(this, keyLen, true);
         return new EncryptionKey(bytes, keyType, version);
     }
@@ -207,12 +207,12 @@
 
     HostAddress[] readAddr() throws IOException, KrbApErrException {
         int numAddrs, addrType, addrLength;
-        numAddrs = read(4);
+        numAddrs = readLength4();
         if (numAddrs > 0) {
             List<HostAddress> addrs = new ArrayList<>();
             for (int i = 0; i < numAddrs; i++) {
                 addrType = read(2);
-                addrLength = read(4);
+                addrLength = readLength4();
                 if (!(addrLength == 4 || addrLength == 16)) {
                     if (DEBUG) {
                         System.out.println("Incorrect address format.");
@@ -231,13 +231,13 @@
 
     AuthorizationDataEntry[] readAuth() throws IOException {
         int num, adtype, adlength;
-        num = read(4);
+        num = readLength4();
         if (num > 0) {
             List<AuthorizationDataEntry> auData = new ArrayList<>();
             byte[] data = null;
             for (int i = 0; i < num; i++) {
                 adtype = read(2);
-                adlength = read(4);
+                adlength = readLength4();
                 data = IOUtils.readFully(this, adlength, true);
                 auData.add(new AuthorizationDataEntry(adtype, data));
             }
@@ -248,7 +248,7 @@
 
     byte[] readData() throws IOException {
         int length;
-        length = read(4);
+        length = readLength4();
         if (length == 0) {
             return null;
         } else {
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Sat Jan 24 23:23:25 2015 -0800
@@ -150,43 +150,43 @@
     synchronized void init(PrincipalName principal, String name)
         throws IOException, KrbException {
         primaryPrincipal = principal;
-        CCacheOutputStream cos =
-            new CCacheOutputStream(new FileOutputStream(name));
-        version = KRB5_FCC_FVNO_3;
-        cos.writeHeader(primaryPrincipal, version);
-        cos.close();
+        try (FileOutputStream fos = new FileOutputStream(name);
+             CCacheOutputStream cos = new CCacheOutputStream(fos)) {
+            version = KRB5_FCC_FVNO_3;
+            cos.writeHeader(primaryPrincipal, version);
+        }
         load(name);
     }
 
     synchronized void load(String name) throws IOException, KrbException {
         PrincipalName p;
-        CCacheInputStream cis =
-            new CCacheInputStream(new FileInputStream(name));
-        version = cis.readVersion();
-        if (version == KRB5_FCC_FVNO_4) {
-            tag = cis.readTag();
-        } else {
-            tag = null;
-            if (version == KRB5_FCC_FVNO_1 || version == KRB5_FCC_FVNO_2) {
-                cis.setNativeByteOrder();
+        try (FileInputStream fis = new FileInputStream(name);
+             CCacheInputStream cis = new CCacheInputStream(fis)) {
+            version = cis.readVersion();
+            if (version == KRB5_FCC_FVNO_4) {
+                tag = cis.readTag();
+            } else {
+                tag = null;
+                if (version == KRB5_FCC_FVNO_1 || version == KRB5_FCC_FVNO_2) {
+                    cis.setNativeByteOrder();
+                }
+            }
+            p = cis.readPrincipal(version);
+
+            if (primaryPrincipal != null) {
+                if (!(primaryPrincipal.match(p))) {
+                    throw new IOException("Primary principals don't match.");
+                }
+            } else
+                primaryPrincipal = p;
+            credentialsList = new Vector<Credentials>();
+            while (cis.available() > 0) {
+                Credentials cred = cis.readCred(version);
+                if (cred != null) {
+                    credentialsList.addElement(cred);
+                }
             }
         }
-        p = cis.readPrincipal(version);
-
-        if (primaryPrincipal != null) {
-            if (!(primaryPrincipal.match(p))) {
-                throw new IOException("Primary principals don't match.");
-            }
-        } else
-            primaryPrincipal = p;
-        credentialsList = new Vector<Credentials> ();
-        while (cis.available() > 0) {
-            Credentials cred = cis.readCred(version);
-            if (cred != null) {
-                credentialsList.addElement(cred);
-            }
-        }
-        cis.close();
     }
 
 
@@ -245,16 +245,16 @@
      * Saves the credentials cache file to the disk.
      */
     public synchronized void save() throws IOException, Asn1Exception {
-        CCacheOutputStream cos
-            = new CCacheOutputStream(new FileOutputStream(cacheName));
-        cos.writeHeader(primaryPrincipal, version);
-        Credentials[] tmp = null;
-        if ((tmp = getCredsList()) != null) {
-            for (int i = 0; i < tmp.length; i++) {
-                cos.addCreds(tmp[i]);
+        try (FileOutputStream fos = new FileOutputStream(cacheName);
+             CCacheOutputStream cos = new CCacheOutputStream(fos)) {
+            cos.writeHeader(primaryPrincipal, version);
+            Credentials[] tmp = null;
+            if ((tmp = getCredsList()) != null) {
+                for (int i = 0; i < tmp.length; i++) {
+                    cos.addCreds(tmp[i]);
+                }
             }
         }
-        cos.close();
     }
 
     boolean match(String[] s1, String[] s2) {
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/util/KrbDataInputStream.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/util/KrbDataInputStream.java	Sat Jan 24 23:23:25 2015 -0800
@@ -56,15 +56,33 @@
     public KrbDataInputStream(InputStream is){
         super(is);
     }
+
+    /**
+     * Reads a length value which is represented in 4 bytes from
+     * this input stream. The value must be positive.
+     * @return the length value represented by this byte array.
+     * @throws IOException if there are not enough bytes or it represents
+     * a negative value
+     */
+    final public int readLength4() throws IOException {
+        int len = read(4);
+        if (len < 0) {
+            throw new IOException("Invalid encoding");
+        }
+        return len;
+    }
+
     /**
      * Reads up to the specific number of bytes from this input stream.
      * @param num the number of bytes to be read.
      * @return the int value of this byte array.
-     * @exception IOException.
+     * @throws IOException if there are not enough bytes
      */
-    public int read(int num) throws IOException{
+    public int read(int num) throws IOException {
         byte[] bytes = new byte[num];
-        read(bytes, 0, num);
+        if (read(bytes, 0, num) != num) {
+            throw new IOException("Premature end of stream reached");
+        }
         int result = 0;
         for (int i = 0; i < num; i++) {
             if (bigEndian) {
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/Code.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/Code.java	Sat Jan 24 23:23:25 2015 -0800
@@ -103,7 +103,7 @@
         case HTTP_UNAVAILABLE: return " Service Unavailable";
         case HTTP_GATEWAY_TIMEOUT: return " Gateway Timeout";
         case HTTP_VERSION: return " HTTP Version Not Supported";
-        default: return "";
+        default: return " ";
       }
     }
 }
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 201, 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
@@ -53,7 +53,6 @@
 import java.util.zip.InflaterInputStream;
 import java.util.zip.DeflaterOutputStream;
 import java.util.zip.ZipException;
-import java.util.zip.ZipError;
 import static java.lang.Boolean.*;
 import static jdk.nio.zipfs.ZipConstants.*;
 import static jdk.nio.zipfs.ZipUtils.*;
@@ -119,7 +118,16 @@
         this.zc = ZipCoder.get(nameEncoding);
         this.defaultdir = new ZipPath(this, getBytes(defaultDir));
         this.ch = Files.newByteChannel(zfpath, READ);
-        this.cen = initCEN();
+        try {
+            this.cen = initCEN();
+        } catch (IOException x) {
+            try {
+                this.ch.close();
+            } catch (IOException xx) {
+                x.addSuppressed(xx);
+            }
+            throw x;
+        }
     }
 
     @Override
@@ -1058,12 +1066,15 @@
             int nlen   = CENNAM(cen, pos);
             int elen   = CENEXT(cen, pos);
             int clen   = CENCOM(cen, pos);
-            if ((CENFLG(cen, pos) & 1) != 0)
+            if ((CENFLG(cen, pos) & 1) != 0) {
                 zerror("invalid CEN header (encrypted entry)");
-            if (method != METHOD_STORED && method != METHOD_DEFLATED)
+            }
+            if (method != METHOD_STORED && method != METHOD_DEFLATED) {
                 zerror("invalid CEN header (unsupported compression method: " + method + ")");
-            if (pos + CENHDR + nlen > limit)
+            }
+            if (pos + CENHDR + nlen > limit) {
                 zerror("invalid CEN header (bad header size)");
+            }
             byte[] name = Arrays.copyOfRange(cen, pos + CENHDR, pos + CENHDR + nlen);
             IndexNode inode = new IndexNode(name, pos);
             inodes.put(inode, inode);
@@ -1533,6 +1544,7 @@
         private CRC32 crc;
         private Entry e;
         private long written;
+        private boolean isClosed = false;
 
         EntryOutputStream(Entry e, OutputStream os)
             throws IOException
@@ -1545,9 +1557,14 @@
         }
 
         @Override
-        public void write(byte b[], int off, int len) throws IOException {
+        public synchronized void write(byte b[], int off, int len)
+            throws IOException
+        {
             if (e.type != Entry.FILECH)    // only from sync
                 ensureOpen();
+            if (isClosed) {
+                throw new IOException("Stream closed");
+            }
             if (off < 0 || len < 0 || off > b.length - len) {
                 throw new IndexOutOfBoundsException();
             } else if (len == 0) {
@@ -1568,7 +1585,11 @@
         }
 
         @Override
-        public void close() throws IOException {
+        public synchronized void close() throws IOException {
+            if (isClosed) {
+                return;
+            }
+            isClosed = true;
             // TBD ensureOpen();
             switch (e.method) {
             case METHOD_DEFLATED:
@@ -1599,8 +1620,8 @@
         }
     }
 
-    static void zerror(String msg) {
-        throw new ZipError(msg);
+    static void zerror(String msg) throws ZipException {
+        throw new ZipException(msg);
     }
 
     // Maxmum number of de/inflater we cache
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Sat Jan 24 23:23:25 2015 -0800
@@ -36,7 +36,7 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
-import java.util.zip.ZipError;
+import java.util.zip.ZipException;
 import java.util.concurrent.ExecutorService;
 
 /*
@@ -100,7 +100,7 @@
             ZipFileSystem zipfs = null;
             try {
                 zipfs = new ZipFileSystem(this, path, env);
-            } catch (ZipError ze) {
+            } catch (ZipException ze) {
                 String pname = path.toString();
                 if (pname.endsWith(".zip") || pname.endsWith(".jar"))
                     throw ze;
@@ -122,7 +122,7 @@
         ensureFile(path);
         try {
             return new ZipFileSystem(this, path, env);
-        } catch (ZipError ze) {
+        } catch (ZipException ze) {
             String pname = path.toString();
             if (pname.endsWith(".zip") || pname.endsWith(".jar"))
                 throw ze;
--- a/test/ProblemList.txt	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/ProblemList.txt	Sat Jan 24 23:23:25 2015 -0800
@@ -296,6 +296,9 @@
 # 8058616
 com/sun/jdi/RedefinePop.sh                                      generic-all
 
+# 8068645
+com/sun/jdi/CatchPatternTest.sh                                 generic-all
+
 ############################################################################
 
 # jdk_util
@@ -332,6 +335,9 @@
 # 8057732
 sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java    generic-all
 
+# 8064572 8060736 8062938
+sun/jvmstat/monitor/MonitoredVm/CR6672135.java			generic-all
+
 # 8060088
 com/sun/tracing/BasicWithSecurityMgr.java                       generic-all
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/net/httpserver/MissingTrailingSpace.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,143 @@
+/*
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8068795
+ * @summary HttpServer missing tailing space for some response codes
+ * @author lev.priima@oracle.com
+ */
+
+import java.net.InetSocketAddress;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.Socket;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+import com.sun.net.httpserver.HttpServer;
+
+public class MissingTrailingSpace {
+
+    private static final int noMsgCode = 207;
+    private static final String someContext = "/context";
+
+    public static void main(String[] args) throws Exception {
+        HttpServer server = HttpServer.create(new InetSocketAddress(0), 0);
+        try {
+            server.setExecutor(Executors.newFixedThreadPool(1));
+            server.createContext(someContext, new HttpHandler() {
+                @Override
+                public void handle(HttpExchange msg) {
+                    try {
+                        try {
+                            msg.sendResponseHeaders(noMsgCode, -1);
+                        } catch(IOException ioe) {
+                            ioe.printStackTrace();
+                        }
+                    } finally {
+                        msg.close();
+                    }
+                }
+            });
+            server.start();
+            System.out.println("Server started at port "
+                               + server.getAddress().getPort());
+
+            runRawSocketHttpClient("localhost", server.getAddress().getPort());
+        } finally {
+            ((ExecutorService)server.getExecutor()).shutdown();
+            server.stop(0);
+        }
+        System.out.println("Server finished.");
+    }
+
+    static void runRawSocketHttpClient(String hostname, int port)
+        throws Exception
+    {
+        Socket socket = null;
+        PrintWriter writer = null;
+        BufferedReader reader = null;
+        final String CRLF = "\r\n";
+        try {
+            socket = new Socket(hostname, port);
+            writer = new PrintWriter(new OutputStreamWriter(
+                socket.getOutputStream()));
+            System.out.println("Client connected by socket: " + socket);
+
+            writer.print("GET " + someContext + "/ HTTP/1.1" + CRLF);
+            writer.print("User-Agent: Java/"
+                + System.getProperty("java.version")
+                + CRLF);
+            writer.print("Host: " + hostname + CRLF);
+            writer.print("Accept: */*" + CRLF);
+            writer.print("Connection: keep-alive" + CRLF);
+            writer.print(CRLF); // Important, else the server will expect that
+            // there's more into the request.
+            writer.flush();
+            System.out.println("Client wrote rquest to socket: " + socket);
+
+            reader = new BufferedReader(new InputStreamReader(
+                socket.getInputStream()));
+            System.out.println("Client start reading from server:"  );
+            String line = reader.readLine();
+            if ( !line.endsWith(" ") ) {
+                throw new RuntimeException("respond to unknown code "
+                    + noMsgCode
+                    + " doesn't return space at the end of the first header.\n"
+                    + "Should be: " + "\"" + line + " \""
+                    + ", but returns: " + "\"" + line + "\".");
+            }
+            for (; line != null; line = reader.readLine()) {
+                if (line.isEmpty()) {
+                    break;
+                }
+                System.out.println("\""  + line + "\"");
+            }
+            System.out.println("Client finished reading from server"  );
+        } finally {
+            if (reader != null)
+                try {
+                    reader.close();
+                } catch (IOException logOrIgnore) {
+                    logOrIgnore.printStackTrace();
+                }
+            if (writer != null) {
+                writer.close();
+            }
+            if (socket != null) {
+                try {
+                    socket.close();
+                } catch (IOException logOrIgnore) {
+                    logOrIgnore.printStackTrace();
+                }
+            }
+        }
+        System.out.println("Client finished." );
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/MultipleDialogs/MultipleDialogs1Test.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,209 @@
+/*
+ * 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 8054358
+ * @summary Check whether a set of dialogs created with a toolkit excluded Frame
+ *          parent has a proper modal blocking behavior. Also show a document modal
+ *          dialog and check if it blocks the document properly.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main/timeout=500 MultipleDialogs1Test
+ */
+
+
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
+import java.util.Iterator;
+
+public class MultipleDialogs1Test {
+
+    private volatile CustomFrame frame;
+    private List<CustomDialog> dialogList;
+
+    private static int delay = 500;
+    private int dialogCount = -1;
+
+    public void createGUI() {
+
+        final int n = 8;
+        dialogList = new ArrayList<>();
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+        frame.setModalExclusionType(Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
+        frame.setVisible(true);
+
+        int x = 250, y = 50;
+
+        CustomDialog dlg;
+
+        for (int i = 0; i < n - 1; ++i) {
+
+            dlg = new CustomDialog(frame);
+            dlg.setLocation(x, y);
+            x += 200;
+
+            if (x > 600) {
+                x = 50;
+                y += 200;
+            }
+
+            Dialog.ModalityType type;
+
+            if (i % 3 == 0) {
+                type = Dialog.ModalityType.MODELESS;
+            } else if (i % 3 == 1) {
+                type = Dialog.ModalityType.APPLICATION_MODAL;
+            } else {
+                type = Dialog.ModalityType.TOOLKIT_MODAL;
+            }
+
+            dlg.setModalityType(type);
+            dialogList.add(dlg);
+        }
+
+        dlg = new CustomDialog(frame);
+        dlg.setLocation(x, y);
+        dlg.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);
+        dialogList.add(dlg);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+            EventQueue.invokeAndWait(this::createGUI);
+
+            ExtendedRobot robot = new ExtendedRobot();
+            robot.waitForIdle(delay);
+
+            List<CustomDialog> dialogs = Collections.synchronizedList(dialogList);
+
+            final int n = dialogs.size();
+
+            synchronized(dialogs) {
+                for (int i = 0; i < n - 1; ++i) {
+
+                    frame.clickOpenButton(robot);
+                    robot.waitForIdle(delay);
+
+                    dialogs.get(i).checkUnblockedDialog(
+                        robot, i + ": This is " + getType(i) + ".");
+
+                    frame.checkUnblockedFrame(robot, i + ": Other dialogs are visible.");
+
+                    if (i > 0) {
+                        for (int j = 0; j < i; j++) {
+                            dialogs.get(j).checkUnblockedDialog(robot, j + ": A toolkit modality " +
+                                "excluded frame is a parent of this dialog.");
+                        }
+                    }
+                } // i
+
+                frame.clickOpenButton(robot);
+                robot.waitForIdle(delay);
+
+                dialogs.get(n - 1).checkUnblockedDialog(
+                    robot, (n - 1) + ": This is " + getType(n - 1) + ".");
+
+                frame.checkBlockedFrame(robot,
+                    "A document modal dialog with Frame parent is visible.");
+
+                for (int i = 0; i < n - 1; ++i) {
+                    dialogs.get(i).checkUnblockedDialog(robot,
+                        i + ": A document modal dialog should not block " +
+                        "this dialog. The parent is modality excluded.");
+                }
+
+                dialogs.get(n - 1).clickCloseButton(robot);
+                robot.waitForIdle(delay);
+
+                for (int i = 0; i < n - 1; ++i) {
+                    dialogs.get(i).checkUnblockedDialog(robot, i + ": A document modal " +
+                        "dialog which blocked this dialog was closed.");
+                }
+                frame.checkUnblockedFrame(robot,
+                    "A blocking document modal dialog was closed.");
+                robot.waitForIdle(delay);
+            } // synchronized
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private String getType(int i) {
+
+        switch (dialogList.get(i).getModalityType()) {
+            case APPLICATION_MODAL:
+                return "an application modal dialog";
+            case DOCUMENT_MODAL:
+                return "a document modal dialog";
+            case TOOLKIT_MODAL:
+                return "a toolkit modal dialog";
+        }
+        return "a modeless dialog";
+    }
+
+    private void closeAll() {
+
+        if (frame != null) { frame.dispose(); }
+        if (dialogList != null) {
+            Iterator<CustomDialog> it = dialogList.iterator();
+            while (it.hasNext()) { it.next().dispose(); }
+        }
+    }
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if ((dialogList != null) && (dialogList.size() > dialogCount)) {
+                dialogCount++;
+                CustomDialog d = dialogList.get(dialogCount);
+                if (d != null) { d.setVisible(true); }
+            }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Frame  f) { super(f); }
+        public CustomDialog(Dialog d) { super(d); }
+
+        @Override
+        public void doCloseAction() { this.dispose(); }
+    }
+
+
+    public static void main(String[] args) throws Exception {
+        (new MultipleDialogs1Test()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/MultipleDialogs/MultipleDialogs2Test.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,299 @@
+/*
+ * 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 8054358
+ * @summary Check whether a set of dialogs created with an application excluded Frame
+ *          parent has a proper modal blocking behavior. Also show a document modal
+ *          dialog and check if it blocks the document properly.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main/timeout=500 MultipleDialogs2Test
+ */
+
+
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
+import java.util.Iterator;
+
+public class MultipleDialogs2Test {
+
+    private volatile CustomFrame frame;
+    private List<CustomDialog> dialogList;
+    private static final int delay = 500;
+
+    private int dialogCount = -1;
+
+    private void createGUI() {
+
+        final int n = 8;
+        dialogList = new ArrayList<>();
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+        frame.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
+        frame.setVisible(true);
+
+        CustomDialog dlg;
+
+        int x = 250, y = 50;
+        for (int i = 0; i < n - 1; ++i) {
+
+            dlg = new CustomDialog(frame);
+            dlg.setLocation(x, y);
+            x += 200;
+            if (x > 600) {
+                x = 50;
+                y += 200;
+            }
+
+            Dialog.ModalityType type;
+            if (i % 3 == 0) {
+                type = Dialog.ModalityType.MODELESS;
+            } else if (i % 3 == 1) {
+                type = Dialog.ModalityType.APPLICATION_MODAL;
+            } else {
+                type = Dialog.ModalityType.TOOLKIT_MODAL;
+            }
+            dlg.setModalityType(type);
+            dialogList.add(dlg);
+        }
+
+        dlg = new CustomDialog(frame);
+        dlg.setLocation(x, y);
+        dlg.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);
+        dialogList.add(dlg);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+            EventQueue.invokeAndWait(this::createGUI);
+
+            ExtendedRobot robot = new ExtendedRobot();
+            robot.waitForIdle(delay);
+
+            List<CustomDialog> dialogs = Collections.synchronizedList(dialogList);
+            final int n = dialogs.size();
+
+            synchronized(dialogs) {
+                for (int i = 0; i < n - 1; ++i) {
+
+                    frame.clickOpenButton(robot);
+                    robot.waitForIdle(delay);
+
+                    dialogs.get(i).checkUnblockedDialog(
+                        robot, i + ": This is " + getType(i) + ".");
+
+                    if (isToolkitModal(i)) {
+
+                        for (int j = 0; j < i; ++j) {
+                            dialogs.get(j).checkBlockedDialog(robot, j + ": This dialog " +
+                                "should be blocked by a toolkit modal dialog.");
+                        }
+
+                        frame.checkBlockedFrame(robot, i + ": A toolkit modal dialog " +
+                            "should block this application modality excluded frame.");
+
+                        break;
+
+                    } else {
+                        for (int j = 0; j < i; ++j) {
+                            dialogs.get(j).checkUnblockedDialog(robot,
+                                j + ": An application modality excluded frame " +
+                                "is the parent of this dialog.");
+                        }
+
+                        frame.checkUnblockedFrame(robot, i + ": The frame is " +
+                            "application modality excluded, but it is blocked.");
+                    }
+                }
+
+                int tkIndex = dialogCount; // continue testing
+                final int tk0 = tkIndex;
+
+                for (int i = tk0 + 1; i < n - 1; ++i) {
+
+                    dialogs.get(tkIndex).clickOpenButton(robot);
+                    robot.waitForIdle(delay);
+
+                    frame.checkBlockedFrame(robot, i + ": A toolkit modal dialog " +
+                        "should block this application modality excluded frame.");
+
+                    if (isToolkitModal(i)) {
+                        dialogs.get(i).checkUnblockedDialog(robot, i + ": This is " +
+                            "a toolkit modal dialog with blocked frame parent. " +
+                            "Another toolkit modal dialog is visible.");
+
+                        for (int j = 0; j < i; ++j) {
+                            dialogs.get(j).checkBlockedDialog(robot, j + ": " +
+                                "A toolkit modal dialog should block this child " +
+                                "dialog of application modality excluded frame.");
+                        }
+                        tkIndex = i;
+                    } else {
+                        dialogs.get(i).checkBlockedDialog(
+                            robot, i + ": This is " + getType(i) + " with blocked " +
+                            "Frame parent. Also, a toolkit modal dialog is visible.");
+
+                        for (int j = 0; j < i; ++j) {
+                            if (j != tkIndex) {
+                                dialogs.get(j).checkBlockedDialog(robot, j +
+                                    ": A toolkit modal dialog should block this " +
+                                    "child dialog of an application modality excluded frame.");
+                            }
+                        }
+                    }
+                }
+
+                // show a document modal dialog; the toolkit modal dialog should block it
+                dialogs.get(tkIndex).clickOpenButton(robot);
+                robot.waitForIdle(delay);
+
+                frame.checkBlockedFrame(robot, "A toolkit modal dialog is visible.");
+
+                for (int i = 0; i < n; ++i) {
+                    if (i == tkIndex) {
+                        dialogs.get(tkIndex).checkUnblockedDialog(robot,
+                            tkIndex + ": This is a toolkit modal dialog. " +
+                            "A document modal dialog is visible.");
+                    } else {
+                        dialogs.get(i).checkBlockedDialog(robot,
+                            i + ": A toolkit modal dialog should block this dialog.");
+                    }
+                }
+
+                dialogs.get(tk0 + 3).clickCloseButton(robot); // close 2nd toolkit dialog
+                robot.waitForIdle(delay);
+
+                for (int i = 0; i < n; ++i) {
+
+                    if (i == tk0 + 3) { continue; }
+                    if (i == tk0) {
+                        dialogs.get(i).checkUnblockedDialog(robot,
+                            i + ": This is a toolkit modal dialog. A blocking " +
+                            "toolkit modal dialog was opened and then closed.");
+                    } else {
+                        dialogs.get(i).checkBlockedDialog(robot,
+                            i + ": This dialog should be blocked by a toolkit modal dialog. " +
+                            "Another blocking toolkit modal dialog was closed.");
+                    }
+                }
+
+                dialogs.get(tk0).clickCloseButton(robot);
+                robot.waitForIdle(delay);
+
+                frame.checkBlockedFrame(
+                        robot, "A document modal dialog should block this Frame.");
+
+                for (int i = 0; i < n - 1; ++i) {
+                    if (!isToolkitModal(i)) {
+                        dialogs.get(i).checkUnblockedDialog(robot, i + ": The parent " +
+                            "of the dialog is an app modality excluded Frame.");
+                    }
+                }
+
+                dialogs.get(n - 1).clickCloseButton(robot);
+                robot.waitForIdle(delay);
+
+                frame.checkUnblockedFrame(robot, "A document modal dialog " +
+                    "blocking this Frame was closed.");
+
+                for (int i = 0; i < n - 1; ++i) {
+                    if (!isToolkitModal(i)) {
+                        dialogs.get(i).checkUnblockedDialog(robot, i + ": A document modal " +
+                            "dialog blocking the parent frame was closed.");
+                    }
+                }
+            } // synchronized
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private boolean isToolkitModal(int i) { return (i % 3 == 2); }
+
+    private String getType(int i) {
+
+        switch (dialogList.get(i).getModalityType()) {
+            case APPLICATION_MODAL:
+                return "an application modal dialog";
+            case DOCUMENT_MODAL:
+                return "a document modal dialog";
+            case TOOLKIT_MODAL:
+                return "a toolkit modal dialog";
+        }
+        return "a modeless dialog";
+    }
+
+    public void closeAll() {
+
+        if (frame != null) { frame.dispose(); }
+        if (dialogList != null) {
+            Iterator<CustomDialog> it = dialogList.iterator();
+            while (it.hasNext()) { it.next().dispose(); }
+        }
+    }
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if ((dialogList != null) && (dialogList.size() > dialogCount)) {
+                dialogCount++;
+                CustomDialog d = dialogList.get(dialogCount);
+                if (d != null) { d.setVisible(true); }
+            }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Frame frame) { super(frame); }
+
+        @Override
+        public void doCloseAction() { this.dispose(); }
+
+        @Override
+        public void doOpenAction() {
+            if ((dialogList != null) && (dialogList.size() > dialogCount)) {
+                dialogCount++;
+                if (dialogList.get(dialogCount) != null) {
+                    dialogList.get(dialogCount).setVisible(true);
+                }
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        (new MultipleDialogs2Test()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/MultipleDialogs/MultipleDialogs3Test.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,286 @@
+/*
+ * 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 8054358
+ * @summary Check correctness of modal blocking behavior for a chain of Dialogs
+ *          having different modality types with a Frame as a document root.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main/timeout=500 MultipleDialogs3Test
+ */
+
+
+import java.awt.*;
+import static jdk.testlibrary.Asserts.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
+import java.util.Iterator;
+
+
+public class MultipleDialogs3Test {
+
+    private volatile CustomFrame  frame;
+    private List<CustomDialog> dialogList;
+    private static int delay = 500;
+
+    private int dialogCount = -1;
+
+    public void createGUI() {
+
+        final int n = 8;
+        dialogList = new ArrayList<>();
+
+        frame = new CustomFrame();
+        frame.setLocation(50, 50);
+        frame.setVisible(true);
+
+        int x = 250;
+        int y = 50;
+        for (int i = 0; i < n; ++i) {
+
+            CustomDialog dlg;
+            if (i == 0) {
+                dlg = new CustomDialog(frame);
+            } else {
+                dlg = new CustomDialog(dialogList.get(i - 1));
+            }
+            dlg.setLocation(x, y);
+            x += 200;
+            if (x > 600) {
+                x = 50;
+                y += 200;
+            }
+
+            Dialog.ModalityType type;
+
+            if (i % 4 == 0) {
+                type = Dialog.ModalityType.MODELESS;
+            } else if (i % 4 == 1) {
+                type = Dialog.ModalityType.DOCUMENT_MODAL;
+            } else if (i % 4 == 2) {
+                type = Dialog.ModalityType.APPLICATION_MODAL;
+            } else {
+                type = Dialog.ModalityType.TOOLKIT_MODAL;
+            }
+
+            dlg.setModalityType(type);
+            dialogList.add(dlg);
+        }
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+            EventQueue.invokeAndWait(this::createGUI);
+
+            ExtendedRobot robot = new ExtendedRobot();
+            robot.waitForIdle(delay);
+
+            frame.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            List<CustomDialog> dialogs = Collections.synchronizedList(dialogList);
+            final int n = dialogs.size();
+
+            synchronized(dialogs) {
+                for (int i = 0; i < n; ++i) {
+                    dialogs.get(i).activated.waitForFlagTriggered();
+                    assertTrue(dialogs.get(i).activated.flag(), i + ": Dialog did not " +
+                        "trigger windowActivated event when it became visible.");
+
+                    dialogs.get(i).closeGained.waitForFlagTriggered();
+                    assertTrue(dialogs.get(i).closeGained.flag(), i + ": Close button " +
+                        "did not gain focus when Dialog became visible.");
+
+                    assertTrue(dialogs.get(i).closeButton.hasFocus(), i +
+                        ": Close button gained focus but then lost it.");
+
+                    dialogs.get(i).checkUnblockedDialog(robot,
+                        i + ": The dialog shouldn't be blocked.");
+
+                    if (i == 0) {
+                        assertTrue(dialogs.get(0).getModalityType() ==
+                            Dialog.ModalityType.MODELESS, "0: invalid modality type.");
+
+                        frame.checkUnblockedFrame(robot, i + ": A modeless dialog was " +
+                            "shown, but the parent frame became blocked.");
+
+                    } else {
+                        if (i % 4 == 0) { // modeless dialog
+                            assertTrue(dialogs.get(i).getModalityType() ==
+                                Dialog.ModalityType.MODELESS, i +
+                                ": incorrect dialog modality type.");
+
+                            dialogs.get(i - 1).checkUnblockedDialog(robot, i + ": A modeless " +
+                                "dialog was shown, but the parent dialog became blocked.");
+
+                            if (i > 0) {
+                                for (int j = 0; j < i - 1; ++j) {
+
+                                    dialogs.get(j).checkBlockedDialog(robot, i + ", " + j +
+                                        ": Showing a modeless dialog as a child of a " +
+                                        "modal dialog unblocked some dialog in its hierarchy.");
+                                }
+                            }
+                        } else {
+
+                            for (int j = 0; j < i; ++j) {
+
+                                dialogs.get(j).checkBlockedDialog(robot, i + ", " + j +
+                                    ": A modal dialog was shown, but some dialog " +
+                                    "in its hierarchy became unblocked.");
+                            }
+                        }
+
+                        frame.checkBlockedFrame(robot, i + ": A modal was dialog shown, " +
+                            "but the document root frame became unblocked.");
+                    }
+
+                    if (i != n - 1) {
+                        dialogs.get(i).clickOpenButton(robot);
+                        robot.waitForIdle(delay);
+                    }
+                }
+
+                for (int i = n - 1; i >= 0; --i) {
+
+                    resetAll();
+                    dialogs.get(i).clickCloseButton(robot);
+                    robot.waitForIdle(delay);
+
+                    if (i > 0) {
+
+                        dialogs.get(i - 1).activated.waitForFlagTriggered();
+                        assertTrue(dialogs.get(i - 1).activated.flag(), i + ": Dialog " +
+                            "was not activated when a child dialog was closed.");
+
+                        if (i == 1) {
+
+                            frame.checkUnblockedFrame(robot, "1: Frame having " +
+                                "a child modeless dialog was blocked.");
+
+                            dialogs.get(0).checkUnblockedDialog(robot,
+                                "0: A modeless dialog at the bottom " +
+                                "of the hierarchy was blocked.");
+
+                        } else if ((i - 1) % 4 == 0) { // dialog[i - 1] is modeless
+
+                            for (int j = 0; j < i - 2; ++j) {
+
+                                dialogs.get(j).checkBlockedDialog(robot, i + ", " + j +
+                                    ": A dialog in the hierarchy was not blocked. " +
+                                    "A dialog blocking a modeless dialog was closed.");
+                            }
+
+                            dialogs.get(i - 2).checkUnblockedDialog(robot, i + ": A modal " +
+                                "dialog having a child modeless dialog was blocked.");
+
+                            dialogs.get(i - 1).checkUnblockedDialog(robot, i + ": A modeless " +
+                                "dialog at the bottom of the hierarchy was blocked.");
+
+                            frame.checkBlockedFrame(robot, i +
+                                ": Frame having a child modal dialog was not blocked.");
+
+                        } else {
+                            for (int j = 0; j <= i - 2; ++j) {
+                                dialogs.get(j).checkBlockedDialog(robot, i + ", " + j +
+                                    ": A dialog in the hierarchy was not blocked. " +
+                                    "A child dialog was closed.");
+                            }
+
+                            dialogs.get(i - 1).checkUnblockedDialog(robot, (i - 1) +
+                                ": A dialog was not unblocked when the modal dialog was closed.");
+
+                            frame.checkBlockedFrame(robot, i + ": Frame having " +
+                                "a child modal dialog was not blocked. " +
+                                "Another child dialog was closed.");
+                        }
+                    } else {
+                        frame.activated.waitForFlagTriggered();
+                        assertTrue(frame.activated.flag(), i + ": Frame was not " +
+                            "activated when a child dialog was closed.");
+                    }
+                }
+            } // synchronized
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    private void resetAll() {
+        frame.resetStatus();
+        Iterator<CustomDialog> it = dialogList.iterator();
+        while (it.hasNext()) { it.next().resetStatus(); }
+    }
+
+    public void closeAll() {
+        if (frame != null) { frame.dispose(); }
+        if (dialogList != null) {
+            Iterator<CustomDialog> it = dialogList.iterator();
+            while (it.hasNext()) { it.next().dispose(); }
+        }
+    }
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if ((dialogList != null) && (dialogList.size() > dialogCount)) {
+                dialogCount++;
+                CustomDialog d = dialogList.get(dialogCount);
+                if (d != null) { d.setVisible(true); }
+            }
+        }
+    }
+
+    class CustomDialog extends TestDialog {
+
+        public CustomDialog(Frame frame)   { super(frame); }
+        public CustomDialog(Dialog dialog) { super(dialog); }
+
+        @Override
+        public void doCloseAction() { this.dispose(); }
+
+        @Override
+        public void doOpenAction() {
+            if ((dialogList != null) && (dialogList.size() > dialogCount)) {
+                dialogCount++;
+                CustomDialog d = dialogList.get(dialogCount);
+                if (d != null) { d.setVisible(true); }
+            }
+        }
+    }
+
+
+    public static void main(String[] args) throws Exception {
+        (new MultipleDialogs3Test()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/MultipleDialogs/MultipleDialogs4Test.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,178 @@
+/*
+ * 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 8054358 8055003
+ * @summary Check whether application and document modality levels for Dialog
+ *          work properly. Also check whether the blocking dialogs are
+ *          opening on top of the windows they block.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @run main MultipleDialogs4Test
+ */
+
+
+import java.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+
+public class MultipleDialogs4Test {
+
+    private volatile TopLevelFrame frame;
+    private volatile CustomFrame   secondFrame;
+    private volatile TestFrame     thirdFrame;
+    private volatile TestDialog    dialog, secondDialog, docChildDialog, appChildDialog;
+
+    private static final int delay = 500;
+
+
+    private void createGUI() {
+
+        frame = new TopLevelFrame();
+        frame.setLocation(50, 50);
+        frame.setVisible(true);
+
+        dialog = new TestDialog((Dialog) null);
+        dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
+        dialog.setLocation(150, 50);
+
+        appChildDialog = new TestDialog(dialog);
+        appChildDialog.setLocation(150, 90);
+
+        secondFrame = new CustomFrame();
+        secondFrame.setLocation(50, 250);
+
+        secondDialog = new TestDialog(secondFrame);
+        secondDialog.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);
+        secondDialog.setLocation(150, 250);
+
+        docChildDialog = new TestDialog(secondFrame);
+        docChildDialog.setBackground(Color.black);
+        docChildDialog.setLocation(250, 250);
+
+        thirdFrame = new TestFrame();
+        thirdFrame.setLocation(250, 50);
+    }
+
+    public void doTest() throws Exception {
+
+        try {
+            EventQueue.invokeAndWait(this::createGUI);
+
+            final int nAttempts = 3;
+            ExtendedRobot robot = new ExtendedRobot();
+            robot.waitForIdle(delay);
+
+            frame.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            secondFrame.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            secondFrame.checkBlockedFrame(robot,
+                "A document modal dialog should block this Frame.");
+
+            secondDialog.checkUnblockedDialog(robot, "This is a document " +
+                "modal dialog. No window blocks it.");
+
+            frame.checkUnblockedFrame(robot,
+                "There are no dialogs blocking this Frame.");
+
+            frame.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+
+            frame.clickDummyButton(robot, nAttempts, false,
+                "The frame still on top even after showing a modal dialog.");
+            robot.waitForIdle(delay);
+
+            EventQueue.invokeAndWait(() -> { thirdFrame.setVisible(true); });
+            robot.waitForIdle(delay);
+
+            dialog.clickDummyButton(robot);
+            robot.waitForIdle(delay);
+
+            secondDialog.clickDummyButton(
+                robot, nAttempts, false, "The document modal dialog " +
+                "was not blocked by an application modal dialog.");
+            robot.waitForIdle(delay);
+
+            EventQueue.invokeLater(() -> { docChildDialog.setVisible(true); });
+            robot.waitForIdle(delay);
+
+            Color c = robot.getPixelColor(
+                (int) secondDialog.getLocationOnScreen().x + secondDialog.getSize().width  - 25,
+                (int) secondDialog.getLocationOnScreen().y + secondDialog.getSize().height - 25);
+            assertFalse(c.equals(Color.black), "A dialog which should be blocked " +
+                "by document modal dialog overlapping it.");
+
+            EventQueue.invokeLater(() -> { appChildDialog.setVisible(true); });
+            robot.waitForIdle(delay);
+
+            appChildDialog.activated.waitForFlagTriggered();
+            assertTrue(appChildDialog.activated.flag(), "The child dialog of the " +
+                "application modal dialog still not visible.");
+            robot.waitForIdle(delay);
+
+            dialog.clickDummyButton(robot, nAttempts, false, "The child dialog of " +
+                "the application modal dialog did not overlap it.");
+            robot.waitForIdle(delay);
+
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll);
+        }
+    }
+
+    public void closeAll() {
+
+        if (frame != null) { frame.dispose(); }
+        if (dialog != null) { dialog.dispose(); }
+        if (appChildDialog != null) { appChildDialog.dispose(); }
+        if (secondFrame != null) { secondFrame.dispose(); }
+        if (secondDialog != null) { secondDialog.dispose(); }
+        if (docChildDialog != null) { docChildDialog.dispose(); }
+        if (thirdFrame != null) { thirdFrame.dispose(); }
+    }
+
+    class TopLevelFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() { secondFrame.setVisible(true); }
+        @Override
+        public void doCloseAction() { dialog.setVisible(true); }
+    }
+
+    class CustomFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() { secondDialog.setVisible(true); }
+    }
+
+    public static void main(String[] args) throws Exception {
+        (new MultipleDialogs4Test()).doTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Modal/MultipleDialogs/MultipleDialogs5Test.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,184 @@
+/*
+ * 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 8054358
+ * @summary This is a simple check if a chain of dialogs having different
+  *         modality types block each other properly.
+ *
+ * @library ../helpers ../../../../lib/testlibrary/
+ * @build ExtendedRobot
+ * @build Flag
+ * @build TestDialog
+ * @build TestFrame
+ * @build TestWindow
+ * @run main MultipleDialogs5Test
+ */
+
+
+import java.awt.*;
+import static jdk.testlibrary.Asserts.*;
+
+
+public class MultipleDialogs5Test {
+
+    private volatile ParentFrame parent;
+    private volatile ModalDialog appDialog, docDialog, tkDialog;
+    private volatile CustomWindow window;
+
+    private static int delay = 500;
+
+    private void createGUI() {
+
+        parent = new ParentFrame();
+        parent.setLocation(50, 50);
+        parent.setVisible(true);
+
+        appDialog = new ModalDialog(parent);
+        appDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
+        appDialog.setLocation(250, 50);
+
+        docDialog = new ModalDialog(appDialog);
+        docDialog.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);
+        docDialog.setLocation(450, 50);
+
+        window = new CustomWindow(docDialog);
+        window.setLocation(50, 250);
+
+        tkDialog = new ModalDialog(docDialog);
+        tkDialog.setLocation(250, 250);
+        tkDialog.setModalityType(Dialog.ModalityType.TOOLKIT_MODAL);
+
+        appDialog.setWindowToOpen(docDialog);
+        docDialog.setWindowToOpen(window);
+    }
+
+    public void doTest() throws Exception {
+
+         try {
+            EventQueue.invokeAndWait(this::createGUI);
+
+            ExtendedRobot robot = new ExtendedRobot();
+            robot.waitForIdle(delay);
+
+            parent.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            parent.checkBlockedFrame(robot,
+                "This Frame is blocked by an application modal dialog.");
+
+            appDialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            appDialog.checkBlockedDialog(robot,
+                "This Dialog is blocked by a document modal dialog.");
+
+            docDialog.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            docDialog.checkUnblockedDialog(robot,
+                "This Dialog is not blocked by any modal dialog.");
+
+            window.clickOpenButton(robot);
+            robot.waitForIdle(delay);
+
+            window.checkBlockedWindow(robot,
+                "This Window is blocked by a toolkit modal dialog.");
+
+            tkDialog.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+            assertFalse(tkDialog.isVisible(),
+                "The toolkit modal dialog was not disposed.");
+
+            window.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+            assertFalse(window.isVisible(),
+                "The window was not disposed.");
+
+            docDialog.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+            assertFalse(docDialog.isVisible(),
+                "The document modal dialog was not disposed.");
+
+            appDialog.clickCloseButton(robot);
+            robot.waitForIdle(delay);
+            assertFalse(appDialog.isVisible(),
+                "The application modal dialog was not disposed.");
+        } finally {
+            EventQueue.invokeAndWait(this::closeAll); // if something wasn't closed
+        }
+    }
+
+    private void closeAll() {
+
+        if (appDialog != null) { appDialog.dispose(); }
+        if (tkDialog  != null) {  tkDialog.dispose(); }
+        if (docDialog != null) { docDialog.dispose(); }
+        if (parent != null) { parent.dispose(); }
+        if (window != null) { window.dispose(); }
+    }
+
+    private class ParentFrame extends TestFrame {
+
+        @Override
+        public void doOpenAction() {
+            if (appDialog != null) { appDialog.setVisible(true); }
+        }
+    }
+
+    private class CustomWindow extends TestWindow {
+
+        public CustomWindow(Dialog d) { super(d); }
+
+        @Override
+        public void doOpenAction() {
+            if (tkDialog != null) { tkDialog.setVisible(true); }
+        }
+
+        @Override
+        public void doCloseAction() { this.dispose(); }
+    }
+
+    private class ModalDialog extends TestDialog {
+
+        private Window w;
+
+        public ModalDialog(Frame  f) { super(f); }
+        public ModalDialog(Dialog d) { super(d); }
+
+        public void setWindowToOpen(Window w) { this.w = w; }
+
+        @Override
+        public void doCloseAction() { this.dispose(); }
+
+        @Override
+        public void doOpenAction() {
+            if (w != null) { w.setVisible(true); }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        (new MultipleDialogs5Test()).doTest();
+    }
+}
--- a/test/java/awt/regtesthelpers/Util.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/java/awt/regtesthelpers/Util.java	Sat Jan 24 23:23:25 2015 -0800
@@ -76,12 +76,17 @@
 public final class Util {
     private Util() {} // this is a helper class with static methods :)
 
+    private volatile static Robot robot;
+
     /*
      * @throws RuntimeException when creation failed
      */
     public static Robot createRobot() {
         try {
-            return new Robot();
+            if (robot == null) {
+                robot = new Robot();
+            }
+            return robot;
         } catch (AWTException e) {
             throw new RuntimeException("Error: unable to create robot", e);
         }
@@ -200,7 +205,10 @@
         return false;
     }
 
-    public static void waitForIdle(final Robot robot) {
+    public static void waitForIdle(Robot robot) {
+        if (robot == null) {
+            robot = createRobot();
+        }
         robot.waitForIdle();
     }
 
--- a/test/java/lang/Class/GenericStringTest.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/java/lang/Class/GenericStringTest.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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,10 +34,29 @@
 
 @ExpectedGenericString("public class GenericStringTest")
 public class GenericStringTest {
-    public static void main(String... args){
+    public Map<String, Integer>[] mixed = null;
+    public Map<String, Integer>[][] mixed2 = null;
+
+    public static void main(String... args) throws ReflectiveOperationException {
         int failures = 0;
 
+        String[][] nested = {{""}};
+        int[][]    intArray = {{1}};
+
         failures += checkToGenericString(int.class, "int");
+        failures += checkToGenericString(void.class, "void");
+        failures += checkToGenericString(args.getClass(), "java.lang.String[]");
+        failures += checkToGenericString(nested.getClass(), "java.lang.String[][]");
+        failures += checkToGenericString(intArray.getClass(), "int[][]");
+        failures += checkToGenericString(java.util.Map.class, "public abstract interface java.util.Map<K,V>");
+
+        Field f = GenericStringTest.class.getDeclaredField("mixed");
+        // The expected value includes "<K,V>" rather than
+        // "<...String,...Integer>" since the Class object rather than
+        // Type objects is being queried.
+        failures += checkToGenericString(f.getType(), "java.util.Map<K,V>[]");
+        f = GenericStringTest.class.getDeclaredField("mixed2");
+        failures += checkToGenericString(f.getType(), "java.util.Map<K,V>[][]");
 
         Class<?>[] types = {
             GenericStringTest.class,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/ClassLoader/LibraryPathProperty.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8067951
+ * @summary Unit test for internal ClassLoader#initializePath().
+ *          Quoted entries should get unquoted on Windows.
+ *          Empty entries should be replaced with dot.
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.Platform
+ * @run main LibraryPathProperty
+ */
+
+import java.lang.reflect.Method;
+import java.io.File;
+import java.util.Arrays;
+import jdk.testlibrary.Platform;
+
+public class LibraryPathProperty {
+
+    static final String propName = "test.property.name";
+    static final String SP = File.pathSeparator;
+    static Method method;
+
+    public static void main(String[] args) throws Throwable {
+        method = ClassLoader.class
+                .getDeclaredMethod("initializePath",
+                                   String.class);
+        method.setAccessible(true);
+
+        test("", ".");
+        test(SP, ".", ".");
+        test("a" + SP, "a", ".");
+        test(SP + "b", ".", "b");
+        test("a" + SP + SP + "b", "a", ".", "b");
+
+        if (Platform.isWindows()) {
+            // on Windows parts of paths may be quoted
+            test("\"\"", ".");
+            test("\"\"" + SP, ".", ".");
+            test(SP + "\"\"", ".", ".");
+            test("a" + SP + "\"b\"" + SP, "a", "b", ".");
+            test(SP + "\"a\"" + SP + SP + "b", ".", "a", ".", "b");
+            test("\"a\"" + SP + "\"b\"", "a", "b");
+            test("\"/a/\"b" + SP + "c", "/a/b", "c");
+            test("\"/a;b\"" + SP + "c", "/a;b", "c");
+            test("\"/a:b\"" + SP + "c", "/a:b", "c");
+            test("\"/a" + SP + "b\"" + SP + "c", "/a" + SP + "b", "c");
+            test("/\"a\"\";\"\"b\"" + SP + "\"c\"", "/a;b", "c");
+            test("/\"a:\"b" + SP + "c", "/a:b", "c");
+        }
+    }
+
+    static void test(String s, String... expected) throws Throwable {
+        System.setProperty(propName, s);
+        String[] res = (String[])method.invoke(null, propName);
+        if (!Arrays.asList(res).equals(Arrays.asList(expected))) {
+            throw new RuntimeException("Parsing [" + s + "] " +
+                    " result " + Arrays.asList(res) +
+                    " doesn't match " + Arrays.asList(expected));
+        }
+    }
+}
--- a/test/java/lang/management/MemoryMXBean/LowMemoryTest.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/java/lang/management/MemoryMXBean/LowMemoryTest.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, 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,15 +34,16 @@
  * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
  * @requires vm.opt.ExplicitGCInvokesConcurrent == "false" | vm.opt.ExplicitGCInvokesConcurrent == "null"
  * @run main/timeout=600 LowMemoryTest
+ * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
+ * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
+ * @requires vm.opt.DisableExplicitGC != "true"
  */
 
-import com.sun.management.DiagnosticCommandMBean;
 import java.lang.management.*;
 import java.util.*;
 import java.util.concurrent.Phaser;
 import javax.management.*;
 import javax.management.openmbean.CompositeData;
-import sun.management.ManagementFactoryHelper;
 
 public class LowMemoryTest {
     private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
--- a/test/java/net/URI/Test.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/java/net/URI/Test.java	Sat Jan 24 23:23:25 2015 -0800
@@ -24,7 +24,7 @@
 /* @test
  * @summary Unit test for java.net.URI
  * @bug 4464135 4505046 4503239 4438319 4991359 4866303 7023363 7041800
- *      7171415
+ *      7171415 6933879
  * @author Mark Reinhold
  */
 
@@ -1600,6 +1600,7 @@
 
     static void bugs() {
         b6339649();
+        b6933879();
         b8037396();
     }
 
@@ -1614,6 +1615,18 @@
         }
     }
 
+    // 6933879 - check that "." and "_" characters are allowed in IPv6 scope_id.
+    private static void b6933879() {
+        final String HOST = "fe80::c00:16fe:cebe:3214%eth1.12_55";
+        URI uri;
+        try {
+            uri = new URI("http", null, HOST, 10, "/", null, null);
+        } catch (URISyntaxException ex) {
+            throw new AssertionError("Should not happen", ex);
+        }
+        eq("[" + HOST + "]", uri.getHost());
+    }
+
     private static void b8037396() {
 
         // primary checks:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/Hashtable/DeserializedLength.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+
+import java.io.*;
+import java.lang.reflect.Field;
+import java.util.Hashtable;
+
+/**
+ * @test
+ * @bug 8068427
+ * @summary Hashtable deserialization reconstitutes table with wrong capacity
+ */
+public class DeserializedLength {
+
+    static boolean testDeserializedLength(int elements, float loadFactor) throws Exception {
+
+        // construct Hashtable with minimal initial capacity and given loadFactor
+        Hashtable<Integer, Integer> ht1 = new Hashtable<>(1, loadFactor);
+
+        // add given number of unique elements
+        for (int i = 0; i < elements; i++) {
+            ht1.put(i, i);
+        }
+
+        // serialize and deserialize into a deep clone
+        Hashtable<Integer, Integer> ht2 = serialClone(ht1);
+
+        // compare lengths of internal tables
+        Object[] table1 = (Object[]) hashtableTableField.get(ht1);
+        Object[] table2 = (Object[]) hashtableTableField.get(ht2);
+        assert table1 != null;
+        assert table2 != null;
+
+        int minLength = (int) (ht1.size() / loadFactor) + 1;
+        int maxLength = minLength * 2;
+
+        boolean ok = (table2.length >= minLength && table2.length <= maxLength);
+
+        System.out.printf(
+            "%7d %5.2f %7d %7d %7d...%7d %s\n",
+            ht1.size(), loadFactor,
+            table1.length, table2.length,
+            minLength, maxLength,
+            (ok ? "OK" : "NOT-OK")
+        );
+
+        return ok;
+    }
+
+    static <T> T serialClone(T o) throws IOException, ClassNotFoundException {
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
+            oos.writeObject(o);
+        }
+        @SuppressWarnings("unchecked")
+        T clone = (T) new ObjectInputStream(
+            new ByteArrayInputStream(bos.toByteArray())).readObject();
+        return clone;
+    }
+
+    private static final Field hashtableTableField;
+
+    static {
+        try {
+            hashtableTableField = Hashtable.class.getDeclaredField("table");
+            hashtableTableField.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new Error(e);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        boolean ok = true;
+
+        System.out.printf("Results:\n" +
+                "                 ser.  deser.\n" +
+                "   size  load  lentgh  length       valid range ok?\n" +
+                "------- ----- ------- ------- ----------------- ------\n"
+        );
+
+        for (int elements : new int[]{10, 50, 500, 5000}) {
+            for (float loadFactor : new float[]{0.15f, 0.5f, 0.75f, 1.0f, 2.5f}) {
+                ok &= testDeserializedLength(elements, loadFactor);
+            }
+        }
+        if (!ok) {
+            throw new AssertionError("Test failed.");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,112 @@
+/*
+ * 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 org.testng.Assert;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
+
+
+/**
+ * @test
+ * @bug 8068432
+ * @run testng ThenComposeExceptionTest
+ * @summary Test that CompletableFuture.thenCompose works correctly if the
+ * composing future completes exceptionally
+ */
+@Test
+public class ThenComposeExceptionTest {
+
+    static final BiFunction<CompletableFuture<String>, CompletableFuture<String>, CompletableFuture<String>>
+            THEN_COMPOSE = (f, fe) -> f.thenCompose(s -> fe);
+
+    static final BiFunction<CompletableFuture<String>, CompletableFuture<String>, CompletableFuture<String>>
+            THEN_COMPOSE_ASYNC = (f, fe) -> f.thenComposeAsync(s -> fe);
+
+    static final Consumer<CompletableFuture<String>>
+            COMPLETE_EXCEPTIONALLY = f -> f.completeExceptionally(new RuntimeException());
+
+    static final Consumer<CompletableFuture<String>>
+            NOP = f -> { };
+
+    static Object[][] actionsDataProvider;
+
+    @DataProvider(name = "actions")
+    static Object[][] actionsDataProvider() {
+        if (actionsDataProvider != null) {
+            return actionsDataProvider;
+        }
+
+        List<Object[]> data = new ArrayList<>();
+        data.add(new Object[]{"thenCompose and completeExceptionally", NOP, THEN_COMPOSE, COMPLETE_EXCEPTIONALLY});
+        data.add(new Object[]{"thenComposeAsync and completeExceptionally", NOP, THEN_COMPOSE_ASYNC, COMPLETE_EXCEPTIONALLY});
+        data.add(new Object[]{"completeExceptionally and thenCompose", COMPLETE_EXCEPTIONALLY, THEN_COMPOSE, NOP});
+        data.add(new Object[]{"completeExceptionally and thenComposeAsync", COMPLETE_EXCEPTIONALLY, THEN_COMPOSE_ASYNC, NOP});
+
+        return actionsDataProvider = data.toArray(new Object[0][]);
+    }
+
+    @Test(dataProvider = "actions")
+    public void testThenCompose(
+            String description,
+            Consumer<CompletableFuture<String>> beforeAction,
+            BiFunction<CompletableFuture<String>, CompletableFuture<String>, CompletableFuture<String>> composeFunction,
+            Consumer<CompletableFuture<String>> afterAction) throws Exception {
+        CompletableFuture<String> f = new CompletableFuture<>();
+        CompletableFuture<String> fe = new CompletableFuture<>();
+
+        // Ensure pre-composed stage is completed to trigger
+        // processing the composing future
+        f.complete("");
+
+        beforeAction.accept(fe);
+
+        CompletableFuture<String> f_thenCompose = composeFunction.apply(f, fe);
+        Assert.assertNotSame(f_thenCompose, fe, "Composed CompletableFuture returned directly");
+
+        AtomicReference<Throwable> eOnWhenComplete = new AtomicReference<>();
+        f_thenCompose.whenComplete((r, e) -> eOnWhenComplete.set(e));
+
+        afterAction.accept(fe);
+
+        Throwable eOnJoined = null;
+        try {
+            f_thenCompose.join();
+        }
+        catch (Throwable t) {
+            eOnJoined = t;
+        }
+
+        Assert.assertTrue(eOnWhenComplete.get() instanceof CompletionException,
+                          "Incorrect exception reported on whenComplete");
+        Assert.assertTrue(eOnJoined instanceof CompletionException,
+                          "Incorrect exception reported when joined");
+    }
+}
--- a/test/javax/net/ssl/SSLSession/TestEnabledProtocols.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/javax/net/ssl/SSLSession/TestEnabledProtocols.java	Sat Jan 24 23:23:25 2015 -0800
@@ -120,6 +120,10 @@
     volatile Exception clientException = null;
 
     public static void main(String[] args) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
+
         String keyFilename =
             System.getProperty("test.src", "./") + "/" + pathToStores +
                 "/" + keyStoreFile;
--- a/test/javax/net/ssl/ServerName/SSLEngineExplorer.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/javax/net/ssl/ServerName/SSLEngineExplorer.java	Sat Jan 24 23:23:25 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
@@ -44,6 +44,7 @@
 import java.net.*;
 import java.util.*;
 import java.nio.channels.*;
+import java.security.Security;
 
 public class SSLEngineExplorer extends SSLEngineService {
 
@@ -231,6 +232,10 @@
     volatile int serverPort = 0;
 
     public static void main(String args[]) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
+
         if (debug)
             System.setProperty("javax.net.debug", "all");
 
--- a/test/javax/net/ssl/ServerName/SSLSocketExplorer.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/javax/net/ssl/ServerName/SSLSocketExplorer.java	Sat Jan 24 23:23:25 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
@@ -45,6 +45,7 @@
 import java.util.*;
 import java.net.*;
 import javax.net.ssl.*;
+import java.security.Security;
 
 public class SSLSocketExplorer {
 
@@ -224,6 +225,10 @@
     volatile Exception clientException = null;
 
     public static void main(String[] args) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
+
         String keyFilename =
             System.getProperty("test.src", ".") + "/" + pathToStores +
                 "/" + keyStoreFile;
--- a/test/javax/net/ssl/TLS/TLSClientPropertyTest.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/javax/net/ssl/TLS/TLSClientPropertyTest.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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,8 +29,10 @@
 
 /*
  * @test
- * @bug 8049432
+ * @bug 8049432 8069038
  * @summary New tests for TLS property jdk.tls.client.protocols
+ * @summary javax/net/ssl/TLS/TLSClientPropertyTest.java needs to be
+ *     updated for JDK-8061210
  * @run main/othervm TLSClientPropertyTest NoProperty
  * @run main/othervm TLSClientPropertyTest SSLv3
  * @run main/othervm TLSClientPropertyTest TLSv1
@@ -46,7 +48,7 @@
  * protocols in the SSLContext.
  */
 public class TLSClientPropertyTest {
-    private final String[] expecteSupportedProtos = new String[] {
+    private final String[] expectedSupportedProtos = new String[] {
             "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"
     };
 
@@ -67,31 +69,30 @@
             }
             contextProtocol = null;
             expectedDefaultProtos = new String[] {
-                    "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"
+                    "TLSv1", "TLSv1.1", "TLSv1.2"
             };
             break;
         case "SSLv3":
             contextProtocol = "SSLv3";
             expectedDefaultProtos = new String[] {
-                    "SSLv3"
             };
             break;
         case "TLSv1":
             contextProtocol = "TLSv1";
             expectedDefaultProtos = new String[] {
-                    "SSLv3", "TLSv1"
+                    "TLSv1"
             };
             break;
         case "TLSv11":
             contextProtocol = "TLSv1.1";
             expectedDefaultProtos = new String[] {
-                    "SSLv3", "TLSv1", "TLSv1.1"
+                    "TLSv1", "TLSv1.1"
             };
             break;
         case "TLSv12":
             contextProtocol = "TLSv1.2";
             expectedDefaultProtos = new String[] {
-                    "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"
+                    "TLSv1", "TLSv1.1", "TLSv1.2"
             };
             break;
         case "WrongProperty":
@@ -182,12 +183,12 @@
             expectedProto = "Default";
         }
         if (!context.getProtocol().equals(expectedProto)) {
-            error("Invalid current protocol:" + context.getProtocol()
+            error("Invalid current protocol: " + context.getProtocol()
                     + ", Expected:" + expectedProto, null);
         }
         List<String> actualDefaultProtos = Arrays.asList(context
                 .getDefaultSSLParameters().getProtocols());
-        for (String p: expectedDefaultProtos) {
+        for (String p : expectedDefaultProtos) {
             if (!actualDefaultProtos.contains(p)) {
                 error("Default protocol " + p + "missing", null);
             }
@@ -195,7 +196,7 @@
         List<String> actualSupportedProtos = Arrays.asList(context
                 .getSupportedSSLParameters().getProtocols());
 
-        for (String p: expecteSupportedProtos) {
+        for (String p : expectedSupportedProtos) {
             if (!actualSupportedProtos.contains(p)) {
                 error("Expected to support protocol:" + p, null);
             }
--- a/test/javax/net/ssl/TLS/TestJSSE.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/javax/net/ssl/TLS/TestJSSE.java	Sat Jan 24 23:23:25 2015 -0800
@@ -78,6 +78,10 @@
     private static final String LOCAL_IP = "127.0.0.1";
 
     public static void main(String... args) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
+
         String serverProtocol = System.getProperty("SERVER_PROTOCOL");
         String clientProtocol = System.getProperty("CLIENT_PROTOCOL");
         int port = jdk.testlibrary.Utils.getFreePort();
--- a/test/javax/net/ssl/sanity/interop/ClientJSSEServerJSSE.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/javax/net/ssl/sanity/interop/ClientJSSEServerJSSE.java	Sat Jan 24 23:23:25 2015 -0800
@@ -33,6 +33,10 @@
 public class ClientJSSEServerJSSE {
 
     public static void main(String[] args) throws Exception {
+        // reset the security property to make sure that the algorithms
+        // and keys used in this test are not disabled.
+        Security.setProperty("jdk.tls.disabledAlgorithms", "");
+
         // MD5 is used in this test case, don't disable MD5 algorithm.
         Security.setProperty(
                 "jdk.certpath.disabledAlgorithms", "MD2, RSA keySize < 1024");
--- a/test/javax/sql/testng/test/rowset/BaseRowSetTests.java	Fri Jan 23 18:50:48 2015 -0800
+++ b/test/javax/sql/testng/test/rowset/BaseRowSetTests.java	Sat Jan 24 23:23:25 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -30,13 +30,9 @@
 import java.sql.Array;
 import java.sql.Blob;
 import java.sql.Clob;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
 import java.sql.Date;
 import java.sql.Ref;
-import java.sql.RowId;
-import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLException;
 import java.sql.Time;
 import java.sql.Timestamp;
 import java.sql.Types;
@@ -44,407 +40,74 @@
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.util.Calendar;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import javax.sql.RowSet;
 import javax.sql.rowset.serial.SerialArray;
 import javax.sql.rowset.serial.SerialBlob;
 import javax.sql.rowset.serial.SerialClob;
 import javax.sql.rowset.serial.SerialRef;
 import static org.testng.Assert.*;
-import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
-import util.BaseTest;
 import util.StubArray;
 import util.StubBaseRowSet;
 import util.StubBlob;
 import util.StubClob;
-import util.StubNClob;
 import util.StubRef;
-import util.StubRowId;
-import util.StubSQLXML;
 import util.TestRowSetListener;
 
-public class BaseRowSetTests extends BaseTest {
+public class BaseRowSetTests extends CommonRowSetTests {
 
     private StubBaseRowSet brs;
-    private StubBaseRowSet brs1;
-    private final String query = "SELECT * FROM SUPERHEROS";
-    private final String url = "jdbc:derby://localhost:1527/myDB";
-    private final String dsName = "jdbc/myDB";
-    private final String user = "Bruce Wayne";
-    private final String password = "The Dark Knight";
-    private final Date aDate = Date.valueOf(LocalDate.now());
-    private final Time aTime = Time.valueOf(LocalTime.now());
-    private final Timestamp ts = Timestamp.valueOf(LocalDateTime.now());
-    private final Calendar cal = Calendar.getInstance();
-    private final byte[] bytes = new byte[10];
-    private RowId aRowid;
-    private Ref aRef;
-    private Blob aBlob;
-    private Clob aClob;
-    private Array aArray;
-    private InputStream is;
-    private Reader rdr;
-    private Map<String, Class<?>> map = new HashMap<>();
 
-    public BaseRowSetTests() {
-        brs1 = new StubBaseRowSet();
-        is = new StringBufferInputStream(query);
-        rdr = new StringReader(query);
-        aRowid = new StubRowId();
-        try {
-            aBlob = new SerialBlob(new StubBlob());
-            aClob = new SerialClob(new StubClob());
-            aRef = new SerialRef(new StubRef("INTEGER", query));
-            aArray = new SerialArray(new StubArray("INTEGER", new Object[1]));
-            map.put("SUPERHERO", Class.forName("util.SuperHero"));
-        } catch (SQLException | ClassNotFoundException ex) {
-            Logger.getLogger(BaseRowSetTests.class.getName()).log(Level.SEVERE, null, ex);
-        }
-    }
-
-    @BeforeMethod
     @Override
-    public void setUpMethod() throws Exception {
-        brs = new StubBaseRowSet();
+    protected RowSet newInstance() throws SQLException {
+        return new StubBaseRowSet();
     }
 
     /*
-     * Validate that getCommand() returns null by default
+     * Create a RowSetListener and validate that notifyCursorMoved is called
      */
-    @Test
-    public void test() {
-        assertTrue(brs.getCommand() == null);
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0000(StubBaseRowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+        rs.notifyCursorMoved();
+        assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
     }
 
     /*
-     * Validate that getCommand() returns command specified to setCommand
+     * Create a RowSetListener and validate that notifyRowChanged is called
      */
-    @Test
-    public void test01() throws Exception {
-        brs.setCommand(query);
-        assertTrue(brs.getCommand().equals(query));
-    }
-
-    /*
-     * Validate that getCurrency() returns the correct default value
-     */
-    @Test
-    public void test02() throws Exception {
-        assertTrue(brs.getConcurrency() == ResultSet.CONCUR_UPDATABLE);
-    }
-
-    /*
-     * Validate that getCurrency() returns the correct value
-     * after a call to setConcurrency())
-     */
-    @Test(dataProvider = "concurTypes")
-    public void test03(int concurType) throws Exception {
-        brs.setConcurrency(concurType);
-        assertTrue(brs.getConcurrency() == concurType);
-    }
-
-    /*
-     * Validate that getCurrency() throws a SQLException for an invalid value
-     */
-    @Test(expectedExceptions = SQLException.class)
-    public void test04() throws Exception {
-        brs.setConcurrency(ResultSet.CLOSE_CURSORS_AT_COMMIT);
-    }
-
-    /*
-     * Validate that getDataSourceName() returns null by default
-     */
-    @Test
-    public void test05() throws Exception {
-        assertTrue(brs.getDataSourceName() == null);
-    }
-
-    /*
-     * Validate that getDataSourceName() returns the value specified
-     * by setDataSourceName() and getUrl() returns null
-     */
-    @Test
-    public void test06() throws Exception {
-        brs.setUrl(url);
-        brs.setDataSourceName(dsName);
-        assertTrue(brs.getDataSourceName().equals(dsName));
-        assertTrue(brs.getUrl() == null);
-    }
-
-    /*
-     * Validate that setDataSourceName() throws a SQLException for an empty
-     * String specified for the data source name
-     */
-    @Test(expectedExceptions = SQLException.class)
-    public void test07() throws Exception {
-        String dsname = "";
-        brs.setDataSourceName(dsname);
-    }
-
-    /*
-     * Validate that getEscapeProcessing() returns true by default
-     */
-    @Test
-    public void test08() throws Exception {
-        assertTrue(brs.getEscapeProcessing());
-    }
-
-    /*
-     * Validate that getEscapeProcessing() returns value set by
-     * setEscapeProcessing()
-     */
-    @Test(dataProvider = "trueFalse")
-    public void test09(boolean val) throws Exception {
-        brs.setEscapeProcessing(val);
-        assertTrue(brs.getEscapeProcessing() == val);
-    }
-
-    /*
-     * Validate that getFetchDirection() returns the correct default value
-     */
-    @Test
-    public void test10() throws Exception {
-        assertTrue(brs.getFetchDirection() == ResultSet.FETCH_FORWARD);
-    }
-
-    /*
-     * Validate that getFetchDirection() returns the value set by
-     * setFetchDirection()
-     */
-    @Test(dataProvider = "fetchDirection")
-    public void test11(int direction) throws Exception {
-        brs.setFetchDirection(direction);
-        assertTrue(brs.getFetchDirection() == direction);
-    }
-
-    /*
-     * Validate that setConcurrency() throws a SQLException for an invalid value
-     */
-    @Test(expectedExceptions = SQLException.class)
-    public void test12() throws Exception {
-        brs.setConcurrency(ResultSet.CLOSE_CURSORS_AT_COMMIT);
-    }
-
-    /*
-     * Validate that setFetchSize() throws a SQLException for an invalid value
-     */
-    @Test(expectedExceptions = SQLException.class)
-    public void test13() throws Exception {
-        brs.setFetchSize(-1);
-    }
-
-    /*
-     * Validate that setFetchSize() throws a SQLException for a
-     * value greater than getMaxRows()
-     */
-    @Test(expectedExceptions = SQLException.class)
-    public void test14() throws Exception {
-        brs.setMaxRows(5);
-        brs.setFetchSize(brs.getMaxRows() + 1);
-    }
-
-    /*
-     * Validate that getFetchSize() returns the correct value after
-     * setFetchSize() has been called
-     */
-    @Test
-    public void test15() throws Exception {
-        int maxRows = 150;
-        brs.setFetchSize(0);
-        assertTrue(brs.getFetchSize() == 0);
-        brs.setFetchSize(100);
-        assertTrue(brs.getFetchSize() == 100);
-        brs.setMaxRows(maxRows);
-        brs.setFetchSize(maxRows);
-        assertTrue(brs.getFetchSize() == maxRows);
-    }
-
-    /*
-     * Validate that setMaxFieldSize() throws a SQLException for an invalid value
-     */
-    @Test(expectedExceptions = SQLException.class)
-    public void test16() throws Exception {
-        brs.setMaxFieldSize(-1);
-    }
-
-    /*
-     * Validate that getMaxFieldSize() returns the value set by
-     * setMaxFieldSize()
-     */
-    @Test
-    public void test17() throws Exception {
-        brs.setMaxFieldSize(0);
-        assertTrue(brs.getMaxFieldSize() == 0);
-        brs.setMaxFieldSize(100);
-        assertTrue(brs.getMaxFieldSize() == 100);
-        brs.setMaxFieldSize(50);
-        assertTrue(brs.getMaxFieldSize() == 50);
-    }
-
-    /*
-     * Validate that isReadOnly() returns value set by
-     * setReadOnly()
-     */
-    @Test(dataProvider = "trueFalse")
-    public void test18(boolean val) throws Exception {
-        brs.setReadOnly(val);
-        assertTrue(brs.isReadOnly() == val);
-    }
-
-    /*
-     * Validate that getTransactionIsolation() returns value set by
-     * setTransactionIsolation()
-     */
-    @Test(dataProvider = "isolationTypes")
-    public void test19(int val) throws Exception {
-        brs.setTransactionIsolation(val);
-        assertTrue(brs.getTransactionIsolation() == val);
-    }
-
-    /*
-     * Validate that getType() returns value set by setType()
-     */
-    @Test(dataProvider = "scrollTypes")
-    public void test20(int val) throws Exception {
-        brs.setType(val);
-        assertTrue(brs.getType() == val);
-    }
-
-    /*
-     * Validate that getEscapeProcessing() returns value set by
-     * setEscapeProcessing()
-     */
-    @Test(dataProvider = "trueFalse")
-    public void test21(boolean val) throws Exception {
-        brs.setShowDeleted(val);
-        assertTrue(brs.getShowDeleted() == val);
-    }
-
-    /*
-     * Validate that getTypeMap() returns same value set by
-     * setTypeMap()
-     */
-    @Test()
-    public void test22() throws Exception {
-        brs.setTypeMap(map);
-        assertTrue(brs.getTypeMap().equals(map));
-    }
-
-    /*
-     * Validate that getUsername() returns same value set by
-     * setUsername()
-     */
-    @Test()
-    public void test23() throws Exception {
-        brs.setUsername(user);
-        assertTrue(brs.getUsername().equals(user));
-    }
-
-    /*
-     * Validate that getPassword() returns same password set by
-     * setPassword()
-     */
-    @Test()
-    public void test24() throws Exception {
-        brs.setPassword(password);
-        assertTrue(brs.getPassword().equals(password));
-    }
-
-    /*
-     * Validate that getQueryTimeout() returns same value set by
-     * setQueryTimeout() and that 0 is a valid timeout value
-     */
-    @Test()
-    public void test25() throws Exception {
-        int timeout = 0;
-        brs.setQueryTimeout(timeout);
-        assertTrue(brs.getQueryTimeout() == timeout);
-    }
-
-    /*
-     * Validate that getQueryTimeout() returns same value set by
-     * setQueryTimeout() and that 0 is a valid timeout value
-     */
-    @Test()
-    public void test26() throws Exception {
-        int timeout = 10000;
-        brs.setQueryTimeout(timeout);
-        assertTrue(brs.getQueryTimeout() == timeout);
-    }
-
-    /*
-     * Validate that setQueryTimeout() throws a SQLException for a timeout
-     * value < 0
-     */
-    @Test(expectedExceptions = SQLException.class)
-    public void test27() throws Exception {
-        brs.setQueryTimeout(-1);
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0001(StubBaseRowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+        rs.notifyRowChanged();
+        assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
     }
 
     /*
      * Create a RowSetListener and validate that notifyRowSetChanged is called
      */
-    @Test()
-    public void test28() throws Exception {
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0002(StubBaseRowSet rs) throws Exception {
         TestRowSetListener rsl = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.notifyRowSetChanged();
+        rs.addRowSetListener(rsl);
+        rs.notifyRowSetChanged();
         assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
     }
 
     /*
-     * Create a RowSetListener and validate that notifyRowChanged is called
-     */
-    @Test()
-    public void test29() throws Exception {
-        TestRowSetListener rsl = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.notifyRowChanged();
-        assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
-    }
-
-    /*
-     * Create a RowSetListener and validate that notifyCursorMoved is called
-     */
-    @Test()
-    public void test30() throws Exception {
-        TestRowSetListener rsl = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.notifyCursorMoved();
-        assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
-    }
-
-    /*
-     * Create a RowSetListener and validate that notifyRowSetChanged,
-     * notifyRowChanged() and notifyCursorMoved are called
-     */
-    @Test()
-    public void test31() throws Exception {
-        TestRowSetListener rsl = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.notifyRowSetChanged();
-        brs.notifyRowChanged();
-        brs.notifyCursorMoved();
-        assertTrue(rsl.isNotified(
-                TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED
-                | TestRowSetListener.ROW_CHANGED));
-    }
-
-    /*
      * Create multiple RowSetListeners and validate that notifyRowSetChanged
      * is called on all listeners
      */
-    @Test()
-    public void test32() throws Exception {
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0003(StubBaseRowSet rs) throws Exception {
         TestRowSetListener rsl = new TestRowSetListener();
         TestRowSetListener rsl2 = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.addRowSetListener(rsl2);
-        brs.notifyRowSetChanged();
+        rs.addRowSetListener(rsl);
+        rs.addRowSetListener(rsl2);
+        rs.notifyRowSetChanged();
         assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
         assertTrue(rsl2.isNotified(TestRowSetListener.ROWSET_CHANGED));
     }
@@ -453,13 +116,13 @@
      * Create multiple RowSetListeners and validate that notifyRowChanged
      * is called on all listeners
      */
-    @Test()
-    public void test33() throws Exception {
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0004(StubBaseRowSet rs) throws Exception {
         TestRowSetListener rsl = new TestRowSetListener();
         TestRowSetListener rsl2 = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.addRowSetListener(rsl2);
-        brs.notifyRowChanged();
+        rs.addRowSetListener(rsl);
+        rs.addRowSetListener(rsl2);
+        rs.notifyRowChanged();
         assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
         assertTrue(rsl2.isNotified(TestRowSetListener.ROW_CHANGED));
     }
@@ -468,30 +131,47 @@
      * Create multiple RowSetListeners and validate that notifyCursorMoved
      * is called on all listeners
      */
-    @Test()
-    public void test34() throws Exception {
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0005(StubBaseRowSet rs) throws Exception {
         TestRowSetListener rsl = new TestRowSetListener();
         TestRowSetListener rsl2 = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.addRowSetListener(rsl2);
-        brs.notifyCursorMoved();
+        rs.addRowSetListener(rsl);
+        rs.addRowSetListener(rsl2);
+        rs.notifyCursorMoved();
         assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
         assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED));
     }
 
     /*
+     * Create a RowSetListener and validate that notifyRowSetChanged,
+     * notifyRowChanged() and notifyCursorMoved are called
+     */
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0006(StubBaseRowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+        rs.notifyRowSetChanged();
+        rs.notifyRowChanged();
+        rs.notifyCursorMoved();
+        assertTrue(rsl.isNotified(
+                TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED
+                | TestRowSetListener.ROW_CHANGED));
+    }
+
+
+    /*
      * Create multiple RowSetListeners and validate that notifyRowSetChanged,
      * notifyRowChanged() and notifyCursorMoved are called on all listeners
      */
-    @Test()
-    public void test35() throws Exception {
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0007(StubBaseRowSet rs) throws Exception {
         TestRowSetListener rsl = new TestRowSetListener();
         TestRowSetListener rsl2 = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.addRowSetListener(rsl2);
-        brs.notifyRowSetChanged();
-        brs.notifyRowChanged();
-        brs.notifyCursorMoved();
+        rs.addRowSetListener(rsl);
+        rs.addRowSetListener(rsl2);
+        rs.notifyRowSetChanged();
+        rs.notifyRowChanged();
+        rs.notifyCursorMoved();
         assertTrue(rsl.isNotified(
                 TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED
                 | TestRowSetListener.ROW_CHANGED));
@@ -505,55 +185,25 @@
      * remove the listener, invoke notifyRowSetChanged again and verify the
      * listner is not called
      */
-    @Test()
-    public void test36() throws Exception {
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0008(StubBaseRowSet rs) throws Exception {
         TestRowSetListener rsl = new TestRowSetListener();
-        brs.addRowSetListener(rsl);
-        brs.notifyRowSetChanged();
+        rs.addRowSetListener(rsl);
+        rs.notifyRowSetChanged();
         assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
         // Clear the flag indicating the listener has been called
         rsl.resetFlag();
-        brs.removeRowSetListener(rsl);
-        brs.notifyRowSetChanged();
+        rs.removeRowSetListener(rsl);
+        rs.notifyRowSetChanged();
         assertFalse(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
     }
 
     /*
-     * Validate addRowSetListener does not throw an Exception when null is
-     * passed as the parameter
-     */
-    @Test()
-    public void test37() throws Exception {
-        brs.addRowSetListener(null);
-    }
-
-    /*
-     * Validate removeRowSetListener does not throw an Exception when null is
-     * passed as the parameter
-     */
-    @Test()
-    public void test38() throws Exception {
-        brs.removeRowSetListener(null);
-    }
-
-    /*
-     * Set two parameters and then validate clearParameters() will clear them
-     */
-    @Test()
-    public void test39() throws Exception {
-        brs.setInt(1, 1);
-        brs.setString(2, query);
-        assertTrue(brs.getParams().length == 2);
-        brs.clearParameters();
-        assertTrue(brs.getParams().length == 0);
-    }
-
-    /*
      * Set the base parameters and validate that the value set is
      * the correct type and value
      */
     @Test(dataProvider = "testBaseParameters")
-    public void test40(int pos, Object o) throws Exception {
+    public void baseRowSetTest0009(int pos, Object o) throws Exception {
         assertTrue(getParam(pos, o).getClass().isInstance(o));
         assertTrue(o.equals(getParam(pos, o)));
     }
@@ -563,7 +213,7 @@
      * the correct type
      */
     @Test(dataProvider = "testAdvancedParameters")
-    public void test41(int pos, Object o) throws Exception {
+    public void baseRowSetTest0010(int pos, Object o) throws Exception {
         assertTrue(getParam(pos, o).getClass().isInstance(o));
     }
 
@@ -571,7 +221,8 @@
      * Validate setNull specifying the supported type values
      */
     @Test(dataProvider = "jdbcTypes")
-    public void test42(Integer type) throws Exception {
+    public void baseRowSetTest0011(Integer type) throws Exception {
+        brs = new StubBaseRowSet();
         brs.setNull(1, type);
         assertTrue(checkNullParam(1, type, null));
     }
@@ -581,7 +232,8 @@
      * typeName is set internally
      */
     @Test(dataProvider = "jdbcTypes")
-    public void test43(Integer type) throws Exception {
+    public void baseRowSetTest0012(Integer type) throws Exception {
+        brs = new StubBaseRowSet();
         brs.setNull(1, type, "SUPERHERO");
         assertTrue(checkNullParam(1, type, "SUPERHERO"));
     }
@@ -590,8 +242,10 @@
      *  Validate that setDate sets the specified Calendar internally
      */
     @Test()
-    public void test44() throws Exception {
-        brs.setDate(1, aDate, cal);
+    public void baseRowSetTest0013() throws Exception {
+        Calendar cal = Calendar.getInstance();
+        brs = new StubBaseRowSet();
+        brs.setDate(1, Date.valueOf(LocalDate.now()), cal);
         assertTrue(checkCalendarParam(1, cal));
     }
 
@@ -599,8 +253,10 @@
      *  Validate that setTime sets the specified Calendar internally
      */
     @Test()
-    public void test45() throws Exception {
-        brs.setTime(1, aTime, cal);
+    public void baseRowSetTest0014() throws Exception {
+        Calendar cal = Calendar.getInstance();
+        brs = new StubBaseRowSet();
+        brs.setTime(1, Time.valueOf(LocalTime.now()), cal);
         assertTrue(checkCalendarParam(1, cal));
     }
 
@@ -608,564 +264,23 @@
      *  Validate that setTimestamp sets the specified Calendar internally
      */
     @Test()
-    public void test46() throws Exception {
-        brs.setTimestamp(1, ts, cal);
+    public void baseRowSetTest0015() throws Exception {
+        Calendar cal = Calendar.getInstance();
+        brs = new StubBaseRowSet();
+        brs.setTimestamp(1, Timestamp.valueOf(LocalDateTime.now()), cal);
         assertTrue(checkCalendarParam(1, cal));
     }
 
     /*
-     * Validate that getURL() returns same value set by
-     * setURL()
-     */
-    @Test()
-    public void test47() throws Exception {
-        brs.setUrl(url);
-        assertTrue(brs.getUrl().equals(url));
-    }
-
-    /*
      * Validate that initParams() initializes the parameters
      */
-    @Test()
-    public void test48() throws Exception {
-        brs.setInt(1, 1);
-        brs.initParams();
-        assertTrue(brs.getParams().length == 0);
+    @Test(dataProvider = "rowSetType")
+    public void baseRowSetTest0016(StubBaseRowSet rs) throws Exception {
+        rs.setInt(1, 1);
+        rs.initParams();
+        assertTrue(rs.getParams().length == 0);
     }
 
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test100() throws Exception {
-        brs1.setAsciiStream(1, is);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test101() throws Exception {
-        brs1.setAsciiStream("one", is);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test102() throws Exception {
-        brs1.setAsciiStream("one", is, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test103() throws Exception {
-        brs1.setBinaryStream(1, is);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test104() throws Exception {
-        brs1.setBinaryStream("one", is);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test105() throws Exception {
-        brs1.setBinaryStream("one", is, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test106() throws Exception {
-        brs1.setBigDecimal("one", BigDecimal.ONE);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test107() throws Exception {
-        brs1.setBlob(1, is);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test108() throws Exception {
-        brs1.setBlob("one", is);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test109() throws Exception {
-        brs1.setBlob("one", is, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test110() throws Exception {
-        brs1.setBlob("one", aBlob);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test111() throws Exception {
-        brs1.setBoolean("one", true);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test112() throws Exception {
-        byte b = 1;
-        brs1.setByte("one", b);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test113() throws Exception {
-        byte b = 1;
-        brs1.setBytes("one", bytes);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test114() throws Exception {
-        brs1.setCharacterStream("one", rdr, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test115() throws Exception {
-        brs1.setCharacterStream("one", rdr);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test116() throws Exception {
-        brs1.setCharacterStream(1, rdr);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test117() throws Exception {
-        brs1.setClob(1, rdr);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test118() throws Exception {
-        brs1.setClob("one", rdr);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test119() throws Exception {
-        brs1.setClob("one", rdr, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test120() throws Exception {
-        brs1.setClob("one", aClob);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test121() throws Exception {
-        brs1.setDate("one", aDate);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test122() throws Exception {
-        brs1.setDate("one", aDate, cal);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test123() throws Exception {
-        brs1.setTime("one", aTime);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test124() throws Exception {
-        brs1.setTime("one", aTime, cal);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test125() throws Exception {
-        brs1.setTimestamp("one", ts);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test126() throws Exception {
-        brs1.setTimestamp("one", ts, cal);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test127() throws Exception {
-        brs1.setDouble("one", 2.0d);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test128() throws Exception {
-        brs1.setFloat("one", 2.0f);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test129() throws Exception {
-        brs1.setInt("one", 21);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test130() throws Exception {
-        brs1.setLong("one", 21l);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test131() throws Exception {
-        brs1.setNCharacterStream("one", rdr, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test132() throws Exception {
-        brs1.setNCharacterStream("one", rdr);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test133() throws Exception {
-        brs1.setNCharacterStream(1, rdr);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test134() throws Exception {
-        brs1.setNCharacterStream(1, rdr, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test135() throws Exception {
-        brs1.setClob("one", rdr);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test136() throws Exception {
-        brs1.setClob("one", rdr, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test137() throws Exception {
-        brs1.setNClob("one", new StubNClob());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test138() throws Exception {
-        brs1.setNClob(1, rdr);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test139() throws Exception {
-        brs1.setNClob(1, rdr, query.length());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test140() throws Exception {
-        brs1.setNClob(1, new StubNClob());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test141() throws Exception {
-        brs1.setNString(1, query);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test142() throws Exception {
-        brs1.setNull("one", Types.INTEGER);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test143() throws Exception {
-        brs1.setNull("one", Types.INTEGER, "my.type");
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test144() throws Exception {
-        brs1.setObject("one", query, Types.VARCHAR);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test145() throws Exception {
-        brs1.setObject("one", query, Types.VARCHAR, 0);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test146() throws Exception {
-        brs1.setObject("one", query);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test147() throws Exception {
-        brs1.setRowId("one", aRowid);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test148() throws Exception {
-        brs1.setSQLXML("one", new StubSQLXML());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test149() throws Exception {
-        brs1.setSQLXML(1, new StubSQLXML());
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test150() throws Exception {
-        brs1.setNString(1, query);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test151() throws Exception {
-        brs1.setNString("one", query);
-    }
-
-    /*
-     * This method is currently not implemented in BaseRowSet and will
-     * throw a SQLFeatureNotSupportedException
-     */
-    @Test(expectedExceptions = SQLFeatureNotSupportedException.class)
-    public void test152() throws Exception {
-        short val = 21;
-        brs1.setShort("one", val);
-    }
-
-    /*
-     * DataProvider used to specify the value to set and check for
-     * methods using transaction isolation types
-     */
-    @DataProvider(name = "isolationTypes")
-    private Object[][] isolationTypes() {
-        return new Object[][]{
-            {Connection.TRANSACTION_NONE},
-            {Connection.TRANSACTION_READ_COMMITTED},
-            {Connection.TRANSACTION_READ_UNCOMMITTED},
-            {Connection.TRANSACTION_REPEATABLE_READ},
-            {Connection.TRANSACTION_SERIALIZABLE}
-        };
-    }
-
-    /*
-     * DataProvider used to specify the value to set and check for the
-     * methods for fetch direction
-     */
-    @DataProvider(name = "fetchDirection")
-    private Object[][] fetchDirection() {
-        return new Object[][]{
-            {ResultSet.FETCH_FORWARD},
-            {ResultSet.FETCH_REVERSE},
-            {ResultSet.FETCH_UNKNOWN}
-        };
-    }
-
-    /*
-     * DataProvider used to specify the value to set and check for the
-     * methods for Concurrency
-     */
-    @DataProvider(name = "concurTypes")
-    private Object[][] concurTypes() {
-        return new Object[][]{
-            {ResultSet.CONCUR_READ_ONLY},
-            {ResultSet.CONCUR_UPDATABLE}
-        };
-    }
-
-    /*
-     * DataProvider used to specify the value to set and check for the
-     * methods for Cursor Scroll Type
-     */
-    @DataProvider(name = "scrollTypes")
-    private Object[][] scrollTypes() {
-        return new Object[][]{
-            {ResultSet.TYPE_FORWARD_ONLY},
-            {ResultSet.TYPE_SCROLL_INSENSITIVE},
-            {ResultSet.TYPE_SCROLL_SENSITIVE}
-        };
-    }
 
     /*
      * DataProvider used to set parameters for basic types that are supported
@@ -1177,29 +292,33 @@
         Short aShort = Short.MIN_VALUE;
         BigDecimal bd = BigDecimal.ONE;
         Double aDouble = Double.MAX_VALUE;
+        Date aDate = Date.valueOf(LocalDate.now());
+        Time aTime = Time.valueOf(LocalTime.now());
+        Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now());
+        Calendar cal = Calendar.getInstance();
         Boolean aBoolean = true;
         Float aFloat = 1.5f;
         Byte aByte = 1;
+        brs = new StubBaseRowSet();
 
-        brs1.clearParameters();
-        brs1.setInt(1, aInt);
-        brs1.setString(2, query);
-        brs1.setLong(3, aLong);
-        brs1.setBoolean(4, aBoolean);
-        brs1.setShort(5, aShort);
-        brs1.setDouble(6, aDouble);
-        brs1.setBigDecimal(7, bd);
-        brs1.setFloat(8, aFloat);
-        brs1.setByte(9, aByte);
-        brs1.setDate(10, aDate);
-        brs1.setTime(11, aTime);
-        brs1.setTimestamp(12, ts);
-        brs1.setDate(13, aDate, cal);
-        brs1.setTime(14, aTime, cal);
-        brs1.setTimestamp(15, ts);
-        brs1.setObject(16, query);
-        brs1.setObject(17, query, Types.CHAR);
-        brs1.setObject(18, query, Types.CHAR, 0);
+        brs.setInt(1, aInt);
+        brs.setString(2, query);
+        brs.setLong(3, aLong);
+        brs.setBoolean(4, aBoolean);
+        brs.setShort(5, aShort);
+        brs.setDouble(6, aDouble);
+        brs.setBigDecimal(7, bd);
+        brs.setFloat(8, aFloat);
+        brs.setByte(9, aByte);
+        brs.setDate(10, aDate);
+        brs.setTime(11, aTime);
+        brs.setTimestamp(12, aTimeStamp);
+        brs.setDate(13, aDate, cal);
+        brs.setTime(14, aTime, cal);
+        brs.setTimestamp(15, aTimeStamp);
+        brs.setObject(16, query);
+        brs.setObject(17, query, Types.CHAR);
+        brs.setObject(18, query, Types.CHAR, 0);
 
         return new Object[][]{
             {1, aInt},
@@ -1213,10 +332,10 @@
             {9, aByte},
             {10, aDate},
             {11, aTime},
-            {12, ts},
+            {12, aTimeStamp},
             {13, aDate},
             {14, aTime},
-            {15, ts},
+            {15, aTimeStamp},
             {16, query},
             {17, query},
             {18, query}
@@ -1230,16 +349,23 @@
     @DataProvider(name = "testAdvancedParameters")
     private Object[][] testAdvancedParameters() throws SQLException {
 
-        brs1.clearParameters();
-        brs1.setBytes(1, bytes);
-        brs1.setAsciiStream(2, is, query.length());
-        brs1.setRef(3, aRef);
-        brs1.setArray(4, aArray);
-        brs1.setBlob(5, aBlob);
-        brs1.setClob(6, aClob);
-        brs1.setBinaryStream(7, is, query.length());
-        brs1.setUnicodeStream(8, is, query.length());
-        brs1.setCharacterStream(9, rdr, query.length());
+        byte[] bytes = new byte[10];
+        Ref aRef = new SerialRef(new StubRef("INTEGER", query));
+        Array aArray = new SerialArray(new StubArray("INTEGER", new Object[1]));
+        Blob aBlob = new SerialBlob(new StubBlob());
+        Clob aClob = new SerialClob(new StubClob());
+        Reader rdr = new StringReader(query);
+        InputStream is = new StringBufferInputStream(query);;
+        brs = new StubBaseRowSet();
+        brs.setBytes(1, bytes);
+        brs.setAsciiStream(2, is, query.length());
+        brs.setRef(3, aRef);
+        brs.setArray(4, aArray);
+        brs.setBlob(5, aBlob);
+        brs.setClob(6, aClob);
+        brs.setBinaryStream(7, is, query.length());
+        brs.setUnicodeStream(8, is, query.length());
+        brs.setCharacterStream(9, rdr, query.length());
 
         return new Object[][]{
             {1, bytes},
@@ -1261,7 +387,7 @@
      */
     @SuppressWarnings("unchecked")
     private <T> T getParam(int pos, T o) throws SQLException {
-        Object[] params = brs1.getParams();
+        Object[] params = brs.getParams();
         if (params[pos - 1] instanceof Object[]) {
             Object[] param = (Object[]) params[pos - 1];
             return (T) param[0];
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/sql/testng/test/rowset/CommonRowSetTests.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,1372 @@
+/*
+ * 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.
+ */
+package test.rowset;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.math.BigDecimal;
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.sql.RowSet;
+import javax.sql.rowset.BaseRowSet;
+import javax.sql.rowset.CachedRowSet;
+import javax.sql.rowset.RowSetFactory;
+import javax.sql.rowset.RowSetMetaDataImpl;
+import javax.sql.rowset.RowSetProvider;
+import org.testng.Assert;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubBlob;
+import util.StubClob;
+import util.StubNClob;
+import util.StubSQLXML;
+
+public abstract class CommonRowSetTests extends BaseTest {
+
+    protected final String stubProvider = "util.StubSyncProvider";
+    protected final String query = "SELECT * FROM SUPERHEROS";
+    private final String url = "jdbc:derby://localhost:1527/myDB";
+    private final String dsName = "jdbc/myDB";
+    private final String user = "Bruce Wayne";
+    private final String password = "The Dark Knight";
+    protected final String COFFEE_HOUSES_TABLE = "COFFEE_HOUSES";
+    protected final String COFFEES_TABLE = "COFFEES";
+    protected final int COFFEE_HOUSES_ROWS = 14;
+    protected final int COFFEES_ROWS = 5;
+    protected final Object[] COFFEES_PRIMARY_KEYS = {1, 2, 3, 4, 5};
+    protected final Object[] COFFEE_HOUSES_PRIMARY_KEYS = {
+        10023, 33002, 10040, 32001, 10042, 10024, 10039, 10041,
+        33005, 33010, 10035, 10037, 10034, 32004
+    };
+
+    /*
+     * COFFEES_HOUSES Table column names
+     */
+    protected final String[] COFFEE_HOUSES_COLUMN_NAMES = {
+        "STORE_ID", "CITY", "COFFEE", "MERCH", "TOTAL"
+    };
+
+    /*
+     * COFFEES Table column names
+     */
+    protected final String[] COFFEES_COLUMN_NAMES = {
+        "COF_ID", "COF_NAME", "SUP_ID", "PRICE", "SALES", "TOTAL"
+    };
+
+    protected RowSetFactory rsf;
+
+    public CommonRowSetTests() {
+        try {
+            rsf = RowSetProvider.newFactory();
+        } catch (SQLException ex) {
+            Assert.fail(ex.getMessage());
+        }
+    }
+
+    // Create an instance of the RowSet we are using
+    protected abstract <T extends RowSet> T newInstance() throws SQLException;
+
+    //DataProvider to use for common tests
+
+    /*
+     * DataProvider used to specify the value to set and check for the
+     * methods for fetch direction
+     */
+    @DataProvider(name = "rowSetFetchDirection")
+    protected Object[][] rowSetFetchDirection() throws Exception {
+        RowSet rs = newInstance();
+        return new Object[][]{
+            {rs, ResultSet.FETCH_FORWARD},
+            {rs, ResultSet.FETCH_REVERSE},
+            {rs, ResultSet.FETCH_UNKNOWN}
+        };
+    }
+
+    /*
+     * DataProvider used to specify the value to set and check for the
+     * methods for Cursor Scroll Type
+     */
+    @DataProvider(name = "rowSetScrollTypes")
+    protected Object[][] rowSetScrollTypes() throws Exception {
+        RowSet rs = newInstance();
+
+        return new Object[][]{
+            {rs, ResultSet.TYPE_FORWARD_ONLY},
+            {rs, ResultSet.TYPE_SCROLL_INSENSITIVE},
+            {rs, ResultSet.TYPE_SCROLL_SENSITIVE}
+        };
+    }
+
+    /*
+     * DataProvider used to specify the value to set and check for
+     * methods using transaction isolation types
+     */
+    @DataProvider(name = "rowSetIsolationTypes")
+    protected Object[][] rowSetIsolationTypes() throws Exception {
+        RowSet rs = newInstance();
+
+        return new Object[][]{
+            {rs, Connection.TRANSACTION_NONE},
+            {rs, Connection.TRANSACTION_READ_COMMITTED},
+            {rs, Connection.TRANSACTION_READ_UNCOMMITTED},
+            {rs, Connection.TRANSACTION_REPEATABLE_READ},
+            {rs, Connection.TRANSACTION_SERIALIZABLE}
+        };
+    }
+
+    /*
+     * DataProvider used to specify the value to set and check for the
+     * methods for Concurrency
+     */
+    @DataProvider(name = "rowSetConcurrencyTypes")
+    protected Object[][] rowSetConcurrencyTypes() throws Exception {
+        RowSet rs = newInstance();
+        return new Object[][]{
+            {rs, ResultSet.CONCUR_READ_ONLY},
+            {rs, ResultSet.CONCUR_UPDATABLE}
+        };
+    }
+
+    /*
+     * DataProvider used to specify the value to set and check for
+     * methods using boolean values
+     */
+    @DataProvider(name = "rowSetTrueFalse")
+    protected Object[][] rowSetTrueFalse() throws Exception {
+        RowSet rs = newInstance();
+        return new Object[][]{
+            {rs, true},
+            {rs, false}
+        };
+    }
+    /*
+     * DataProvider used to specify the type of RowSet to use.  We also must
+     * initialize the RowSet
+     */
+    @DataProvider(name = "rowSetType")
+    protected Object[][] rowSetType() throws Exception {
+
+        RowSet rs = newInstance();
+        return new Object[][]{
+            {rs}
+        };
+    }
+
+    /*
+     * Initializes a RowSet containing the COFFEE_HOUSES data
+     */
+    protected <T extends RowSet> T createCoffeeHousesRowSet() throws SQLException {
+        T rs = (T) newInstance();
+        initCoffeeHousesMetaData((CachedRowSet) rs);
+        createCoffeeHouseRows(rs);
+        // Make sure you are not on the insertRow
+        rs.moveToCurrentRow();
+        return rs;
+    }
+
+    /*
+     * Initializes a RowSet containing the COFFEE_HOUSES data
+     */
+    protected <T extends RowSet> T createCoffeesRowSet() throws SQLException {
+        T rs = (T) newInstance();
+        initCoffeesMetaData((CachedRowSet) rs);
+        createCoffeesRows(rs);
+        // Make sure you are not on the insertRow
+        rs.moveToCurrentRow();
+        return rs;
+    }
+
+    /*
+     * Initializes the COFFEE_HOUSES metadata
+     */
+    private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
+        RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
+        crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
+
+        /*
+         *  CREATE TABLE COFFEE_HOUSES(
+         *   STORE_ID Integer NOT NULL,
+         *   CITY VARCHAR(32),
+         *   COFFEE INTEGER NOT NULL,
+         *   MERCH INTEGER NOT NULL,
+         *   TOTAL INTEGER NOT NULL,
+         *   PRIMARY KEY (STORE_ID))
+         */
+        rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
+        for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
+            rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
+            rsmd.setColumnLabel(i, rsmd.getColumnName(i));
+        }
+
+        rsmd.setColumnType(1, Types.INTEGER);
+        rsmd.setColumnType(2, Types.VARCHAR);
+        rsmd.setColumnType(3, Types.INTEGER);
+        rsmd.setColumnType(4, Types.INTEGER);
+        rsmd.setColumnType(5, Types.INTEGER);
+        crs.setMetaData(rsmd);
+        crs.setTableName(COFFEE_HOUSES_TABLE);
+
+    }
+
+    /*
+     * Add rows to COFFEE_HOUSES table
+     */
+    protected void createCoffeeHouseRows(RowSet rs) throws SQLException {
+
+        // insert into COFFEE_HOUSES values(10023, 'Mendocino', 3450, 2005, 5455)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10023);
+        rs.updateString(2, "Mendocino");
+        rs.updateInt(3, 3450);
+        rs.updateInt(4, 2005);
+        rs.updateInt(5, 5455);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(33002, 'Seattle', 4699, 3109, 7808)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 33002);
+        rs.updateString(2, "Seattle");
+        rs.updateInt(3, 4699);
+        rs.updateInt(4, 3109);
+        rs.updateInt(5, 7808);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(10040, 'SF', 5386, 2841, 8227)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10040);
+        rs.updateString(2, "SF");
+        rs.updateInt(3, 5386);
+        rs.updateInt(4, 2841);
+        rs.updateInt(5, 8227);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(32001, 'Portland', 3147, 3579, 6726)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 32001);
+        rs.updateString(2, "Portland");
+        rs.updateInt(3, 3147);
+        rs.updateInt(4, 3579);
+        rs.updateInt(5, 6726);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(10042, 'SF', 2863, 1874, 4710)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10042);
+        rs.updateString(2, "SF");
+        rs.updateInt(3, 2863);
+        rs.updateInt(4, 1874);
+        rs.updateInt(5, 4710);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(10024, 'Sacramento', 1987, 2341, 4328)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10024);
+        rs.updateString(2, "Sacramento");
+        rs.updateInt(3, 1987);
+        rs.updateInt(4, 2341);
+        rs.updateInt(5, 4328);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(10039, 'Carmel', 2691, 1121, 3812)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10039);
+        rs.updateString(2, "Carmel");
+        rs.updateInt(3, 2691);
+        rs.updateInt(4, 1121);
+        rs.updateInt(5, 3812);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(10041, 'LA', 1533, 1007, 2540)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10041);
+        rs.updateString(2, "LA");
+        rs.updateInt(3, 1533);
+        rs.updateInt(4, 1007);
+        rs.updateInt(5, 2540);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(33005, 'Olympia', 2733, 1550, 1550)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 33005);
+        rs.updateString(2, "Olympia");
+        rs.updateInt(3, 2733);
+        rs.updateInt(4, 1550);
+        rs.updateInt(5, 1550);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(33010, 'Seattle', 3210, 2177, 5387)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 33010);
+        rs.updateString(2, "Seattle");
+        rs.updateInt(3, 3210);
+        rs.updateInt(4, 2177);
+        rs.updateInt(5, 5387);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(10035, 'SF', 1922, 1056, 2978)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10035);
+        rs.updateString(2, "SF");
+        rs.updateInt(3, 1922);
+        rs.updateInt(4, 1056);
+        rs.updateInt(5, 2978);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(10037, 'LA', 2143, 1876, 4019)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10037);
+        rs.updateString(2, "LA");
+        rs.updateInt(3, 2143);
+        rs.updateInt(4, 1876);
+        rs.updateInt(5, 4019);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(10034, 'San_Jose', 1234, 1032, 2266)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10034);
+        rs.updateString(2, "San Jose");
+        rs.updateInt(3, 1234);
+        rs.updateInt(4, 1032);
+        rs.updateInt(5, 2266);
+        rs.insertRow();
+        // insert into COFFEE_HOUSES values(32004, 'Eugene', 1356, 1112, 2468)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 32004);
+        rs.updateString(2, "Eugene");
+        rs.updateInt(3, 1356);
+        rs.updateInt(4, 1112);
+        rs.updateInt(5, 2468);
+        rs.insertRow();
+        rs.moveToCurrentRow();
+    }
+
+    /*
+     * Initializes the COFFEES metadata
+     */
+    protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
+        RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
+        crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
+
+        /*
+         *  CREATE TABLE COFFEES (
+         *   COF_ID INTEGER NOT NULL,
+         *   COF_NAME VARCHAR(32) NOT NULL,
+         *   SUP_ID INTEGER NOT NULL,
+         *   PRICE NUMBERIC(10,2 NOT NULL,
+         *   SALES INTEGER NOT NULL,
+         *   TOTAL INTEGER NOT NULL,
+         *   PRIMARY KEY (COF_ID),
+         *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
+         */
+        rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
+        for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
+            rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
+            rsmd.setColumnLabel(i, rsmd.getColumnName(i));
+        }
+
+        rsmd.setColumnType(1, Types.INTEGER);
+        rsmd.setColumnType(2, Types.VARCHAR);
+        rsmd.setColumnType(3, Types.INTEGER);
+        rsmd.setColumnType(4, Types.NUMERIC);
+        rsmd.setPrecision(4, 10);
+        rsmd.setScale(4, 2);
+        rsmd.setColumnType(5, Types.INTEGER);
+        rsmd.setColumnType(6, Types.INTEGER);
+        crs.setMetaData(rsmd);
+        crs.setTableName(COFFEES_TABLE);
+
+    }
+
+    /*
+     * Add rows to COFFEES table
+     */
+    protected void createCoffeesRows(RowSet rs) throws SQLException {
+
+        // insert into COFFEES values(1, 'Colombian', 101, 7.99, 0, 0)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 1);
+        rs.updateString(2, "Colombian");
+        rs.updateInt(3, 101);
+        rs.updateBigDecimal(4, BigDecimal.valueOf(7.99));
+        rs.updateInt(5, 0);
+        rs.updateInt(6, 0);
+        rs.insertRow();
+        // insert into COFFEES values(2, 'French_Roast', 49, 8.99, 0, 0)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 2);
+        rs.updateString(2, "French_Roast");
+        rs.updateInt(3, 49);
+        rs.updateBigDecimal(4, BigDecimal.valueOf(8.99));
+        rs.updateInt(5, 0);
+        rs.updateInt(6, 0);
+        rs.insertRow();
+        // insert into COFFEES values(3, 'Espresso', 150, 9.99, 0, 0)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 3);
+        rs.updateString(2, "Espresso");
+        rs.updateInt(3, 150);
+        rs.updateBigDecimal(4, BigDecimal.valueOf(9.99));
+        rs.updateInt(5, 0);
+        rs.updateInt(6, 0);
+        rs.insertRow();
+        // insert into COFFEES values(4, 'Colombian_Decaf', 101, 8.99, 0, 0)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 4);
+        rs.updateString(2, "Colombian_Decaf");
+        rs.updateInt(3, 101);
+        rs.updateBigDecimal(4, BigDecimal.valueOf(8.99));
+        rs.updateInt(5, 0);
+        rs.updateInt(6, 0);
+        rs.insertRow();
+        // insert into COFFEES values(5, 'French_Roast_Decaf', 049, 9.99, 0, 0)
+        rs.moveToInsertRow();
+        rs.updateInt(1, 5);
+        rs.updateString(2, "French_Roast_Decaf");
+        rs.updateInt(3, 49);
+        rs.updateBigDecimal(4, BigDecimal.valueOf(9.99));
+        rs.updateInt(5, 0);
+        rs.updateInt(6, 0);
+        rs.insertRow();
+
+    }
+
+
+    /*
+     * Utility method to return the Primary Keys for a RowSet.  The Primary
+     * keys are assumed to be in the first column of the RowSet
+     */
+    protected Object[] getPrimaryKeys(ResultSet rs) throws SQLException {
+        List<? super Object> result = new ArrayList<>();
+        if (rs == null) {
+            return null;
+        }
+        rs.beforeFirst();
+        while (rs.next()) {
+            result.add(rs.getInt(1));
+        }
+        return result.toArray();
+    }
+
+    /*
+     * Utility method to display the RowSet and will return the row count
+     * it found
+     */
+    protected int displayResults(ResultSet rs) throws SQLException {
+        int rows = 0;
+        ResultSetMetaData rsmd = rs.getMetaData();
+        int cols = rsmd.getColumnCount();
+        if (rs != null) {
+            rs.beforeFirst();
+            while (rs.next()) {
+                rows++;
+
+                for (int i = 0; i < cols; i++) {
+                    System.out.print(rs.getString(i + 1) + " ");
+                }
+                System.out.println();
+            }
+        }
+
+        return rows;
+    }
+
+
+     // Insert common tests here
+
+    /*
+     * Validate that getCommand() returns null by default
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0000(RowSet rs) {
+        assertNull(rs.getCommand());
+    }
+
+    /*
+     * Validate that getCommand() returns command specified to setCommand
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0001(RowSet rs) throws Exception {
+        rs.setCommand(query);
+        assertTrue(rs.getCommand().equals(query));
+    }
+
+
+    /*
+     * Validate that getCurrency() returns the correct default value
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0002(RowSet rs) throws Exception {
+        assertTrue(rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE);
+    }
+
+    /*
+     * Validate that getCurrency() returns the correct value
+     * after a call to setConcurrency())
+     */
+    @Test(dataProvider = "rowSetConcurrencyTypes")
+    public void commonRowSetTest0003(RowSet rs, int concurType) throws Exception {
+        rs.setConcurrency(concurType);
+        assertTrue(rs.getConcurrency() == concurType);
+    }
+
+    /*
+     * Validate that getCurrency() throws a SQLException for an invalid value
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonRowSetTest0004(RowSet rs) throws Exception {
+        rs.setConcurrency(ResultSet.CLOSE_CURSORS_AT_COMMIT);
+    }
+
+    /*
+     * Validate that getDataSourceName() returns null by default
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0005(RowSet rs) throws Exception {
+        assertTrue(rs.getDataSourceName() == null);
+    }
+
+    /*
+     * Validate that getDataSourceName() returns the value specified
+     * by setDataSourceName() and getUrl() returns null
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0006(RowSet rs) throws Exception {
+        rs.setUrl(url);
+        rs.setDataSourceName(dsName);
+        assertTrue(rs.getDataSourceName().equals(dsName));
+        assertNull(rs.getUrl());
+    }
+
+    /*
+     * Validate that setDataSourceName() throws a SQLException for an empty
+     * String specified for the data source name
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonRowSetTest0007(RowSet rs) throws Exception {
+        String dsname = "";
+        rs.setDataSourceName(dsname);
+    }
+
+    /*
+     * Validate that getEscapeProcessing() returns false by default
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0008(RowSet rs) throws Exception {
+        assertTrue(rs.getEscapeProcessing());
+    }
+
+    /*
+     * Validate that getEscapeProcessing() returns value set by
+     * setEscapeProcessing()
+     */
+    @Test(dataProvider = "rowSetTrueFalse")
+    public void commonRowSetTest0009(RowSet rs, boolean val) throws Exception {
+        rs.setEscapeProcessing(val);
+        assertTrue(rs.getEscapeProcessing() == val);
+    }
+
+    /*
+     * Validate that getFetchDirection() returns the correct default value
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0010(RowSet rs) throws Exception {
+        assertTrue(rs.getFetchDirection() == ResultSet.FETCH_FORWARD);
+    }
+
+    /*
+     * Validate that getFetchDirection() returns the value set by
+     * setFetchDirection()
+     */
+    @Test(dataProvider = "rowSetFetchDirection")
+    public void commonRowSetTest0011(RowSet rs, int direction) throws Exception {
+        rs.setFetchDirection(direction);
+        assertTrue(rs.getFetchDirection() == direction);
+    }
+
+    /*
+     * Validate that setFetchSize() throws a SQLException for an invalid value
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonRowSetTest0013(RowSet rs) throws Exception {
+        rs.setFetchSize(-1);
+    }
+
+    /*
+     * Validate that setFetchSize() throws a SQLException for a
+     * value greater than getMaxRows()
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonRowSetTest0014(RowSet rs) throws Exception {
+        rs.setMaxRows(5);
+        rs.setFetchSize(rs.getMaxRows() + 1);
+    }
+
+    /*
+     * Validate that getFetchSize() returns the correct value after
+     * setFetchSize() has been called
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0015(RowSet rs) throws Exception {
+        int maxRows = 150;
+        rs.setFetchSize(0);
+        assertTrue(rs.getFetchSize() == 0);
+        rs.setFetchSize(100);
+        assertTrue(rs.getFetchSize() == 100);
+        rs.setMaxRows(maxRows);
+        rs.setFetchSize(maxRows);
+        assertTrue(rs.getFetchSize() == maxRows);
+    }
+
+    /*
+     * Validate that setMaxFieldSize() throws a SQLException for an invalid value
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonRowSetTest0016(RowSet rs) throws Exception {
+        rs.setMaxFieldSize(-1);
+    }
+
+    /*
+     * Validate that getMaxFieldSize() returns the value set by
+     * setMaxFieldSize()
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0017(RowSet rs) throws Exception {
+        rs.setMaxFieldSize(0);
+        assertTrue(rs.getMaxFieldSize() == 0);
+        rs.setMaxFieldSize(100);
+        assertTrue(rs.getMaxFieldSize() == 100);
+        rs.setMaxFieldSize(50);
+        assertTrue(rs.getMaxFieldSize() == 50);
+    }
+
+    /*
+     * Validate that isReadOnly() returns value set by
+     * setReadOnly()
+     */
+    @Test(dataProvider = "rowSetTrueFalse")
+    public void commonRowSetTest0018(RowSet rs, boolean val) throws Exception {
+        rs.setReadOnly(val);
+        assertTrue(rs.isReadOnly() == val);
+    }
+
+    /*
+     * Validate that getTransactionIsolation() returns value set by
+     * setTransactionIsolation()
+     */
+    @Test(dataProvider = "rowSetIsolationTypes")
+    public void commonRowSetTest0019(RowSet rs, int val) throws Exception {
+        rs.setTransactionIsolation(val);
+        assertTrue(rs.getTransactionIsolation() == val);
+    }
+
+    /*
+     * Validate that getType() returns value set by setType()
+     */
+    @Test(dataProvider = "rowSetScrollTypes")
+    public void commonRowSetTest0020(RowSet rs, int val) throws Exception {
+        rs.setType(val);
+        assertTrue(rs.getType() == val);
+    }
+
+    /*
+     * Validate that getEscapeProcessing() returns value set by
+     * setEscapeProcessing()
+     */
+    @Test(dataProvider = "rowSetTrueFalse")
+    public void commonRowSetTest0021(BaseRowSet rs, boolean val) throws Exception {
+        rs.setShowDeleted(val);
+        assertTrue(rs.getShowDeleted() == val);
+    }
+
+    /*
+     * Validate that getTypeMap() returns same value set by
+     * setTypeMap()
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0022(RowSet rs) throws Exception {
+        Map<String, Class<?>> map = new HashMap<>();
+        map.put("SUPERHERO", Class.forName("util.SuperHero"));
+        rs.setTypeMap(map);
+        assertTrue(rs.getTypeMap().equals(map));
+    }
+
+    /*
+     * Validate that getUsername() returns same value set by
+     * setUsername()
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0023(RowSet rs) throws Exception {
+        rs.setUsername(user);
+        assertTrue(rs.getUsername().equals(user));
+    }
+
+    /*
+     * Validate that getPassword() returns same password set by
+     * setPassword()
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0024(RowSet rs) throws Exception {
+        rs.setPassword(password);
+        assertTrue(rs.getPassword().equals(password));
+    }
+
+    /*
+     * Validate that getQueryTimeout() returns same value set by
+     * setQueryTimeout() and that 0 is a valid timeout value
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0025(RowSet rs) throws Exception {
+        int timeout = 0;
+        rs.setQueryTimeout(timeout);
+        assertTrue(rs.getQueryTimeout() == timeout);
+    }
+
+    /*
+     * Validate that getQueryTimeout() returns same value set by
+     * setQueryTimeout() and that 0 is a valid timeout value
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0026(RowSet rs) throws Exception {
+        int timeout = 10000;
+        rs.setQueryTimeout(timeout);
+        assertTrue(rs.getQueryTimeout() == timeout);
+    }
+
+    /*
+     * Validate that setQueryTimeout() throws a SQLException for a timeout
+     * value < 0
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonRowSetTest0027(RowSet rs) throws Exception {
+        rs.setQueryTimeout(-1);
+    }
+
+
+    /*
+     * Validate addRowSetListener does not throw an Exception when null is
+     * passed as the parameter
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0028(RowSet rs) throws Exception {
+        rs.addRowSetListener(null);
+    }
+
+    /*
+     * Validate removeRowSetListener does not throw an Exception when null is
+     * passed as the parameter
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0029(RowSet rs) throws Exception {
+        rs.removeRowSetListener(null);
+    }
+
+    /*
+     * Set two parameters and then validate clearParameters() will clear them
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0030(BaseRowSet rs) throws Exception {
+        rs.setInt(1, 1);
+        rs.setString(2, query);
+        assertTrue(rs.getParams().length == 2);
+        rs.clearParameters();
+        assertTrue(rs.getParams().length == 0);
+    }
+
+    /*
+     * Validate that getURL() returns same value set by
+     * setURL()
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonRowSetTest0031(RowSet rs) throws Exception {
+        rs.setUrl(url);
+        assertTrue(rs.getUrl().equals(url));
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0100(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setAsciiStream(1, is);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0101(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setAsciiStream("one", is);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0102(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setAsciiStream("one", is, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0103(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setBinaryStream(1, is);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0104(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setBinaryStream("one", is);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0105(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setBinaryStream("one", is, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0106(RowSet rs) throws Exception {
+        rs.setBigDecimal("one", BigDecimal.ONE);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0107(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setBlob(1, is);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0108(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setBlob("one", is);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0109(RowSet rs) throws Exception {
+        InputStream is = null;
+        rs.setBlob("one", is, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0110(RowSet rs) throws Exception {
+        rs.setBlob("one", new StubBlob());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0111(RowSet rs) throws Exception {
+        rs.setBoolean("one", true);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0112(RowSet rs) throws Exception {
+        byte b = 1;
+        rs.setByte("one", b);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0113(RowSet rs) throws Exception {
+        byte b = 1;
+        rs.setBytes("one", new byte[10]);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0114(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setCharacterStream("one", rdr, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0115(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setCharacterStream("one", rdr);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0116(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setCharacterStream(1, rdr);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0117(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setClob(1, rdr);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0118(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setClob("one", rdr);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0119(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setClob("one", rdr, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0120(RowSet rs) throws Exception {
+        rs.setClob("one", new StubClob());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0121(RowSet rs) throws Exception {
+        rs.setDate("one", Date.valueOf(LocalDate.now()));
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0122(RowSet rs) throws Exception {
+        rs.setDate("one", Date.valueOf(LocalDate.now()),
+                Calendar.getInstance());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0123(RowSet rs) throws Exception {
+        rs.setTime("one", Time.valueOf(LocalTime.now()));
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0124(RowSet rs) throws Exception {
+        rs.setTime("one", Time.valueOf(LocalTime.now()),
+                Calendar.getInstance());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0125(RowSet rs) throws Exception {
+        rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()));
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0126(RowSet rs) throws Exception {
+        rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()),
+                Calendar.getInstance());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0127(RowSet rs) throws Exception {
+        rs.setDouble("one", 2.0d);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0128(RowSet rs) throws Exception {
+        rs.setFloat("one", 2.0f);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0129(RowSet rs) throws Exception {
+        rs.setInt("one", 21);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0130(RowSet rs) throws Exception {
+        rs.setLong("one", 21l);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0131(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setNCharacterStream("one", rdr, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0132(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setNCharacterStream("one", rdr);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0133(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setNCharacterStream(1, rdr);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0134(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setNCharacterStream(1, rdr, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0135(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setClob("one", rdr);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0136(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setClob("one", rdr, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0137(RowSet rs) throws Exception {
+        rs.setNClob("one", new StubNClob());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0138(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setNClob(1, rdr);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0139(RowSet rs) throws Exception {
+        Reader rdr = null;
+        rs.setNClob(1, rdr, query.length());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0140(RowSet rs) throws Exception {
+        rs.setNClob(1, new StubNClob());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0141(RowSet rs) throws Exception {
+        rs.setNString(1, query);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0142(RowSet rs) throws Exception {
+        rs.setNull("one", Types.INTEGER);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0143(RowSet rs) throws Exception {
+        rs.setNull("one", Types.INTEGER, "my.type");
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0144(RowSet rs) throws Exception {
+        rs.setObject("one", query, Types.VARCHAR);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0145(RowSet rs) throws Exception {
+        rs.setObject("one", query, Types.VARCHAR, 0);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0146(RowSet rs) throws Exception {
+        rs.setObject("one", query);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0147(RowSet rs) throws Exception {
+        RowId aRowid = null;
+        rs.setRowId("one", aRowid);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0148(RowSet rs) throws Exception {
+        rs.setSQLXML("one", new StubSQLXML());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0149(RowSet rs) throws Exception {
+        rs.setSQLXML(1, new StubSQLXML());
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0150(RowSet rs) throws Exception {
+        rs.setNString(1, query);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0151(RowSet rs) throws Exception {
+        rs.setNString("one", query);
+    }
+
+    /*
+     * This method is currently not implemented in BaseRowSet and will
+     * throw a SQLFeatureNotSupportedException
+     */
+    @Test(dataProvider = "rowSetType",
+            expectedExceptions = SQLFeatureNotSupportedException.class)
+    public void commonRowSetTest0152(RowSet rs) throws Exception {
+        short val = 21;
+        rs.setShort("one", val);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/sql/testng/test/rowset/cachedrowset/CachedRowSetTests.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+package test.rowset.cachedrowset;
+
+import java.sql.SQLException;
+import javax.sql.rowset.CachedRowSet;
+
+public class CachedRowSetTests extends CommonCachedRowSetTests {
+
+    @Override
+    protected CachedRowSet newInstance() throws SQLException {
+        return rsf.createCachedRowSet();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/sql/testng/test/rowset/cachedrowset/CommonCachedRowSetTests.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,1612 @@
+/*
+ * 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.
+ */
+package test.rowset.cachedrowset;
+
+import java.math.BigDecimal;
+import java.sql.Array;
+import java.sql.Date;
+import java.sql.JDBCType;
+import java.sql.Ref;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.Collection;
+import javax.sql.RowSet;
+import javax.sql.rowset.CachedRowSet;
+import javax.sql.rowset.RowSetMetaDataImpl;
+import javax.sql.rowset.serial.SerialRef;
+import javax.sql.rowset.spi.SyncFactory;
+import javax.sql.rowset.spi.SyncProvider;
+import javax.sql.rowset.spi.SyncProviderException;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import test.rowset.CommonRowSetTests;
+import util.StubArray;
+import util.StubRef;
+import util.StubSyncProvider;
+import util.TestRowSetListener;
+
+public abstract class CommonCachedRowSetTests extends CommonRowSetTests {
+
+    /*
+     * DATATYPES Table column names
+     */
+    private final String[] DATATYPES_COLUMN_NAMES = {"AINTEGER", "ACHAR",
+        "AVARCHAR", "ALONG", "ABOOLEAN", "ASHORT", "ADOUBLE", "ABIGDECIMAL",
+        "AREAL", "ABYTE", "ADATE", "ATIME", "ATIMESTAMP", "ABYTES", "ARRAY",
+        "AREF", "AFLOAT"};
+
+    /*
+     * Initializes a RowSet containing the DATAYPES data
+     */
+    protected <T extends RowSet> T createDataTypesRowSet() throws SQLException {
+        T rs = (T) newInstance();
+        initDataTypesMetaData((CachedRowSet) rs);
+        createDataTypesRows(rs);
+        // Make sure you are not on the insertRow
+        rs.moveToCurrentRow();
+        return rs;
+    }
+
+    //DataProviders to use for common tests
+
+    /*
+     * DataProvider that uses a RowSet with the COFFEE_HOUSES Table
+     */
+    @DataProvider(name = "rowsetUsingCoffeeHouses")
+    protected Object[][] rowsetUsingCoffeeHouses() throws Exception {
+        RowSet rs = createCoffeeHousesRowSet();
+        return new Object[][]{
+            {rs}
+        };
+    }
+
+    /*
+     * DataProvider that uses a RowSet with the COFFEES Table
+     */
+    @DataProvider(name = "rowsetUsingCoffees")
+    protected Object[][] rowsetUsingCoffees() throws Exception {
+        RowSet rs = createCoffeesRowSet();
+        return new Object[][]{
+            {rs}
+        };
+    }
+
+    /*
+     * DataProvider that uses a RowSet with the DATAYPES Table and
+     * used to validate the various supported data types
+     */
+    @DataProvider(name = "rowsetUsingDataTypes")
+    protected Object[][] rowsetUsingDataTypes() throws Exception {
+
+        CachedRowSet rs = createDataTypesRowSet();
+        return new Object[][]{
+            {rs, JDBCType.INTEGER},
+            {rs, JDBCType.CHAR},
+            {rs, JDBCType.VARCHAR},
+            {rs, JDBCType.BIGINT},
+            {rs, JDBCType.BOOLEAN},
+            {rs, JDBCType.SMALLINT},
+            {rs, JDBCType.DOUBLE},
+            {rs, JDBCType.DECIMAL},
+            {rs, JDBCType.REAL},
+            {rs, JDBCType.TINYINT},
+            {rs, JDBCType.DATE},
+            {rs, JDBCType.TIME},
+            {rs, JDBCType.TIMESTAMP},
+            {rs, JDBCType.VARBINARY},
+            {rs, JDBCType.ARRAY},
+            {rs, JDBCType.REF},
+            {rs, JDBCType.FLOAT}
+        };
+    }
+
+    /*
+     * Initializes the DATAYPES table metadata
+     */
+    protected void initDataTypesMetaData(CachedRowSet crs) throws SQLException {
+        RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
+        crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
+
+        rsmd.setColumnCount(DATATYPES_COLUMN_NAMES.length);
+
+        for (int i = 1; i <= DATATYPES_COLUMN_NAMES.length; i++) {
+            rsmd.setColumnName(i, DATATYPES_COLUMN_NAMES[i - 1]);
+            rsmd.setColumnLabel(i, rsmd.getColumnName(i));
+        }
+
+        rsmd.setColumnType(1, Types.INTEGER);
+        rsmd.setColumnType(2, Types.CHAR);
+        rsmd.setColumnType(3, Types.VARCHAR);
+        rsmd.setColumnType(4, Types.BIGINT);
+        rsmd.setColumnType(5, Types.BOOLEAN);
+        rsmd.setColumnType(6, Types.SMALLINT);
+        rsmd.setColumnType(7, Types.DOUBLE);
+        rsmd.setColumnType(8, Types.DECIMAL);
+        rsmd.setColumnType(9, Types.REAL);
+        rsmd.setColumnType(10, Types.TINYINT);
+        rsmd.setColumnType(11, Types.DATE);
+        rsmd.setColumnType(12, Types.TIME);
+        rsmd.setColumnType(13, Types.TIMESTAMP);
+        rsmd.setColumnType(14, Types.VARBINARY);
+        rsmd.setColumnType(15, Types.ARRAY);
+        rsmd.setColumnType(16, Types.REF);
+        rsmd.setColumnType(17, Types.FLOAT);
+        crs.setMetaData(rsmd);
+
+    }
+
+    /*
+     * Add rows to DATAYPES table
+     */
+    protected void createDataTypesRows(RowSet crs) throws SQLException {
+
+        Integer aInteger = 100;
+        String aChar = "Oswald Cobblepot";
+        Long aLong = Long.MAX_VALUE;
+        Short aShort = Short.MAX_VALUE;
+        Double aDouble = Double.MAX_VALUE;
+        BigDecimal aBigDecimal = BigDecimal.ONE;
+        Boolean aBoolean = false;
+        Float aFloat = Float.MAX_VALUE;
+        Byte aByte = Byte.MAX_VALUE;
+        Date aDate = Date.valueOf(LocalDate.now());
+        Time aTime = Time.valueOf(LocalTime.now());
+        Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now());
+        Array aArray = new StubArray("INTEGER", new Object[1]);
+        Ref aRef = new SerialRef(new StubRef("INTEGER", query));
+        byte[] bytes = new byte[10];
+        crs.moveToInsertRow();
+        crs.updateInt(1, aInteger);
+        crs.updateString(2, aChar);
+        crs.updateString(3, aChar);
+        crs.updateLong(4, aLong);
+        crs.updateBoolean(5, aBoolean);
+        crs.updateShort(6, aShort);
+        crs.updateDouble(7, aDouble);
+        crs.updateBigDecimal(8, aBigDecimal);
+        crs.updateFloat(9, aFloat);
+        crs.updateByte(10, aByte);
+        crs.updateDate(11, aDate);
+        crs.updateTime(12, aTime);
+        crs.updateTimestamp(13, aTimeStamp);
+        crs.updateBytes(14, bytes);
+        crs.updateArray(15, aArray);
+        crs.updateRef(16, aRef);
+        crs.updateDouble(17, aDouble);
+        crs.insertRow();
+        crs.moveToCurrentRow();
+
+    }
+
+    /*
+     * Dermine if a Row exists in a ResultSet by its primary key
+     * If the parameter deleteRow is true, delete the row and validate
+     * the RowSet indicates it is deleted
+     */
+    protected boolean findRowByPrimaryKey(RowSet rs, int id, int idPos,
+            boolean deleteRow) throws Exception {
+        boolean foundRow = false;
+        rs.beforeFirst();
+        while (rs.next()) {
+            if (rs.getInt(idPos) == id) {
+                foundRow = true;
+                if (deleteRow) {
+                    rs.deleteRow();
+                    // validate row is marked as deleted
+                    assertTrue(rs.rowDeleted());
+                }
+                break;
+            }
+        }
+        return foundRow;
+    }
+
+    /*
+     * Wrapper method to find if a row exists within a RowSet by its primary key
+     */
+    protected boolean findRowByPrimaryKey(RowSet rs, int id, int idPos) throws Exception {
+        return findRowByPrimaryKey(rs, id, idPos, false);
+    }
+
+    /*
+     * Wrapper method to find if a row exists within a RowSet by its primary key
+     * and delete it
+     */
+    protected boolean deleteRowByPrimaryKey(RowSet rs, int id, int idPos) throws Exception {
+        return findRowByPrimaryKey(rs, id, idPos, true);
+    }
+
+    /*
+     * Utility method that compares two ResultSetMetaDataImpls for containing
+     * the same values
+     */
+    private void compareMetaData(ResultSetMetaData rsmd,
+            ResultSetMetaData rsmd1) throws SQLException {
+
+        assertEquals(rsmd1.getColumnCount(), rsmd.getColumnCount());
+        int cols = rsmd.getColumnCount();
+        for (int i = 1; i <= cols; i++) {
+            assertTrue(rsmd1.getCatalogName(i).equals(rsmd.getCatalogName(i)));
+            assertTrue(rsmd1.getColumnClassName(i).equals(rsmd.getColumnClassName(i)));
+            assertTrue(rsmd1.getColumnDisplaySize(i) == rsmd.getColumnDisplaySize(i));
+            assertTrue(rsmd1.getColumnLabel(i).equals(rsmd.getColumnLabel(i)));
+            assertTrue(rsmd1.getColumnName(i).equals(rsmd.getColumnName(i)));
+            assertTrue(rsmd1.getColumnType(i) == rsmd.getColumnType(i));
+            assertTrue(rsmd1.getPrecision(i) == rsmd.getPrecision(i));
+            assertTrue(rsmd1.getScale(i) == rsmd.getScale(i));
+            assertTrue(rsmd1.getSchemaName(i).equals(rsmd.getSchemaName(i)));
+            assertTrue(rsmd1.getTableName(i).equals(rsmd.getTableName(i)));
+            assertTrue(rsmd1.isAutoIncrement(i) == rsmd.isAutoIncrement(i));
+            assertTrue(rsmd1.isCaseSensitive(i) == rsmd.isCaseSensitive(i));
+            assertTrue(rsmd1.isCurrency(i) == rsmd.isCurrency(i));
+            assertTrue(rsmd1.isDefinitelyWritable(i) == rsmd.isDefinitelyWritable(i));
+            assertTrue(rsmd1.isNullable(i) == rsmd.isNullable(i));
+            assertTrue(rsmd1.isReadOnly(i) == rsmd.isReadOnly(i));
+            assertTrue(rsmd1.isSearchable(i) == rsmd.isSearchable(i));
+            assertTrue(rsmd1.isSigned(i) == rsmd.isSigned(i));
+            assertTrue(rsmd1.isWritable(i) == rsmd.isWritable(i));
+
+        }
+    }
+
+    /*
+     * Utility method to compare two rowsets
+     */
+    private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception {
+
+        int rows = crs.size();
+        assertTrue(rows == crs1.size());
+
+        ResultSetMetaData rsmd = crs.getMetaData();
+
+        compareMetaData(rsmd, crs1.getMetaData());
+        int cols = rsmd.getColumnCount();
+
+        for (int row = 1; row <= rows; row++) {
+            crs.absolute((row));
+            crs1.absolute(row);
+            for (int col = 1; col <= cols; col++) {
+                compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)),
+                        crs, crs1, col);
+            }
+        }
+
+    }
+
+    /*
+     * Utility method to compare two columns
+     */
+    private void compareColumnValue(JDBCType type, ResultSet rs, ResultSet rs1,
+            int col) throws SQLException {
+
+        switch (type) {
+            case INTEGER:
+                assertTrue(rs.getInt(col) == rs1.getInt(col));
+                break;
+            case CHAR:
+            case VARCHAR:
+                assertTrue(rs.getString(col).equals(rs1.getString(col)));
+                break;
+            case BIGINT:
+                assertTrue(rs.getLong(col) == rs1.getLong(col));
+                break;
+            case BOOLEAN:
+                assertTrue(rs.getBoolean(col) == rs1.getBoolean(col));
+                break;
+            case SMALLINT:
+                assertTrue(rs.getShort(col) == rs1.getShort(col));
+                break;
+            case DOUBLE:
+            case FLOAT:
+                assertTrue(rs.getDouble(col) == rs1.getDouble(col));
+                break;
+            case DECIMAL:
+                assertTrue(rs.getBigDecimal(col).equals(rs1.getBigDecimal(col)));
+                break;
+            case REAL:
+                assertTrue(rs.getFloat(col) == rs1.getFloat(col));
+                break;
+            case TINYINT:
+                assertTrue(rs.getByte(col) == rs1.getByte(col));
+                break;
+            case DATE:
+                assertTrue(rs.getDate(col).equals(rs1.getDate(col)));
+                break;
+            case TIME:
+                assertTrue(rs.getTime(col).equals(rs1.getTime(col)));
+                break;
+            case TIMESTAMP:
+                assertTrue(rs.getTimestamp(col).equals(rs1.getTimestamp(col)));
+                break;
+        }
+    }
+
+    /*
+     * Validate SyncProviderException is thrown when acceptChanges is called
+     * but there is not a way to make a connection to the datasource
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SyncProviderException.class)
+    public void commonCachedRowSetTest0000(CachedRowSet rs) throws Exception {
+        rs.acceptChanges();
+        rs.close();
+    }
+
+    /*
+     * Validate SyncProviderException is thrown when acceptChanges is called
+     * when null is passed as the datasource
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SyncProviderException.class)
+    public void commonCachedRowSetTest0001(CachedRowSet rs) throws Exception {
+        rs.acceptChanges(null);
+        rs.close();
+    }
+
+    /*
+     * Validate that that RIOPtimsticProvider is the default SyncProvider
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0002(CachedRowSet rs) throws SQLException {
+        SyncProvider sp = rs.getSyncProvider();
+        assertTrue(sp instanceof com.sun.rowset.providers.RIOptimisticProvider);
+        rs.close();
+    }
+
+    /*
+     * Validate that you can specify a SyncProvider
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0003(CachedRowSet rs) throws SQLException {
+
+        // Register a provider and make sure it is avaiable
+        SyncFactory.registerProvider(stubProvider);
+        rs.setSyncProvider(stubProvider);
+        SyncProvider sp = rs.getSyncProvider();
+        assertTrue(sp instanceof StubSyncProvider);
+        SyncFactory.unregisterProvider(stubProvider);
+        rs.close();
+    }
+
+    /*
+     * Create a RowSetListener and validate that notifyRowSetChanged is called
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0004(CachedRowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+        rs.release();
+        assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
+        rs.close();
+    }
+
+    /*
+     * Create a RowSetListener and validate that notifyRowSetChanged is called
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0005(CachedRowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+        rs.restoreOriginal();
+        assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
+        rs.close();
+    }
+
+    /*
+     * Create a RowSetListener and validate that notifyRowChanged is called
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0006(RowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+        rs.moveToInsertRow();
+        rs.updateInt(1, 10024);
+        rs.updateString(2, "Sacramento");
+        rs.updateInt(3, 1987);
+        rs.updateInt(4, 2341);
+        rs.updateInt(5, 4328);
+        rs.insertRow();
+        assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
+        rs.close();
+    }
+
+    /*
+     * Create a multiple RowSetListeners and validate that notifyRowChanged,
+     * notifiyMoved is called on all listners
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0007(RowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        TestRowSetListener rsl2 = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+        rs.addRowSetListener(rsl2);
+        rs.first();
+        rs.updateInt(1, 1961);
+        rs.updateString(2, "Pittsburgh");
+        rs.updateInt(3, 1987);
+        rs.updateInt(4, 2341);
+        rs.updateInt(5, 6689);
+        rs.updateRow();
+        assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED
+                | TestRowSetListener.ROW_CHANGED));
+        assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED
+                | TestRowSetListener.ROW_CHANGED));
+        rs.close();
+    }
+
+    /*
+     * Create a RowSetListener and validate that notifyRowChanged  and
+     * notifyCursorMoved are  called
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0008(CachedRowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+
+        rs.first();
+        assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
+        rs.deleteRow();
+        assertTrue(
+                rsl.isNotified(TestRowSetListener.ROW_CHANGED | TestRowSetListener.CURSOR_MOVED));
+        rsl.resetFlag();
+        rs.setShowDeleted(true);
+        rs.undoDelete();
+        assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
+        rs.close();
+    }
+
+    /*
+     * Create a RowSetListener and validate that notifyCursorMoved is called
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0009(RowSet rs) throws Exception {
+        TestRowSetListener rsl = new TestRowSetListener();
+        rs.addRowSetListener(rsl);
+        rs.beforeFirst();
+        assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
+        rs.close();
+    }
+
+    /*
+     * Validate that getTableName() returns the proper values
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0010(CachedRowSet rs) throws Exception {
+        assertNull(rs.getTableName());
+        rs.setTableName(COFFEE_HOUSES_TABLE);
+        assertTrue(rs.getTableName().equals(COFFEE_HOUSES_TABLE));
+        rs.close();
+    }
+
+    /*
+     * Validate that getKeyColumns() returns the proper values
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0011(CachedRowSet rs) throws Exception {
+        int[] pkeys = {1, 3};
+        assertNull(rs.getKeyColumns());
+        rs.setKeyColumns(pkeys);
+        assertEquals(rs.getKeyColumns(), pkeys);
+        rs.close();
+    }
+
+    /*
+     * Validate that setMatchColumn throws a SQLException if the column
+     * index specified is out of range
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0012(CachedRowSet rs) throws Exception {
+        rs.setMatchColumn(-1);
+        rs.close();
+    }
+
+    /*
+     * Validate that setMatchColumn throws a SQLException if the column
+     * index specified is out of range
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0013(CachedRowSet rs) throws Exception {
+        int[] cols = {1, -1};
+        rs.setMatchColumn(cols);
+        rs.close();
+    }
+
+    /*
+     * Validate that setMatchColumn throws a SQLException if the column
+     * index specified is out of range
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0014(CachedRowSet rs) throws Exception {
+        rs.setMatchColumn((String) null);
+        rs.close();
+    }
+
+    /*
+     * Validate that setMatchColumn throws a SQLException if the column
+     * index specified is out of range
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0015(CachedRowSet rs) throws Exception {
+        String[] cols = {"ID", null};
+        rs.setMatchColumn(cols);
+    }
+
+    /*
+     * Validate that getMatchColumn returns the same value specified by
+     * setMatchColumn
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
+    public void commonCachedRowSetTest0016(CachedRowSet rs) throws Exception {
+        int[] expectedCols = {1};
+        String[] expectedColNames = {"ID"};
+        rs.setMatchColumn(1);
+        int[] actualCols = rs.getMatchColumnIndexes();
+        String[] actualColNames = rs.getMatchColumnNames();
+        for (int i = 0; i < actualCols.length; i++) {
+            System.out.println(actualCols[i]);
+        }
+        assertEquals(actualCols, expectedCols);
+        assertEquals(actualColNames, expectedColNames);
+        rs.close();
+    }
+
+    /*
+     * Validate that getMatchColumn returns the same value specified by
+     * setMatchColumn
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
+    public void commonCachedRowSetTest0017(CachedRowSet rs) throws Exception {
+        int[] expectedCols = {1};
+        String[] expectedColNames = {"ID"};
+        rs.setMatchColumn(expectedColNames[0]);
+        int[] actualCols = rs.getMatchColumnIndexes();
+        String[] actualColNames = rs.getMatchColumnNames();
+        assertEquals(actualCols, expectedCols);
+        assertEquals(actualColNames, expectedColNames);
+        rs.close();
+    }
+
+    /*
+     * Validate that getMatchColumn returns the same valid value specified by
+     * setMatchColumn
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
+    public void commonCachedRowSetTest0018(CachedRowSet rs) throws Exception {
+        int[] expectedCols = {1, 3};
+        String[] expectedColNames = {"COF_ID", "SUP_ID"};
+        rs.setMatchColumn(expectedCols);
+        int[] actualCols = rs.getMatchColumnIndexes();
+        String[] actualColNames = rs.getMatchColumnNames();
+        assertEquals(actualCols, expectedCols);
+        assertEquals(actualColNames, expectedColNames);
+        assertEquals(actualCols, expectedCols);
+        rs.close();
+    }
+
+    /*
+     * Validate that getMatchColumn returns the same valid value specified by
+     * setMatchColumn
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
+    public void commonCachedRowSetTest0019(CachedRowSet rs) throws Exception {
+        int[] expectedCols = {1, 3};
+        String[] expectedColNames = {"COF_ID", "SUP_ID"};
+        rs.setMatchColumn(expectedColNames);
+        int[] actualCols = rs.getMatchColumnIndexes();
+        String[] actualColNames = rs.getMatchColumnNames();
+        assertEquals(actualCols, expectedCols);
+        assertEquals(actualColNames, expectedColNames);
+        rs.close();
+    }
+
+    /*
+     * Validate that getMatchColumnIndexes throws a SQLException if
+     * unsetMatchColumn has been called
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0020(CachedRowSet rs) throws Exception {
+        rs.setMatchColumn(1);
+        int[] actualCols = rs.getMatchColumnIndexes();
+        assertTrue(actualCols != null);
+        rs.unsetMatchColumn(1);
+        actualCols = rs.getMatchColumnIndexes();
+        rs.close();
+    }
+
+    /*
+     * Validate that getMatchColumnNames throws a SQLException if
+     * unsetMatchColumn has been called
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0021(CachedRowSet rs) throws Exception {
+        String matchColumn = "ID";
+        rs.setMatchColumn(matchColumn);
+        String[] actualColNames = rs.getMatchColumnNames();
+        assertTrue(actualColNames != null);
+        rs.unsetMatchColumn(matchColumn);
+        actualColNames = rs.getMatchColumnNames();
+        rs.close();
+    }
+
+    /*
+     * Validate that getMatchColumnIndexes throws a SQLException if
+     * unsetMatchColumn has been called
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0022(CachedRowSet rs) throws Exception {
+        int[] expectedCols = {1, 3};
+        rs.setMatchColumn(expectedCols);
+        int[] actualCols = rs.getMatchColumnIndexes();
+        assertTrue(actualCols != null);
+        rs.unsetMatchColumn(expectedCols);
+        actualCols = rs.getMatchColumnIndexes();
+        rs.close();
+    }
+
+    /*
+     * Validate that getMatchColumnNames throws a SQLException if
+     * unsetMatchColumn has been called
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0023(CachedRowSet rs) throws Exception {
+        String[] expectedColNames = {"COF_ID", "SUP_ID"};
+        rs.setMatchColumn(expectedColNames);
+        String[] actualColNames = rs.getMatchColumnNames();
+        assertTrue(actualColNames != null);
+        rs.unsetMatchColumn(expectedColNames);
+        actualColNames = rs.getMatchColumnNames();
+        rs.close();
+    }
+
+    /*
+     * Validate size() returns the correct number of rows
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0024(CachedRowSet rs) throws Exception {
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
+        rs.close();
+    }
+
+    /*
+     * Validate that the correct rows are returned comparing the primary
+     * keys
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0025(RowSet rs) throws SQLException {
+        assertEquals(getPrimaryKeys(rs), COFFEE_HOUSES_PRIMARY_KEYS);
+        rs.close();
+    }
+
+    /*
+     * Delete a row within the RowSet using its primary key
+     * Validate the visibility of the row depending on the value of
+     * setShowdelete
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0026(CachedRowSet rs) throws Exception {
+        Object[] afterDelete = {
+            10023, 33002, 10040, 32001, 10042, 10024, 10039, 10041,
+            33005, 33010, 10037, 10034, 32004
+        };
+        int rowToDelete = 10035;
+        // All rows should be found
+        assertEquals(getPrimaryKeys(rs), COFFEE_HOUSES_PRIMARY_KEYS);
+        // Delete the row
+        assertTrue(deleteRowByPrimaryKey(rs, rowToDelete, 1));
+        // With setShowDeleted(false) which is the default,
+        // the deleted row should not be visible
+        assertFalse(findRowByPrimaryKey(rs, rowToDelete, 1));
+        assertEquals(getPrimaryKeys(rs), afterDelete);
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
+        // With setShowDeleted(true), the deleted row should be visible
+        rs.setShowDeleted(true);
+        assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1));
+        rs.close();
+    }
+
+    /*
+     * Validate that there is no page size by default
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0027(CachedRowSet rs) throws Exception {
+        assertTrue(rs.getPageSize() == 0);
+        rs.close();
+    }
+
+    /*
+     * Validate the value you set via setPageSize is returned by getPageSize
+     * then reset to having no limit
+     */
+    @Test(dataProvider = "rowSetType")
+    public void commonCachedRowSetTest0028(CachedRowSet rs) throws Exception {
+        int rows = 100;
+        rs.setPageSize(rows);
+        assertTrue(rows == rs.getPageSize());
+        rs.setPageSize(0);
+        assertTrue(rs.getPageSize() == 0);
+        rs.close();
+    }
+
+    /*
+     * Validate SQLException is thrown when an invalid value is specified
+     * for setPageSize
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0029(CachedRowSet rs) throws Exception {
+        rs.setPageSize(-1);
+        rs.close();
+    }
+
+    /*
+     * Validate SQLException is thrown when nextPage is called without a
+     * call to populate or execute
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0030(CachedRowSet rs) throws Exception {
+        rs.nextPage();
+        rs.close();
+    }
+
+    /*
+     * Validate SQLException is thrown when previousPage is called without a
+     * call to populate or execute
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0031(CachedRowSet rs) throws Exception {
+        rs.previousPage();
+        rs.close();
+    }
+
+
+    /*
+     * Validate SQLException is thrown when execute is called
+     * but there is not a way to make a connection to the datasource
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0032(CachedRowSet rs) throws Exception {
+        rs.execute(null);
+        rs.close();
+    }
+
+    /*
+     * Validate SQLException is thrown when execute is called
+     * but there is not a way to make a connection to the datasource
+     */
+    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0033(CachedRowSet rs) throws Exception {
+        rs.execute();
+        rs.close();
+    }
+
+    /*
+     * Validate that toCollection(<column>) returns the proper values
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0034(CachedRowSet rs) throws Exception {
+        Object[] cities = {"Mendocino", "Seattle", "SF", "Portland", "SF",
+            "Sacramento", "Carmel", "LA", "Olympia", "Seattle", "SF",
+            "LA", "San Jose", "Eugene"};
+        rs.beforeFirst();
+        assertEquals(rs.toCollection(2).toArray(), cities);
+        assertEquals(rs.toCollection("CITY").toArray(), cities);
+        rs.close();
+    }
+
+    /*
+     * Validate that toCollection() returns the proper values
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0035(CachedRowSet rs) throws Exception {
+        Collection<?> col = rs.toCollection();
+        assertTrue(rs.size() == col.size());
+        assertTrue(rs.toCollection().containsAll(col)
+                && col.containsAll(rs.toCollection()));
+        try ( // Validate that False is returned when compared to a different RowSet;
+                CachedRowSet crs1 = createCoffeesRowSet()) {
+            assertFalse(crs1.toCollection().containsAll(col)
+                    && col.containsAll(crs1.toCollection()));
+        }
+        rs.close();
+
+    }
+
+    /*
+     * Validate that createCopy() returns the proper values
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0036(CachedRowSet rs) throws Exception {
+        try (CachedRowSet crs1 = rs.createCopy()) {
+            compareRowSets(rs, crs1);
+        }
+        rs.close();
+    }
+
+    /*
+     * Validate that createCopySchema() returns the proper values
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0037(CachedRowSet rs) throws Exception {
+        try (CachedRowSet crs1 = rs.createCopySchema()) {
+            assertTrue(crs1.size() == 0);
+            compareMetaData(crs1.getMetaData(), rs.getMetaData());
+        }
+        rs.close();
+    }
+
+    /*
+     * Validate that createCopyNoConstraints() returns the proper values
+     * and getMatchColumnIndexes should throw a SQLException. This test
+     * specifies setMatchColumn(int)
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0038(CachedRowSet rs) throws Exception {
+        rs.setMatchColumn(1);
+        try (CachedRowSet crs1 = rs.createCopyNoConstraints()) {
+            assertTrue(crs1.size() == COFFEE_HOUSES_ROWS);
+            compareRowSets(rs, crs1);
+            boolean recievedSQE = false;
+            try {
+                int[] indexes = crs1.getMatchColumnIndexes();
+            } catch (SQLException e) {
+                recievedSQE = true;
+            }
+            assertTrue(recievedSQE);
+            recievedSQE = false;
+            try {
+                String[] colNames = crs1.getMatchColumnNames();
+            } catch (SQLException e) {
+                recievedSQE = true;
+            }
+            assertTrue(recievedSQE);
+        }
+        rs.close();
+    }
+
+    /*
+     * Validate that createCopyNoConstraints() returns the proper values
+     * and getMatchColumnIndexes should throw a SQLException. This test
+     * specifies setMatchColumn(String)
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0039(CachedRowSet rs) throws Exception {
+        rs.setMatchColumn("ID");
+        try (CachedRowSet crs1 = rs.createCopyNoConstraints()) {
+            assertTrue(crs1.size() == COFFEE_HOUSES_ROWS);
+            compareRowSets(rs, crs1);
+            boolean recievedSQE = false;
+            try {
+                int[] indexes = crs1.getMatchColumnIndexes();
+            } catch (SQLException e) {
+                recievedSQE = true;
+            }
+            assertTrue(recievedSQE);
+            recievedSQE = false;
+            try {
+                String[] colNames = crs1.getMatchColumnNames();
+            } catch (SQLException e) {
+                recievedSQE = true;
+            }
+            assertTrue(recievedSQE);
+        }
+        rs.close();
+    }
+
+    /*
+     * Validate that columnUpdated works with the various datatypes specifying
+     * the column index
+     */
+    @Test(dataProvider = "rowsetUsingDataTypes")
+    public void commonCachedRowSetTest0040(CachedRowSet rs, JDBCType type) throws Exception {
+        rs.beforeFirst();
+        assertTrue(rs.next());
+        switch (type) {
+            case INTEGER:
+                assertFalse(rs.columnUpdated(1));
+                rs.updateInt(1, Integer.MIN_VALUE);
+                assertTrue(rs.columnUpdated(1));
+                break;
+            case CHAR:
+                assertFalse(rs.columnUpdated(2));
+                rs.updateString(2, "foo");
+                assertTrue(rs.columnUpdated(2));
+                break;
+            case VARCHAR:
+                assertFalse(rs.columnUpdated(3));
+                rs.updateString(3, "foo");
+                assertTrue(rs.columnUpdated(3));
+                break;
+            case BIGINT:
+                assertFalse(rs.columnUpdated(4));
+                rs.updateLong(4, Long.MIN_VALUE);
+                assertTrue(rs.columnUpdated(4));
+                break;
+            case BOOLEAN:
+                assertFalse(rs.columnUpdated(5));
+                rs.updateBoolean(5, false);
+                assertTrue(rs.columnUpdated(5));
+                break;
+            case SMALLINT:
+                assertFalse(rs.columnUpdated(6));
+                rs.updateShort(6, Short.MIN_VALUE);
+                assertTrue(rs.columnUpdated(6));
+                break;
+            case DOUBLE:
+                assertFalse(rs.columnUpdated(7));
+                rs.updateDouble(7, Double.MIN_VALUE);
+                assertTrue(rs.columnUpdated(7));
+                break;
+            case DECIMAL:
+                assertFalse(rs.columnUpdated(8));
+                rs.updateBigDecimal(8, BigDecimal.TEN);
+                assertTrue(rs.columnUpdated(8));
+                break;
+            case REAL:
+                assertFalse(rs.columnUpdated(9));
+                rs.updateFloat(9, Float.MIN_VALUE);
+                assertTrue(rs.columnUpdated(9));
+                break;
+            case TINYINT:
+                assertFalse(rs.columnUpdated(10));
+                rs.updateByte(10, Byte.MIN_VALUE);
+                assertTrue(rs.columnUpdated(10));
+                break;
+            case DATE:
+                assertFalse(rs.columnUpdated(11));
+                rs.updateDate(11, Date.valueOf(LocalDate.now()));
+                assertTrue(rs.columnUpdated(11));
+                break;
+            case TIME:
+                assertFalse(rs.columnUpdated(12));
+                rs.updateTime(12, Time.valueOf(LocalTime.now()));
+                assertTrue(rs.columnUpdated(12));
+                break;
+            case TIMESTAMP:
+                assertFalse(rs.columnUpdated(13));
+                rs.updateTimestamp(13, Timestamp.valueOf(LocalDateTime.now()));
+                assertTrue(rs.columnUpdated(13));
+                break;
+            case VARBINARY:
+                assertFalse(rs.columnUpdated(14));
+                rs.updateBytes(14, new byte[1]);
+                assertTrue(rs.columnUpdated(14));
+                break;
+            case ARRAY:
+                assertFalse(rs.columnUpdated(15));
+                rs.updateArray(15, new StubArray("VARCHAR", new Object[10]));
+                assertTrue(rs.columnUpdated(15));
+                break;
+            case REF:
+                assertFalse(rs.columnUpdated(16));
+                rs.updateRef(16, new StubRef("INTEGER", query));
+                assertTrue(rs.columnUpdated(16));
+                break;
+            case FLOAT:
+                assertFalse(rs.columnUpdated(17));
+                rs.updateDouble(17, Double.MIN_NORMAL);
+                assertTrue(rs.columnUpdated(17));
+        }
+
+    }
+
+    /*
+     * Validate that columnUpdated works with the various datatypes specifying
+     * the column name
+     */
+    @Test(dataProvider = "rowsetUsingDataTypes")
+    public void commonCachedRowSetTest0041(CachedRowSet rs, JDBCType type) throws Exception {
+        rs.beforeFirst();
+        assertTrue(rs.next());
+        switch (type) {
+            case INTEGER:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[0]));
+                rs.updateInt(DATATYPES_COLUMN_NAMES[0], Integer.MIN_VALUE);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[0]));
+                break;
+            case CHAR:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[1]));
+                rs.updateString(DATATYPES_COLUMN_NAMES[1], "foo");
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[1]));
+                break;
+            case VARCHAR:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[2]));
+                rs.updateString(DATATYPES_COLUMN_NAMES[2], "foo");
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[2]));
+                break;
+            case BIGINT:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[3]));
+                rs.updateLong(DATATYPES_COLUMN_NAMES[3], Long.MIN_VALUE);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[3]));
+                break;
+            case BOOLEAN:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[4]));
+                rs.updateBoolean(DATATYPES_COLUMN_NAMES[4], false);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[4]));
+                break;
+            case SMALLINT:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[5]));
+                rs.updateShort(DATATYPES_COLUMN_NAMES[5], Short.MIN_VALUE);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[5]));
+                break;
+            case DOUBLE:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[6]));
+                rs.updateDouble(DATATYPES_COLUMN_NAMES[6], Double.MIN_VALUE);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[6]));
+                break;
+            case DECIMAL:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[7]));
+                rs.updateBigDecimal(DATATYPES_COLUMN_NAMES[7], BigDecimal.TEN);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[7]));
+                break;
+            case REAL:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[8]));
+                rs.updateFloat(DATATYPES_COLUMN_NAMES[8], Float.MIN_VALUE);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[8]));
+                break;
+            case TINYINT:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[9]));
+                rs.updateByte(DATATYPES_COLUMN_NAMES[9], Byte.MIN_VALUE);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[9]));
+                break;
+            case DATE:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[10]));
+                rs.updateDate(DATATYPES_COLUMN_NAMES[10], Date.valueOf(LocalDate.now()));
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[10]));
+                break;
+            case TIME:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[11]));
+                rs.updateTime(DATATYPES_COLUMN_NAMES[11], Time.valueOf(LocalTime.now()));
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[11]));
+                break;
+            case TIMESTAMP:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[12]));
+                rs.updateTimestamp(DATATYPES_COLUMN_NAMES[12], Timestamp.valueOf(LocalDateTime.now()));
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[12]));
+                break;
+            case VARBINARY:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[13]));
+                rs.updateBytes(DATATYPES_COLUMN_NAMES[13], new byte[1]);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[13]));
+                break;
+            case ARRAY:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[14]));
+                rs.updateArray(DATATYPES_COLUMN_NAMES[14], new StubArray("VARCHAR", new Object[10]));
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[14]));
+                break;
+            case REF:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[15]));
+                rs.updateRef(DATATYPES_COLUMN_NAMES[15], new StubRef("INTEGER", query));
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[15]));
+                break;
+            case FLOAT:
+                assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[16]));
+                rs.updateDouble(DATATYPES_COLUMN_NAMES[16], Double.MIN_NORMAL);
+                assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[16]));
+                break;
+        }
+
+    }
+
+    /*
+     * Validate isBeforeFirst(), isFirst() and first() return the correct
+     * results
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0042(RowSet rs) throws Exception {
+        assertFalse(rs.isBeforeFirst());
+        assertFalse(rs.isFirst());
+        rs.beforeFirst();
+        assertTrue(rs.isBeforeFirst());
+        assertFalse(rs.isFirst());
+        rs.next();
+        assertFalse(rs.isBeforeFirst());
+        assertTrue(rs.isFirst());
+        rs.next();
+        assertFalse(rs.isBeforeFirst());
+        assertFalse(rs.isFirst());
+        rs.first();
+        assertFalse(rs.isBeforeFirst());
+        assertTrue(rs.isFirst());
+        rs.close();
+    }
+
+    /*
+     * Validate isAfterLast(), isLast() and last() return the correct
+     * results
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0043(RowSet rs) throws Exception {
+        assertFalse(rs.isAfterLast());
+        assertFalse(rs.isLast());
+        rs.afterLast();
+        assertTrue(rs.isAfterLast());
+        assertFalse(rs.isLast());
+        rs.previous();
+        assertFalse(rs.isAfterLast());
+        assertTrue(rs.isLast());
+        rs.previous();
+        assertFalse(rs.isAfterLast());
+        assertFalse(rs.isLast());
+        rs.last();
+        assertFalse(rs.isAfterLast());
+        assertTrue(rs.isLast());
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoDelete is called on the
+     * insertRow
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0044(CachedRowSet rs) throws Exception {
+        rs.insertRow();
+        rs.undoDelete();
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoDelete is called when
+     * cursor is before the first row
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0045(CachedRowSet rs) throws Exception {
+        rs.setShowDeleted(true);
+        rs.beforeFirst();
+        rs.undoDelete();
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoDelete is called when
+     * cursor is after the last row
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0046(CachedRowSet rs) throws Exception {
+        rs.setShowDeleted(true);
+        rs.afterLast();
+        rs.undoDelete();
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoUpdate is called on the
+     * insertRow
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0047(CachedRowSet rs) throws Exception {
+        rs.insertRow();
+        rs.undoUpdate();
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoUpdate is called when
+     * cursor is before the first row
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0048(CachedRowSet rs) throws Exception {
+        rs.setShowDeleted(true);
+        rs.beforeFirst();
+        rs.undoUpdate();
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoUpdate is called when
+     * cursor is after the last row
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0049(CachedRowSet rs) throws Exception {
+        rs.setShowDeleted(true);
+        rs.afterLast();
+        rs.undoUpdate();
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoInsert is called on the
+     * insertRow
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0050(CachedRowSet rs) throws Exception {
+        rs.insertRow();
+        rs.undoInsert();
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoInsert is called when
+     * cursor is before the first row
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0051(CachedRowSet rs) throws Exception {
+        rs.setShowDeleted(true);
+        rs.beforeFirst();
+        rs.undoInsert();
+        rs.close();
+    }
+
+    /*
+     * Validate a SQLException is thrown when undoInsert is called when
+     * cursor is after the last row
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses",
+            expectedExceptions = SQLException.class)
+    public void commonCachedRowSetTest0052(CachedRowSet rs) throws Exception {
+        rs.setShowDeleted(true);
+        rs.afterLast();
+        rs.undoInsert();
+        rs.close();
+    }
+
+    /*
+     * Insert a row, then call undoInsert to roll back the insert and validate
+     * the row is not there
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0053(CachedRowSet rs) throws Exception {
+        int rowToInsert = 1961;
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
+        // Add new row
+        rs.moveToInsertRow();
+        rs.updateInt(1, rowToInsert);
+        rs.updateString(2, "GOTHAM");
+        rs.updateInt(3, 3450);
+        rs.updateInt(4, 2005);
+        rs.updateInt(5, 5455);
+        rs.insertRow();
+        rs.moveToCurrentRow();
+        // check that the number of rows has increased
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
+        assertTrue(findRowByPrimaryKey(rs, rowToInsert, 1));
+        rs.undoInsert();
+        // Check to make sure the row is no longer there
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
+        assertFalse(findRowByPrimaryKey(rs, rowToInsert, 1));
+        rs.close();
+    }
+
+    /*
+     * Insert a row, delete the row and then call undoDelete to make sure it
+     * is comes back
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0054(CachedRowSet rs) throws Exception {
+        int rowToDelete = 1961;
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
+        // Add new row
+        rs.moveToInsertRow();
+        rs.updateInt(1, rowToDelete);
+        rs.updateString(2, "GOTHAM");
+        rs.updateInt(3, 3450);
+        rs.updateInt(4, 2005);
+        rs.updateInt(5, 5455);
+        rs.insertRow();
+        rs.moveToCurrentRow();
+        // check that the number of rows has increased
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
+        assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1));
+        rs.absolute(COFFEE_HOUSES_ROWS + 1);
+        rs.deleteRow();
+        // Check to make sure the row is no longer there
+        //assertTrue(rs.size() ==  COFFEE_HOUSES_ROWS);
+        assertFalse(findRowByPrimaryKey(rs, rowToDelete, 1));
+        rs.setShowDeleted(true);
+        rs.absolute(COFFEE_HOUSES_ROWS + 1);
+        rs.undoDelete();
+        // check that the row is back
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
+        assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1));
+        rs.close();
+    }
+
+    /*
+     * Insert a row, modify a field and then call undoUpdate to revert the
+     * insert
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0055(CachedRowSet rs) throws Exception {
+        int rowToInsert = 1961;
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
+        // Add new row
+        rs.moveToInsertRow();
+        rs.updateInt(1, rowToInsert);
+        rs.updateString(2, "GOTHAM");
+        rs.updateInt(3, 3450);
+        rs.updateInt(4, 2005);
+        rs.updateInt(5, 5455);
+        rs.insertRow();
+        rs.moveToCurrentRow();
+        // check that the number of rows has increased
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
+        assertTrue(findRowByPrimaryKey(rs, rowToInsert, 1));
+        rs.absolute(COFFEE_HOUSES_ROWS + 1);
+        // Save off the original column values
+        String f2 = rs.getString(2);
+        int f3 = rs.getInt(3);
+        rs.updateString(2, "SMALLVILLE");
+        rs.updateInt(3, 500);
+        // Validate the columns have been updated
+        assertTrue(rs.columnUpdated(2));
+        assertTrue(rs.columnUpdated(3));
+        // Undo the update and validate it has taken place
+        rs.absolute(COFFEE_HOUSES_ROWS + 1);
+        rs.undoUpdate();
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
+        assertFalse(findRowByPrimaryKey(rs, rowToInsert, 1));
+        rs.close();
+    }
+
+    /*
+     * Validate getOriginal returns a ResultSet which is a copy of the original
+     * RowSet
+     */
+    @Test(dataProvider = "rowsetUsingCoffees")
+    public void commonCachedRowSetTest0056(CachedRowSet rs) throws Exception {
+        String coffee = "Hazelnut";
+        int sales = 100;
+        int id = 200;
+        Object[] updatedPkeys = {1, id, 3, 4, 5};
+        // Change the coffee name and sales total for row 2 and save the
+        // previous values
+        rs.absolute(2);
+        int origId = rs.getInt(1);
+        String origCoffee = rs.getString(2);
+        int origSales = rs.getInt(5);
+        rs.updateInt(1, id);
+        rs.updateString(2, coffee);
+        rs.updateInt(5, sales);
+        // MetaData should match
+        try ( // Get the original original RowSet and validate that the changes
+                // are only made to the current, not the original
+                ResultSet rs1 = rs.getOriginal()) {
+            // MetaData should match
+            compareMetaData(rs.getMetaData(), rs1.getMetaData());
+            assertTrue(rs1.isBeforeFirst());
+            assertTrue(rs1.getConcurrency() == ResultSet.CONCUR_UPDATABLE);
+            assertTrue(rs1.getType() == ResultSet.TYPE_SCROLL_INSENSITIVE);
+            rs1.absolute(2);
+            // Check original rowset is not changed
+            assertTrue(rs1.getInt(1) == origId);
+            assertTrue(rs1.getString(2).equals(origCoffee));
+            assertTrue(rs1.getInt(5) == origSales);
+            assertEquals(getPrimaryKeys(rs1), COFFEES_PRIMARY_KEYS);
+            // Check current rowset
+            assertTrue(rs.getInt(1) == id);
+            assertTrue(rs.getString(2).equals(coffee));
+            assertTrue(rs.getInt(5) == sales);
+            assertEquals(getPrimaryKeys(rs), updatedPkeys);
+        }
+        rs.close();
+    }
+
+    /*
+     * Validate getOriginalRow returns a ResultSet which is a copy of the
+     * original row that was modified
+     */
+    @Test(dataProvider = "rowsetUsingCoffees")
+    public void commonCachedRowSetTest0057(CachedRowSet rs) throws Exception {
+        String coffee = "Hazelnut";
+        int sales = 100;
+        int id = 200;
+        Object[] updatedPkeys = {1, id, 3, 4, 5};
+        // Change the coffee name and sales total for row 2 and save the
+        // previous values
+        rs.absolute(2);
+        int origId = rs.getInt(1);
+        String origCoffee = rs.getString(2);
+        int origSales = rs.getInt(5);
+        rs.updateInt(1, id);
+        rs.updateString(2, coffee);
+        rs.updateInt(5, sales);
+        // MetaData should match
+        try ( // Get the original original row and validate that the changes
+                // are only made to the current, not the original
+                ResultSet rs1 = rs.getOriginalRow()) {
+            // MetaData should match
+            compareMetaData(rs.getMetaData(), rs1.getMetaData());
+            assertTrue(rs1.isBeforeFirst());
+            assertTrue(rs1.getConcurrency() == ResultSet.CONCUR_UPDATABLE);
+            assertTrue(rs1.getType() == ResultSet.TYPE_SCROLL_INSENSITIVE);
+            rs1.next();
+            assertTrue(rs1.isFirst() && rs1.isLast());
+            assertTrue(rs1.getRow() == 1);
+            // Check original row is not changed
+            assertTrue(rs1.getInt(1) == origId);
+            assertTrue(rs1.getString(2).equals(origCoffee));
+            assertTrue(rs1.getInt(5) == origSales);
+            // Check current row
+            assertTrue(rs.getInt(1) == id);
+            assertTrue(rs.getString(2).equals(coffee));
+            assertTrue(rs.getInt(5) == sales);
+            assertEquals(getPrimaryKeys(rs), updatedPkeys);
+        }
+        rs.close();
+    }
+
+    /*
+     * Validate that restoreOrginal will restore the RowSet to its
+     * state prior to the insert of a row
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0058(CachedRowSet rs) throws Exception {
+        int rowToInsert = 1961;
+        assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
+        try ( // Add new row
+                CachedRowSet crs1 = rsf.createCachedRowSet()) {
+            rs.beforeFirst();
+            crs1.populate(rs);
+            TestRowSetListener rsl = new TestRowSetListener();
+            crs1.addRowSetListener(rsl);
+            crs1.moveToInsertRow();
+            crs1.updateInt(1, rowToInsert);
+            crs1.updateString(2, "GOTHAM");
+            crs1.updateInt(3, 3450);
+            crs1.updateInt(4, 2005);
+            crs1.updateInt(5, 5455);
+            crs1.insertRow();
+            assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
+            crs1.moveToCurrentRow();
+            assertTrue(findRowByPrimaryKey(crs1, rowToInsert, 1));
+            // Restore back to our original state and the
+            // previously inserted row should not be there
+            rsl.resetFlag();
+            crs1.restoreOriginal();
+            assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
+            assertTrue(crs1.isBeforeFirst());
+            crs1.last();
+            assertFalse(crs1.rowInserted());
+            assertFalse(findRowByPrimaryKey(crs1, rowToInsert, 1));
+        }
+        rs.close();
+    }
+
+    /*
+     * Validate that restoreOrginal will restore the RowSet to its
+     * state prior to deleting a row
+     */
+    @Test(dataProvider = "rowsetUsingCoffees", enabled = true)
+    public void commonCachedRowSetTest0059(CachedRowSet rs) throws Exception {
+        int rowToDelete = 2;
+        try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
+            rs.beforeFirst();
+            crs1.populate(rs);
+            TestRowSetListener rsl = new TestRowSetListener();
+            crs1.addRowSetListener(rsl);
+            // Delete a row, the PK is also the absolute position as a List
+            // backs the RowSet
+            crs1.absolute(rowToDelete);
+            crs1.deleteRow();
+            assertTrue(crs1.rowDeleted());
+            assertFalse(findRowByPrimaryKey(crs1, rowToDelete, 1));
+            // Restore back to our original state and the
+            // previously deleted row should be there
+            rsl.resetFlag();
+            crs1.restoreOriginal();
+            assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
+            assertTrue(crs1.isBeforeFirst());
+            crs1.absolute(rowToDelete);
+            assertFalse(crs1.rowDeleted());
+            assertTrue(findRowByPrimaryKey(crs1, rowToDelete, 1));
+        }
+        rs.close();
+    }
+
+    /*
+     * Validate that restoreOrginal will restore the RowSet to its
+     * state prior to updating a row
+     */
+    @Test(dataProvider = "rowsetUsingCoffees", enabled = true)
+    public void commonCachedRowSetTest0060(CachedRowSet rs) throws Exception {
+        int rowToUpdate = 2;
+        String coffee = "Hazelnut";
+        try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
+            rs.beforeFirst();
+            crs1.populate(rs);
+            TestRowSetListener rsl = new TestRowSetListener();
+            crs1.addRowSetListener(rsl);
+            // Delete a row, the PK is also the absolute position as a List
+            // backs the RowSet
+            crs1.absolute(rowToUpdate);
+            String origCoffee = crs1.getString(2);
+            crs1.updateString(2, coffee);
+            assertTrue(crs1.columnUpdated(2));
+            crs1.updateRow();
+            assertTrue(crs1.rowUpdated());
+            assertFalse(origCoffee.equals(crs1.getString(2)));
+            // Restore back to our original state and the
+            // previous value for the column within the row should be there
+            rsl.resetFlag();
+            crs1.restoreOriginal();
+            assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
+            assertTrue(crs1.isBeforeFirst());
+            // absolute() is failing for some reason so need to look at this later
+            crs1.next();
+            crs1.next();
+            assertFalse(crs1.columnUpdated(2));
+            assertFalse(crs1.rowUpdated());
+            assertTrue(origCoffee.equals(crs1.getString(2)));
+        }
+        rs.close();
+    }
+
+    /*
+     * Initialize a RowSet via the populate method. Validate it matches
+     * the original ResultSet
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0061(CachedRowSet rs) throws Exception {
+        try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
+            rs.beforeFirst();
+            crs1.populate(rs);
+            compareRowSets(rs, crs1);
+        }
+        rs.close();
+    }
+
+    /*
+     * Initialize a RowSet via the populate method specifying a starting row.
+     * Validate it matches the original ResultSet starting for the specofied
+     * offset
+     */
+    @Test(dataProvider = "rowsetUsingCoffeeHouses")
+    public void commonCachedRowSetTest0062(CachedRowSet rs) throws Exception {
+        Object[] expectedRows = {
+            32001, 10042, 10024, 10039, 10041, 33005, 33010, 10035, 10037,
+            10034, 32004
+        };
+        int startingRow = 4;
+        try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
+            rs.beforeFirst();
+            crs1.populate(rs, startingRow);
+            assertEquals(crs1.size(), COFFEE_HOUSES_ROWS - startingRow + 1);
+            assertEquals(getPrimaryKeys(crs1), expectedRows);
+        }
+        rs.close();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/sql/testng/test/rowset/filteredrowset/CityFilter.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+package test.rowset.filteredrowset;
+
+import java.sql.SQLException;
+import javax.sql.RowSet;
+import javax.sql.rowset.Predicate;
+
+/*
+ * Simple implementation of Predicate which is used to filter rows based
+ * on a City.
+ */
+public class CityFilter implements Predicate {
+
+    private final String[] cities;
+    private String colName = null;
+    private int colNumber = -1;
+
+    public CityFilter(String[] cities, String colName) {
+        this.cities = cities;
+        this.colName = colName;
+    }
+
+    public CityFilter(String[] cities, int colNumber) {
+        this.cities = cities;
+        this.colNumber = colNumber;
+    }
+
+    public boolean evaluate(Object value, String colName) {
+
+        if (colName.equalsIgnoreCase(this.colName)) {
+            for (String city : cities) {
+                if (city.equalsIgnoreCase((String) value)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public boolean evaluate(Object value, int colNumber) {
+
+        if (colNumber == this.colNumber) {
+            for (String city : this.cities) {
+                if (city.equalsIgnoreCase((String) value)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public boolean evaluate(RowSet rs) {
+
+        boolean result = false;
+
+        if (rs == null) {
+            return false;
+        }
+
+        try {
+            for (String city : cities) {
+
+                String val = "";
+                if (colNumber > 0) {
+                    val = (String) rs.getObject(colNumber);
+                } else if (colName != null) {
+                    val = (String) rs.getObject(colName);
+                }
+
+                if (val.equalsIgnoreCase(city)) {
+                    return true;
+                }
+            }
+        } catch (SQLException e) {
+            result = false;
+        }
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/sql/testng/test/rowset/filteredrowset/FilteredRowSetTests.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,140 @@
+/*
+ * 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.
+ */
+package test.rowset.filteredrowset;
+
+import java.sql.SQLException;
+import javax.sql.RowSet;
+import javax.sql.rowset.FilteredRowSet;
+import javax.sql.rowset.Predicate;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import test.rowset.webrowset.CommonWebRowSetTests;
+
+public class FilteredRowSetTests extends CommonWebRowSetTests {
+
+    private FilteredRowSet frs;
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+        frs = createCoffeeHousesRowSet();
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+        frs.close();
+    }
+
+    protected FilteredRowSet newInstance() throws SQLException {
+        return rsf.createFilteredRowSet();
+    }
+
+    /*
+     * Validate getFilter returns null if setFilter has not been called
+     */
+    @Test
+    public void FilteredRowSetTest0000() throws SQLException {
+        assertNull(frs.getFilter());
+    }
+
+    /*
+     * Call setFilter to set a Predicate and validate that getFilter
+     * returns the correct Predicate
+     */
+    @Test
+    public void FilteredRowSetTest0001() throws SQLException {
+        Predicate p = new PrimaryKeyFilter(0, 100030, 1);
+        frs.setFilter(p);
+        assertTrue(frs.getFilter().equals(p));
+        frs.setFilter(null);
+        assertNull(frs.getFilter());
+    }
+
+    /*
+     * Validate that the correct rows are returned when a Predicate using
+     * a column index is used
+     */
+    @Test
+    public void FilteredRowSetTest0002() throws SQLException {
+        Object[] expectedKeys = {
+            10023, 10040, 10042, 10024, 10039, 10041, 10035, 10037, 10034
+        };
+        frs.setFilter(new PrimaryKeyFilter(10000, 10999, 1));
+        assertEquals(getPrimaryKeys(frs), expectedKeys);
+    }
+
+    /*
+     * Validate that the correct rows are returned when a Predicate using
+     * a column Label is used
+     */
+    @Test
+    public void FilteredRowSetTest0003() throws SQLException {
+        Object[] expectedKeys = {
+            10023, 10040, 10042, 10024, 10039, 10041, 10035, 10037, 10034
+        };
+        frs.setFilter(new PrimaryKeyFilter(10000, 10999, "STORE_ID"));
+        assertEquals(getPrimaryKeys(frs), expectedKeys);
+
+    }
+
+    /*
+     * Validate that the correct rows are returned when a Predicate using
+     * a column index is used
+     */
+    @Test
+    public void FilteredRowSetTest0004() throws SQLException {
+        Object[] expectedKeys = {
+            10040, 10042, 10041, 10035, 10037
+        };
+        String[] cityArray = {"SF", "LA"};
+        frs.setFilter(new CityFilter(cityArray, 2));
+        assertEquals(getPrimaryKeys(frs), expectedKeys);
+    }
+
+    /*
+     * Validate that the correct rows are returned when a Predicate using
+     * a column Label is used
+     */
+    @Test
+    public void FilteredRowSetTest0005() throws SQLException {
+        Object[] expectedKeys = {
+            10040, 10042, 10041, 10035, 10037
+        };
+        String[] cityArray = {"SF", "LA"};
+        frs.setFilter(new CityFilter(cityArray, "CITY"));
+        assertEquals(getPrimaryKeys(frs), expectedKeys);
+    }
+
+
+    // Tests that are common but need to be disabled due to an implementation bug
+
+
+    @Test(dataProvider = "rowSetType", enabled = false)
+    public void commonCachedRowSetTest0043(RowSet rs) throws Exception {
+        // Need to fix bug in FilteredRowSets
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/sql/testng/test/rowset/filteredrowset/PrimaryKeyFilter.java	Sat Jan 24 23:23:25 2015 -0800
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+package test.rowset.filteredrowset;
+
+import javax.sql.RowSet;
+import javax.sql.rowset.Predicate;
+
+/*
+ * Simple implementation of Predicate which is used to filter rows based
+ * on the Primary Key.
+ */
+public class PrimaryKeyFilter implements Predicate {
+
+    private final int lo;
+    private final int hi;
+    private String colName = null;
+    private int colNumber = -1;
+
+    public PrimaryKeyFilter(int lo, int hi, int colNumber) {
+        this.lo = lo;