changeset 10701:7984c5916743

Merge
author lana
date Thu, 23 Apr 2015 16:04:22 -0700
parents 4e2206aa336c 2f670a37f171
children f9efdeff987d
files
diffstat 23 files changed, 878 insertions(+), 154 deletions(-) [+]
line wrap: on
line diff
--- a/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java	Thu Apr 23 16:04:22 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -72,10 +72,6 @@
     private static String formatVersion;
     private static String dataVersion;
     private static String validCurrencyCodes;
-    private static String currenciesWith0MinorUnitDecimals;
-    private static String currenciesWith1MinorUnitDecimal;
-    private static String currenciesWith3MinorUnitDecimal;
-    private static String currenciesWithMinorUnitsUndefined;
 
     // handy constants - must match definitions in java.util.Currency
     // magic number
@@ -83,29 +79,31 @@
     // number of characters from A to Z
     private static final int A_TO_Z = ('Z' - 'A') + 1;
     // entry for invalid country codes
-    private static final int INVALID_COUNTRY_ENTRY = 0x007F;
+    private static final int INVALID_COUNTRY_ENTRY = 0x0000007F;
     // entry for countries without currency
-    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x0080;
+    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x00000200;
     // mask for simple case country entries
-    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x0000;
+    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x00000000;
     // mask for simple case country entry final character
-    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x001F;
+    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x0000001F;
     // mask for simple case country entry default currency digits
-    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x0060;
+    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x000001E0;
     // shift count for simple case country entry default currency digits
     private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_SHIFT = 5;
+    // maximum number for simple case country entry default currency digits
+    private static final int SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS = 9;
     // mask for special case country entries
-    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x0080;
+    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x00000200;
     // mask for special case country index
-    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x001F;
+    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x0000001F;
     // delta from entry index component in main table to index into special case tables
     private static final int SPECIAL_CASE_COUNTRY_INDEX_DELTA = 1;
     // mask for distinguishing simple and special case countries
     private static final int COUNTRY_TYPE_MASK = SIMPLE_CASE_COUNTRY_MASK | SPECIAL_CASE_COUNTRY_MASK;
     // mask for the numeric code of the currency
-    private static final int NUMERIC_CODE_MASK = 0x0003FF00;
+    private static final int NUMERIC_CODE_MASK = 0x000FFC00;
     // shift count for the numeric code of the currency
-    private static final int NUMERIC_CODE_SHIFT = 8;
+    private static final int NUMERIC_CODE_SHIFT = 10;
 
     // generated data
     private static int[] mainTable = new int[A_TO_Z * A_TO_Z];
@@ -120,7 +118,7 @@
     private static int[] specialCaseOldCurrenciesNumericCode = new int[maxSpecialCases];
     private static int[] specialCaseNewCurrenciesNumericCode = new int[maxSpecialCases];
 
-    private static final int maxOtherCurrencies = 70;
+    private static final int maxOtherCurrencies = 128;
     private static int otherCurrenciesCount = 0;
     private static StringBuffer otherCurrencies = new StringBuffer();
     private static int[] otherCurrenciesDefaultFractionDigits = new int[maxOtherCurrencies];
@@ -129,6 +127,11 @@
     // date format for parsing cut-over times
     private static SimpleDateFormat format;
 
+    // Minor Units
+    private static String[] currenciesWithDefinedMinorUnitDecimals =
+        new String[SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS + 1];
+    private static String currenciesWithMinorUnitsUndefined;
+
     public static void main(String[] args) {
 
         // Look for "-o outputfilename" option
@@ -171,16 +174,14 @@
         formatVersion = (String) currencyData.get("formatVersion");
         dataVersion = (String) currencyData.get("dataVersion");
         validCurrencyCodes = (String) currencyData.get("all");
-        currenciesWith0MinorUnitDecimals  = (String) currencyData.get("minor0");
-        currenciesWith1MinorUnitDecimal  = (String) currencyData.get("minor1");
-        currenciesWith3MinorUnitDecimal  = (String) currencyData.get("minor3");
+        for (int i = 0; i <= SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS; i++) {
+            currenciesWithDefinedMinorUnitDecimals[i]
+                = (String) currencyData.get("minor"+i);
+        }
         currenciesWithMinorUnitsUndefined  = (String) currencyData.get("minorUndefined");
         if (formatVersion == null ||
                 dataVersion == null ||
                 validCurrencyCodes == null ||
-                currenciesWith0MinorUnitDecimals == null ||
-                currenciesWith1MinorUnitDecimal == null ||
-                currenciesWith3MinorUnitDecimal == null ||
                 currenciesWithMinorUnitsUndefined == null) {
             throw new NullPointerException("not all required data is defined in input");
         }
@@ -207,7 +208,7 @@
                         if (currencyInfo.charAt(0) == firstChar && currencyInfo.charAt(1) == secondChar) {
                             checkCurrencyCode(currencyInfo);
                             int digits = getDefaultFractionDigits(currencyInfo);
-                            if (digits < 0 || digits > 3) {
+                            if (digits < 0 || digits > SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS) {
                                 throw new RuntimeException("fraction digits out of range for " + currencyInfo);
                             }
                             int numericCode= getNumericCode(currencyInfo);
@@ -231,13 +232,14 @@
     }
 
     private static int getDefaultFractionDigits(String currencyCode) {
-        if (currenciesWith0MinorUnitDecimals.indexOf(currencyCode) != -1) {
-            return 0;
-        } else if (currenciesWith1MinorUnitDecimal.indexOf(currencyCode) != -1) {
-            return 1;
-        } else if (currenciesWith3MinorUnitDecimal.indexOf(currencyCode) != -1) {
-            return 3;
-        } else if (currenciesWithMinorUnitsUndefined.indexOf(currencyCode) != -1) {
+        for (int i = 0; i <= SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS; i++) {
+            if (currenciesWithDefinedMinorUnitDecimals[i] != null &&
+                currenciesWithDefinedMinorUnitDecimals[i].indexOf(currencyCode) != -1) {
+                return i;
+            }
+        }
+
+        if (currenciesWithMinorUnitsUndefined.indexOf(currencyCode) != -1) {
             return -1;
         } else {
             return 2;
--- a/src/share/classes/java/util/Currency.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/src/share/classes/java/util/Currency.java	Thu Apr 23 16:04:22 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, 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
@@ -139,11 +139,11 @@
     //   - maps country code to 32-bit int
     //   - 26*26 entries, corresponding to [A-Z]*[A-Z]
     //   - \u007F -> not valid country
-    //   - bits 18-31: unused
-    //   - bits 8-17: numeric code (0 to 1023)
-    //   - bit 7: 1 - special case, bits 0-4 indicate which one
+    //   - bits 20-31: unused
+    //   - bits 10-19: numeric code (0 to 1023)
+    //   - bit 9: 1 - special case, bits 0-4 indicate which one
     //            0 - simple country, bits 0-4 indicate final char of currency code
-    //   - bits 5-6: fraction digits for simple countries, 0 for special cases
+    //   - bits 5-8: fraction digits for simple countries, 0 for special cases
     //   - bits 0-4: final char for currency code for simple country, or ID of special case
     // - special case IDs:
     //   - 0: country has no currency
@@ -181,32 +181,34 @@
     // number of characters from A to Z
     private static final int A_TO_Z = ('Z' - 'A') + 1;
     // entry for invalid country codes
-    private static final int INVALID_COUNTRY_ENTRY = 0x007F;
+    private static final int INVALID_COUNTRY_ENTRY = 0x0000007F;
     // entry for countries without currency
-    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x0080;
+    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x00000200;
     // mask for simple case country entries
-    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x0000;
+    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x00000000;
     // mask for simple case country entry final character
-    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x001F;
+    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x0000001F;
     // mask for simple case country entry default currency digits
-    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x0060;
+    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x000001E0;
     // shift count for simple case country entry default currency digits
     private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_SHIFT = 5;
+    // maximum number for simple case country entry default currency digits
+    private static final int SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS = 9;
     // mask for special case country entries
-    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x0080;
+    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x00000200;
     // mask for special case country index
-    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x001F;
+    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x0000001F;
     // delta from entry index component in main table to index into special case tables
     private static final int SPECIAL_CASE_COUNTRY_INDEX_DELTA = 1;
     // mask for distinguishing simple and special case countries
     private static final int COUNTRY_TYPE_MASK = SIMPLE_CASE_COUNTRY_MASK | SPECIAL_CASE_COUNTRY_MASK;
     // mask for the numeric code of the currency
-    private static final int NUMERIC_CODE_MASK = 0x0003FF00;
+    private static final int NUMERIC_CODE_MASK = 0x000FFC00;
     // shift count for the numeric code of the currency
-    private static final int NUMERIC_CODE_SHIFT = 8;
+    private static final int NUMERIC_CODE_SHIFT = 10;
 
     // Currency data format version
-    private static final int VALID_FORMAT_VERSION = 1;
+    private static final int VALID_FORMAT_VERSION = 2;
 
     static {
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
@@ -261,7 +263,7 @@
                         Set<String> keys = props.stringPropertyNames();
                         Pattern propertiesPattern =
                             Pattern.compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*" +
-                                "([0-3])\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
+                                "(\\d+)\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
                                 "\\d{2}:\\d{2})?");
                         for (String key : keys) {
                            replaceCurrencyData(propertiesPattern,
@@ -682,7 +684,7 @@
      * @param ctry country code
      * @param curdata currency data.  This is a comma separated string that
      *    consists of "three-letter alphabet code", "three-digit numeric code",
-     *    and "one-digit (0,1,2, or 3) default fraction digit".
+     *    and "one-digit (0-9) default fraction digit".
      *    For example, "JPZ,392,0".
      *    An optional UTC date can be appended to the string (comma separated)
      *    to allow a currency change take effect after date specified.
@@ -721,8 +723,14 @@
 
         String code = m.group(1);
         int numeric = Integer.parseInt(m.group(2));
+        int entry = numeric << NUMERIC_CODE_SHIFT;
         int fraction = Integer.parseInt(m.group(3));
-        int entry = numeric << NUMERIC_CODE_SHIFT;
+        if (fraction > SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS) {
+            info("currency.properties entry for " + ctry +
+                " ignored since the fraction is more than " +
+                SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS + ":" + curdata, null);
+            return;
+        }
 
         int index;
         for (index = 0; index < scOldCurrencies.length; index++) {
--- a/src/share/classes/java/util/CurrencyData.properties	Wed Apr 22 11:11:09 2015 -0700
+++ b/src/share/classes/java/util/CurrencyData.properties	Thu Apr 23 16:04:22 2015 -0700
@@ -23,7 +23,10 @@
 # questions.
 #
 
-formatVersion=1
+# Version of the currency data format.
+#   1: initial
+#   2: Change in minor unit (allowing 4-9 digits)
+formatVersion=2
 
 # Version of the currency code information in this class.
 # It is a serial number that accompanies with each amendment.
@@ -36,7 +39,7 @@
 all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036-\
     AWG533-AYM945-AZM031-AZN944-BAM977-BBD052-BDT050-BEF056-BGL100-BGN975-BHD048-BIF108-\
     BMD060-BND096-BOB068-BOV984-BRL986-BSD044-BTN064-BWP072-BYB112-BYR974-\
-    BZD084-CAD124-CDF976-CHF756-CLF990-CLP152-CNY156-COP170-CRC188-CSD891-CUP192-CUC931-\
+    BZD084-CAD124-CDF976-CHE947-CHF756-CHW948-CLF990-CLP152-CNY156-COP170-COU970-CRC188-CSD891-CUP192-CUC931-\
     CVE132-CYP196-CZK203-DEM276-DJF262-DKK208-DOP214-DZD012-EEK233-EGP818-\
     ERN232-ESP724-ETB230-EUR978-FIM246-FJD242-FKP238-FRF250-GBP826-GEL981-\
     GHC288-GHS936-GIP292-GMD270-GNF324-GRD300-GTQ320-GWP624-GYD328-HKD344-HNL340-\
@@ -49,7 +52,7 @@
     PKR586-PLN985-PTE620-PYG600-QAR634-ROL946-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
     SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\
     SRD968-SRG740-SSP728-STD678-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
-    TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-\
+    TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
     UYU858-UZS860-VEB862-VEF937-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\
     XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\
     XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZMW967-ZWD716-ZWL932-\
@@ -579,16 +582,17 @@
 ZW=ZWL
 
 
-# List of currencies with 0, 1, OR 3 decimals for minor units, or where there
-# are no minor units defined. All others use 2 decimals.
+# List of currencies with non-2digit decimals for minor units,
+# or where there are no minor units defined. All others use 2 decimals.
 
 minor0=\
-    ADP-BEF-BIF-BYB-BYR-CLF-CLP-DJF-ESP-GNF-\
+    ADP-BEF-BIF-BYB-BYR-CLP-DJF-ESP-GNF-\
     GRD-ISK-ITL-JPY-KMF-KRW-LUF-MGF-PYG-PTE-RWF-\
-    TPE-TRL-UGX-VND-VUV-XAF-XOF-XPF
-minor1=
+    TPE-TRL-UGX-UYI-VND-VUV-XAF-XOF-XPF
 minor3=\
     BHD-IQD-JOD-KWD-LYD-OMR-TND
+minor4=\
+    CLF
 minorUndefined=\
     XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-\
     XPT-XSU-XTS-XUA-XXX
--- a/src/share/classes/javax/crypto/CipherInputStream.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/src/share/classes/javax/crypto/CipherInputStream.java	Thu Apr 23 16:04:22 2015 -0700
@@ -25,7 +25,11 @@
 
 package javax.crypto;
 
-import java.io.*;
+import java.io.InputStream;
+import java.io.FilterInputStream;
+import java.io.IOException;
+import javax.crypto.BadPaddingException;
+import javax.crypto.IllegalBlockSizeException;
 
 /**
  * A CipherInputStream is composed of an InputStream and a Cipher so
@@ -88,8 +92,6 @@
     private int ofinish = 0;
     // stream status
     private boolean closed = false;
-    // The stream has been read from.  False if the stream has never been read.
-    private boolean read = false;
 
     /**
      * private convenience function.
@@ -101,11 +103,15 @@
      * return (ofinish-ostart) (we have this many bytes for you)
      * return 0 (no data now, but could have more later)
      * return -1 (absolutely no more data)
+     *
+     * Note:  Exceptions are only thrown after the stream is completely read.
+     * For AEAD ciphers a read() of any length will internally cause the
+     * whole stream to be read fully and verify the authentication tag before
+     * returning decrypted data or exceptions.
      */
     private int getMoreData() throws IOException {
         if (done) return -1;
         int readin = input.read(ibuffer);
-        read = true;
         if (readin == -1) {
             done = true;
             try {
@@ -308,17 +314,16 @@
 
         closed = true;
         input.close();
-        try {
-            // throw away the unprocessed data
-            if (!done) {
+
+        // Throw away the unprocessed data and throw no crypto exceptions.
+        // AEAD ciphers are fully readed before closing.  Any authentication
+        // exceptions would occur while reading.
+        if (!done) {
+            try {
                 cipher.doFinal();
             }
-        }
-        catch (BadPaddingException | IllegalBlockSizeException ex) {
-            /* If no data has been read from the stream to be en/decrypted,
-               we supress any exceptions, and close quietly. */
-            if (read) {
-                throw new IOException(ex);
+            catch (BadPaddingException | IllegalBlockSizeException ex) {
+                // Catch exceptions as the rest of the stream is unused.
             }
         }
         ostart = 0;
--- a/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Thu Apr 23 16:04:22 2015 -0700
@@ -169,10 +169,9 @@
           case '|':
           case '&': {
             Element e = (Element) token;
-            if (valSet == null) {
+            if (valSet == null || valSet.length <= Element.getMaxIndex()) {
                 valSet = new boolean[Element.getMaxIndex() + 1];
                 val = new boolean[valSet.length];
-                // All Element instances are created before this ever executes
             }
             if (valSet[e.index]) {
                 return val[e.index];
--- a/src/share/classes/sun/awt/SunToolkit.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/src/share/classes/sun/awt/SunToolkit.java	Thu Apr 23 16:04:22 2015 -0700
@@ -889,14 +889,17 @@
     }
 
     protected static boolean imageExists(String filename) {
-        checkPermissions(filename);
-        return filename != null && new File(filename).exists();
+        if (filename != null) {
+            checkPermissions(filename);
+            return new File(filename).exists();
+        }
+        return false;
     }
 
     @SuppressWarnings("try")
     protected static boolean imageExists(URL url) {
-        checkPermissions(url);
         if (url != null) {
+            checkPermissions(url);
             try (InputStream is = url.openStream()) {
                 return true;
             }catch(IOException e){
--- a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Wed Apr 22 11:11:09 2015 -0700
+++ b/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Thu Apr 23 16:04:22 2015 -0700
@@ -2778,6 +2778,14 @@
     pb = &data->pixelBuf;
 
     if (setPixelBuffer(env, pb, buffer) == NOT_OK) {
+        if (scale != NULL) {
+            for (i = 0; i < numBands; i++) {
+                if (scale[i] != NULL) {
+                    free(scale[i]);
+                }
+            }
+            free(scale);
+        }
         return data->abortFlag;  // We already threw an out of memory exception
     }
 
--- a/src/windows/native/java/util/TimeZone_md.c	Wed Apr 22 11:11:09 2015 -0700
+++ b/src/windows/native/java/util/TimeZone_md.c	Thu Apr 23 16:04:22 2015 -0700
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include "jvm.h"
 #include "TimeZone_md.h"
+#include "jdk_util.h"
 
 #define VALUE_UNKNOWN           0
 #define VALUE_KEY               1
@@ -49,6 +50,20 @@
     SYSTEMTIME  dstDate;
 } TziValue;
 
+#if _WIN32_WINNT < 0x0600 /* < _WIN32_WINNT_VISTA */
+typedef struct _TIME_DYNAMIC_ZONE_INFORMATION {
+    LONG        Bias;
+    WCHAR       StandardName[32];
+    SYSTEMTIME  StandardDate;
+    LONG        StandardBias;
+    WCHAR       DaylightName[32];
+    SYSTEMTIME  DaylightDate;
+    LONG        DaylightBias;
+    WCHAR       TimeZoneKeyName[128];
+    BOOLEAN     DynamicDaylightTimeDisabled;
+} DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION;
+#endif
+
 /*
  * Registry key names
  */
@@ -143,6 +158,33 @@
 }
 
 /*
+ * Use NO_DYNAMIC_TIME_ZONE_INFO as the return value indicating that no
+ * dynamic time zone information is available.
+ */
+#define NO_DYNAMIC_TIME_ZONE_INFO     (-128)
+
+static int getDynamicTimeZoneInfo(PDYNAMIC_TIME_ZONE_INFORMATION pdtzi) {
+    DWORD timeType = NO_DYNAMIC_TIME_ZONE_INFO;
+    HMODULE dllHandle;
+
+    /*
+     * Dynamically load the dll to call GetDynamicTimeZoneInformation.
+     */
+    dllHandle = JDK_LoadSystemLibrary("Kernel32.dll");
+    if (dllHandle != NULL) {
+        typedef DWORD (WINAPI *GetDynamicTimezoneInfoType)(PDYNAMIC_TIME_ZONE_INFORMATION);
+        GetDynamicTimezoneInfoType getDynamicTimeZoneInfoFunc =
+            (GetDynamicTimezoneInfoType) GetProcAddress(dllHandle,
+                                                        "GetDynamicTimeZoneInformation");
+
+        if (getDynamicTimeZoneInfo != NULL) {
+            timeType = getDynamicTimeZoneInfoFunc(pdtzi);
+        }
+    }
+    return timeType;
+}
+
+/*
  * Gets the current time zone entry in the "Time Zones" registry.
  */
 static int getWinTimeZone(char *winZoneName, char *winMapID)
@@ -161,23 +203,96 @@
     WCHAR *stdNamePtr = tzi.StandardName;
     DWORD valueSize;
     DWORD timeType;
-    int isVista;
+    int isVistaOrLater;
 
     /*
-     * Get the current time zone setting of the platform.
+     * Determine if this is a Vista or later.
+     */
+    ver.dwOSVersionInfoSize = sizeof(ver);
+    GetVersionEx(&ver);
+    isVistaOrLater = (ver.dwMajorVersion >= 6);
+
+    if (isVistaOrLater) {
+        DYNAMIC_TIME_ZONE_INFORMATION dtzi;
+        DWORD bufSize;
+        DWORD val;
+
+        /*
+         * Get the dynamic time zone information, if available, so that time
+         * zone redirection can be supported. (see JDK-7044727)
+         */
+        timeType = getDynamicTimeZoneInfo(&dtzi);
+        if (timeType == TIME_ZONE_ID_INVALID) {
+            goto err;
+        }
+
+        if (timeType != NO_DYNAMIC_TIME_ZONE_INFO) {
+            /*
+             * Make sure TimeZoneKeyName is available from the API call. If
+             * DynamicDaylightTime is disabled, return a custom time zone name
+             * based on the GMT offset. Otherwise, return the TimeZoneKeyName
+             * value.
+             */
+            if (dtzi.TimeZoneKeyName[0] != 0) {
+                if (dtzi.DynamicDaylightTimeDisabled) {
+                    customZoneName(dtzi.Bias, winZoneName);
+                    return VALUE_GMTOFFSET;
+                }
+                wcstombs(winZoneName, dtzi.TimeZoneKeyName, MAX_ZONE_CHAR);
+                return VALUE_KEY;
+            }
+
+            /*
+             * If TimeZoneKeyName is not available, check whether StandardName
+             * is available to fall back to the older API GetTimeZoneInformation.
+             * If not, directly read the value from registry keys.
+             */
+            if (dtzi.StandardName[0] == 0) {
+                ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
+                                   KEY_READ, (PHKEY)&hKey);
+                if (ret != ERROR_SUCCESS) {
+                    goto err;
+                }
+
+                /*
+                 * Determine if auto-daylight time adjustment is turned off.
+                 */
+                bufSize = sizeof(val);
+                ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled", NULL,
+                                       &valueType, (LPBYTE) &val, &bufSize);
+                if (ret != ERROR_SUCCESS) {
+                    goto err;
+                }
+                /*
+                 * Return a custom time zone name if auto-daylight time
+                 * adjustment is disabled.
+                 */
+                if (val == 1) {
+                    customZoneName(dtzi.Bias, winZoneName);
+                    (void) RegCloseKey(hKey);
+                    return VALUE_GMTOFFSET;
+                }
+
+                bufSize = MAX_ZONE_CHAR;
+                ret = RegQueryValueExA(hKey, "TimeZoneKeyName",NULL,
+                                       &valueType, (LPBYTE)winZoneName, &bufSize);
+                if (ret != ERROR_SUCCESS) {
+                    goto err;
+                }
+                (void) RegCloseKey(hKey);
+                return VALUE_KEY;
+            }
+        }
+    }
+
+    /*
+     * Fall back to GetTimeZoneInformation
      */
     timeType = GetTimeZoneInformation(&tzi);
     if (timeType == TIME_ZONE_ID_INVALID) {
         goto err;
     }
 
-    /*
-     * Determine if this is an NT system.
-     */
-    ver.dwOSVersionInfoSize = sizeof(ver);
-    GetVersionEx(&ver);
-    isVista = ver.dwMajorVersion >= 6;
-
     ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
                        KEY_READ, (PHKEY)&hKey);
     if (ret == ERROR_SUCCESS) {
@@ -187,23 +302,23 @@
         /*
          * Determine if auto-daylight time adjustment is turned off.
          */
-        valueType = 0;
         bufSize = sizeof(val);
-        ret = RegQueryValueExA(hKey, "DisableAutoDaylightTimeSet",
-                               NULL, &valueType, (LPBYTE) &val, &bufSize);
-        /*
-         * Vista uses the different key name.
-         */
+        ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled", NULL,
+                               &valueType, (LPBYTE) &val, &bufSize);
         if (ret != ERROR_SUCCESS) {
+            /*
+             * Try the old key name.
+             */
             bufSize = sizeof(val);
-            ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled",
-                                   NULL, &valueType, (LPBYTE) &val, &bufSize);
+            ret = RegQueryValueExA(hKey, "DisableAutoDaylightTimeSet", NULL,
+                                   &valueType, (LPBYTE) &val, &bufSize);
         }
 
         if (ret == ERROR_SUCCESS) {
-            int daylightSavingsUpdateDisabledOther = val == 1 && tzi.DaylightDate.wMonth != 0;
-            int daylightSavingsUpdateDisabledVista = val == 1;
-            int daylightSavingsUpdateDisabled = isVista ? daylightSavingsUpdateDisabledVista : daylightSavingsUpdateDisabledOther;
+            int daylightSavingsUpdateDisabledOther = (val == 1 && tzi.DaylightDate.wMonth != 0);
+            int daylightSavingsUpdateDisabledVista = (val == 1);
+            int daylightSavingsUpdateDisabled
+                = (isVistaOrLater ? daylightSavingsUpdateDisabledVista : daylightSavingsUpdateDisabledOther);
 
             if (daylightSavingsUpdateDisabled) {
                 (void) RegCloseKey(hKey);
@@ -213,28 +328,12 @@
         }
 
         /*
-         * Vista has the key for the current "Time Zones" entry.
-         */
-        if (isVista) {
-            valueType = 0;
-            bufSize = MAX_ZONE_CHAR;
-            ret = RegQueryValueExA(hKey, "TimeZoneKeyName", NULL,
-                                   &valueType, (LPBYTE) winZoneName, &bufSize);
-            if (ret != ERROR_SUCCESS) {
-                goto err;
-            }
-            (void) RegCloseKey(hKey);
-            return VALUE_KEY;
-        }
-
-        /*
          * Win32 problem: If the length of the standard time name is equal
          * to (or probably longer than) 32 in the registry,
          * GetTimeZoneInformation() on NT returns a null string as its
          * standard time name. We need to work around this problem by
          * getting the same information from the TimeZoneInformation
-         * registry. The function on Win98 seems to return its key name.
-         * We can't do anything in that case.
+         * registry.
          */
         if (tzi.StandardName[0] == 0) {
             bufSize = sizeof(stdNameInReg);
--- a/test/com/sun/security/auth/login/ConfigFile/InconsistentError.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/com/sun/security/auth/login/ConfigFile/InconsistentError.java	Thu Apr 23 16:04:22 2015 -0700
@@ -26,6 +26,7 @@
  * @bug 4406033
  * @summary     ConfigFile throws an inconsistent error message
  *              when the configuration file is not found
+ * @run main/othervm -Duser.language=en InconsistentError
  */
 
 import com.sun.security.auth.login.*;
--- a/test/com/sun/security/auth/module/KeyStoreLoginModule/OptionTest.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/com/sun/security/auth/module/KeyStoreLoginModule/OptionTest.java	Thu Apr 23 16:04:22 2015 -0700
@@ -25,6 +25,7 @@
  * @test
  * @bug 4919147
  * @summary Support for token-based KeyStores
+ * @run main/othervm -Duser.language=en OptionTest
  */
 
 import java.io.File;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Toolkit/GetImage/bug8078165.java	Thu Apr 23 16:04:22 2015 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.*;
+import java.net.URL;
+import java.security.Permission;
+
+
+/**
+ * @test
+ * @bug 8078165
+ * @summary NPE when attempting to get image from toolkit
+ * @author Anton Nashatyrev
+ */
+public final class bug8078165 {
+
+    public static void main(final String[] args) throws Exception {
+        // Mac only
+        System.setSecurityManager(new SecurityManager() {
+            @Override
+            public void checkPermission(Permission permission) {
+                // Just allows everything
+            }
+        });
+        // The method shouldn't throw NPE
+        Toolkit.getDefaultToolkit().getImage(new URL("file://./dummyImage@2x.png"));
+        Toolkit.getDefaultToolkit().getImage("./dummyImage@2x.png");
+    }
+}
--- a/test/java/util/Currency/CurrencyTest.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/java/util/Currency/CurrencyTest.java	Thu Apr 23 16:04:22 2015 -0700
@@ -23,7 +23,7 @@
 /*
  * @test
  * @bug 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531
- *    6488442 7036905
+ *    6488442 7036905 8074350 8074351
  * @summary Basic tests for Currency class.
  */
 
@@ -49,6 +49,7 @@
         testFractionDigits();
         testSerialization();
         testDisplayNames();
+        testFundsCodes();
     }
 
     static void testCurrencyCodeValidation() {
@@ -265,4 +266,41 @@
         }
     }
 
+    static void testFundsCodes() {
+        testValidCurrency("BOV");
+        testValidCurrency("CHE");
+        testValidCurrency("CHW");
+        testValidCurrency("CLF");
+        testValidCurrency("COU");
+        testValidCurrency("MXV");
+        testValidCurrency("USN");
+        testValidCurrency("UYI");
+
+        testFractionDigits("BOV", 2);
+        testFractionDigits("CHE", 2);
+        testFractionDigits("CHW", 2);
+        testFractionDigits("CLF", 4);
+        testFractionDigits("COU", 2);
+        testFractionDigits("MXV", 2);
+        testFractionDigits("USN", 2);
+        testFractionDigits("UYI", 0);
+
+        testNumericCode("BOV", 984);
+        testNumericCode("CHE", 947);
+        testNumericCode("CHW", 948);
+        testNumericCode("CLF", 990);
+        testNumericCode("COU", 970);
+        testNumericCode("MXV", 979);
+        testNumericCode("USN", 997);
+        testNumericCode("UYI", 940);
+    }
+
+    static void testNumericCode(String currencyCode, int expectedNumeric) {
+        int numeric = Currency.getInstance(currencyCode).getNumericCode();
+        if (numeric != expectedNumeric) {
+            throw new RuntimeException("Wrong numeric code for currency " +
+                    currencyCode +": expected " + expectedNumeric +
+                    ", got " + numeric);
+        }
+    }
 }
--- a/test/java/util/Currency/PropertiesTest.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/java/util/Currency/PropertiesTest.java	Thu Apr 23 16:04:22 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -107,7 +107,7 @@
         keys = p.stringPropertyNames();
         Pattern propertiesPattern =
             Pattern.compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*" +
-                "([0-3])\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
+                "(\\d+)\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
                 "\\d{2}:\\d{2})?");
         for (String key: keys) {
             String val = p.getProperty(key);
@@ -135,14 +135,20 @@
                 // ignore this
                 continue;
             }
+
+            String code = m.group(1);
+            int numeric = Integer.parseInt(m.group(2));
+            int fraction = Integer.parseInt(m.group(3));
+            if (fraction > 9) {
+                System.out.println("Skipping since the fraction is greater than 9");
+                continue;
+            }
+
             Matcher mAfter = propertiesPattern.matcher(afterVal);
             mAfter.find();
 
-            String code = m.group(1);
             String codeAfter = mAfter.group(1);
-            int numeric = Integer.parseInt(m.group(2));
             int numericAfter = Integer.parseInt(mAfter.group(2));
-            int fraction = Integer.parseInt(m.group(3));
             int fractionAfter = Integer.parseInt(mAfter.group(3));
             if (code.equals(codeAfter) &&
                 (numeric == numericAfter)&&
--- a/test/java/util/Currency/PropertiesTest.sh	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/java/util/Currency/PropertiesTest.sh	Thu Apr 23 16:04:22 2015 -0700
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 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
@@ -23,7 +23,7 @@
 #
 
 # @test
-# @bug 6332666 6863624 7180362 8003846
+# @bug 6332666 6863624 7180362 8003846 8074350 8074351
 # @summary tests the capability of replacing the currency data with user
 #     specified currency properties file
 # @build PropertiesTest
--- a/test/java/util/Currency/ValidateISO4217.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/java/util/Currency/ValidateISO4217.java	Thu Apr 23 16:04:22 2015 -0700
@@ -23,6 +23,7 @@
 /*
  * @test
  * @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759
+ *      8074350 8074351
  * @summary Validate ISO 4217 data for Currency class.
  */
 
@@ -92,7 +93,7 @@
 
     /* Codes that are obsolete, do not have related country */
     static final String otherCodes =
-        "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-CLF-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-MZM-NLG-PTE-ROL-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-USN-USS-VEB-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZMK-ZWD-ZWN-ZWR";
+        "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-CHE-CHW-CLF-COU-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-MZM-NLG-PTE-ROL-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-UYI-USN-USS-VEB-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZMK-ZWD-ZWN-ZWR";
 
     static boolean err = false;
 
--- a/test/java/util/Currency/currency.properties	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/java/util/Currency/currency.properties	Thu Apr 23 16:04:22 2015 -0700
@@ -1,20 +1,30 @@
 #
 # Test data for replacing the currency data
 #
+
+# valid entries
+CL=CLF,990,4
+CM=IED,111,2, 2004-01-01T00:70:00
+ES=ESD,877,2
 JP=JPZ,123,2
-ES=ESD,877,2
+MA=MAA,555,5
+MC=MCC,555,6
+MD=MDD,555,7
+ME=MEE,555,8
+MF=MFF,555,9
+NO=EUR   ,978  ,2,  2099-01-01T00:00:00
+SB=EUR,111,2, 2099-01-01T00:00:00
 US=euR,978,2,2001-01-01T00:00:00
-CM=IED,111,2, 2004-01-01T00:70:00
-SB=EUR,111,2, 2099-01-01T00:00:00
 ZZ	=	ZZZ	,	999	,	3
-NO=EUR   ,978  ,2,  2099-01-01T00:00:00
 
 # invalid entries
+DE=2009-01-01T00:00:00,EUR,111,2
+FM=DED,194,2,eeee-01-01T00:00:00
+FR=zzzzz.123
 GB=123
-FR=zzzzz.123
-DE=2009-01-01T00:00:00,EUR,111,2
 IE=euR,111,2,#testcomment
+MG=MGG,990,10
+MX=SSS,493,2,2001-01-01-00-00-00
+PE=EUR   ,978  ,2,  20399-01-01T00:00:00
+MG=MGG,990,10
 =euR,111,2, 2099-01-01-00-00-00
-FM=DED,194,2,eeee-01-01T00:00:00
-PE=EUR   ,978  ,2,  20399-01-01T00:00:00
-MX=SSS,493,2,2001-01-01-00-00-00
--- a/test/java/util/Currency/tablea1.txt	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/java/util/Currency/tablea1.txt	Thu Apr 23 16:04:22 2015 -0700
@@ -5,7 +5,7 @@
 #
 
 # Version
-FILEVERSION=1
+FILEVERSION=2
 DATAVERSION=159
 
 # ISO 4217 currency data
@@ -55,7 +55,7 @@
 CF	XAF	950	0
 TD	XAF	950	0
 CL	CLP	152	0
-#CL	CLF	990	0
+#CL	CLF	990	4
 CN	CNY	156	2
 CX	AUD	36	2
 CC	AUD	36	2
@@ -265,6 +265,7 @@
 #US	USN	997	2
 UM	USD	840	2
 UY	UYU	858	2
+#UY	UYI	940	0
 UZ	UZS	860	2
 VU	VUV	548	0
 VE	VEF	937	2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/crypto/Cipher/CipherInputStreamExceptions.java	Thu Apr 23 16:04:22 2015 -0700
@@ -0,0 +1,415 @@
+/*
+ * 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 8064546
+ * @summary Throw exceptions during reading but not closing of a
+ * CipherInputStream:
+ * - Make sure authenticated algorithms continue to throwing exceptions
+ *   when the authentication tag fails verification.
+ * - Make sure other algorithms do not throw exceptions when the stream
+ *   calls close() and only throw when read() errors.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.lang.Exception;
+import java.lang.RuntimeException;
+import java.lang.Throwable;
+import java.security.AlgorithmParameters;
+import javax.crypto.AEADBadTagException;
+import javax.crypto.Cipher;
+import javax.crypto.CipherInputStream;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import javax.crypto.spec.GCMParameterSpec;
+
+public class CipherInputStreamExceptions {
+
+    static SecretKeySpec key = new SecretKeySpec(new byte[16], "AES");
+    static GCMParameterSpec gcmspec = new GCMParameterSpec(128, new byte[16]);
+    static IvParameterSpec iv = new IvParameterSpec(new byte[16]);
+    static boolean failure = false;
+
+    /* Full read stream, check that getMoreData() is throwing an exception
+     * This test
+     *   1) Encrypt 100 bytes with AES/GCM/PKCS5Padding
+     *   2) Changes the last byte to invalidate the authetication tag.
+     *   3) Fully reads CipherInputStream to decrypt the message and closes
+     */
+
+    static void gcm_AEADBadTag() throws Exception {
+        Cipher c;
+        byte[] read = new byte[200];
+
+        System.out.println("Running gcm_AEADBadTag");
+
+        // Encrypt 100 bytes with AES/GCM/PKCS5Padding
+        byte[] ct = encryptedText("GCM", 100);
+        // Corrupt the encrypted message
+        ct = corruptGCM(ct);
+        // Create stream for decryption
+        CipherInputStream in = getStream("GCM", ct);
+
+        try {
+            int size = in.read(read);
+            throw new RuntimeException("Fail: CipherInputStream.read() " +
+                    "returned " + size + " and didn't throw an exception.");
+        } catch (IOException e) {
+            Throwable ec = e.getCause();
+            if (ec instanceof AEADBadTagException) {
+                System.out.println("  Pass.");
+            } else {
+                System.out.println("  Fail: " + ec.getMessage());
+                throw new RuntimeException(ec);
+            }
+        } finally {
+            in.close();
+        }
+    }
+
+    /* Short read stream,
+     * This test
+     *   1) Encrypt 100 bytes with AES/GCM/PKCS5Padding
+     *   2) Reads 100 bytes from stream to decrypt the message and closes
+     *   3) Make sure no value is returned by read()
+     *   4) Make sure no exception is thrown
+     */
+
+    static void gcm_shortReadAEAD() throws Exception {
+        Cipher c;
+        byte[] read = new byte[100];
+
+        System.out.println("Running gcm_shortReadAEAD");
+
+        byte[] pt = new byte[600];
+        pt[0] = 1;
+        // Encrypt provided 600 bytes with AES/GCM/PKCS5Padding
+        byte[] ct = encryptedText("GCM", pt);
+        // Create stream for decryption
+        CipherInputStream in = getStream("GCM", ct);
+
+        int size = 0;
+        try {
+            size = in.read(read);
+            in.close();
+            if (read.length != 100) {
+                throw new RuntimeException("Fail: read size = " + read.length +
+                        "should be 100.");
+            }
+            if (read[0] != 1) {
+                throw new RuntimeException("Fail: The decrypted text does " +
+                        "not match the plaintext: '" + read[0] +"'");
+            }
+        } catch (IOException e) {
+            System.out.println("  Fail: " + e.getMessage());
+            throw new RuntimeException(e.getCause());
+        }
+        System.out.println("  Pass.");
+    }
+
+    /*
+     * Verify doFinal() exception is suppressed when input stream is not
+     * read before it is closed.
+     * This test:
+     *   1) Encrypt 100 bytes with AES/GCM/PKCS5Padding
+     *   2) Changes the last byte to invalidate the authetication tag.
+     *   3) Opens a CipherInputStream and the closes it. Never reads from it.
+     *
+     * There should be no exception thrown.
+     */
+    static void gcm_suppressUnreadCorrupt() throws Exception {
+        Cipher c;
+        byte[] read = new byte[200];
+
+        System.out.println("Running supressUnreadCorrupt test");
+
+        // Encrypt 100 bytes with AES/GCM/PKCS5Padding
+        byte[] ct = encryptedText("GCM", 100);
+        // Corrupt the encrypted message
+        ct = corruptGCM(ct);
+        // Create stream for decryption
+        CipherInputStream in = getStream("GCM", ct);
+
+        try {
+            in.close();
+            System.out.println("  Pass.");
+        } catch (IOException e) {
+            System.out.println("  Fail: " + e.getMessage());
+            throw new RuntimeException(e.getCause());
+        }
+    }
+
+    /*
+     * Verify noexception thrown when 1 byte is read from a GCM stream
+     * and then closed
+     * This test:
+     *   1) Encrypt 100 bytes with AES/GCM/PKCS5Padding
+     *   2) Read one byte from the stream, expect no exception thrown.
+     *   4) Close stream,expect no exception thrown.
+     */
+    static void gcm_oneReadByte() throws Exception {
+
+        System.out.println("Running gcm_oneReadByte test");
+
+        // Encrypt 100 bytes with AES/GCM/PKCS5Padding
+        byte[] ct = encryptedText("GCM", 100);
+        // Create stream for decryption
+        CipherInputStream in = getStream("GCM", ct);
+
+        try {
+            in.read();
+            System.out.println("  Pass.");
+        } catch (Exception e) {
+            System.out.println("  Fail: " + e.getMessage());
+            throw new RuntimeException(e.getCause());
+        }
+    }
+
+    /*
+     * Verify exception thrown when 1 byte is read from a corrupted GCM stream
+     * and then closed
+     * This test:
+     *   1) Encrypt 100 bytes with AES/GCM/PKCS5Padding
+     *   2) Changes the last byte to invalidate the authetication tag.
+     *   3) Read one byte from the stream, expect exception thrown.
+     *   4) Close stream,expect no exception thrown.
+     */
+    static void gcm_oneReadByteCorrupt() throws Exception {
+
+        System.out.println("Running gcm_oneReadByteCorrupt test");
+
+        // Encrypt 100 bytes with AES/GCM/PKCS5Padding
+        byte[] ct = encryptedText("GCM", 100);
+        // Corrupt the encrypted message
+        ct = corruptGCM(ct);
+        // Create stream for decryption
+        CipherInputStream in = getStream("GCM", ct);
+
+        try {
+            in.read();
+            System.out.println("  Fail. No exception thrown.");
+        } catch (IOException e) {
+            Throwable ec = e.getCause();
+            if (ec instanceof AEADBadTagException) {
+                System.out.println("  Pass.");
+            } else {
+                System.out.println("  Fail: " + ec.getMessage());
+                throw new RuntimeException(ec);
+            }
+        }
+    }
+
+    /* Check that close() does not throw an exception with full message in
+     * CipherInputStream's ibuffer.
+     * This test:
+     *   1) Encrypts a 97 byte message with AES/CBC/PKCS5Padding
+     *   2) Create a stream that sends 96 bytes.
+     *   3) Read stream once,
+     *   4) Close and expect no exception
+     */
+
+    static void cbc_shortStream() throws Exception {
+        Cipher c;
+        AlgorithmParameters params;
+        byte[] read = new byte[200];
+
+        System.out.println("Running cbc_shortStream");
+
+        // Encrypt 97 byte with AES/CBC/PKCS5Padding
+        byte[] ct = encryptedText("CBC", 97);
+        // Create stream with only 96 bytes of encrypted data
+        CipherInputStream in = getStream("CBC", ct, 96);
+
+        try {
+            int size = in.read(read);
+            in.close();
+            if (size != 80) {
+                throw new RuntimeException("Fail: CipherInputStream.read() " +
+                        "returned " + size + ". Should have been 80");
+            }
+            System.out.println("  Pass.");
+        } catch (IOException e) {
+            System.out.println("  Fail:  " + e.getMessage());
+            throw new RuntimeException(e.getCause());
+        }
+    }
+
+    /* Check that close() does not throw an exception when the whole message is
+     * inside the internal buffer (ibuffer) in CipherInputStream and we read
+     * one byte and close the stream.
+     * This test:
+     *   1) Encrypts a 400 byte message with AES/CBC/PKCS5Padding
+     *   2) Read one byte from the stream
+     *   3) Close and expect no exception
+     */
+
+    static void cbc_shortRead400() throws Exception {
+        System.out.println("Running cbc_shortRead400");
+
+        // Encrypt 400 byte with AES/CBC/PKCS5Padding
+        byte[] ct = encryptedText("CBC", 400);
+        // Create stream with encrypted data
+        CipherInputStream in = getStream("CBC", ct);
+
+        try {
+            in.read();
+            in.close();
+            System.out.println("  Pass.");
+        } catch (IOException e) {
+            System.out.println("  Fail:  " + e.getMessage());
+            throw new RuntimeException(e.getCause());
+        }
+    }
+
+    /* Check that close() does not throw an exception when the  inside the
+     * internal buffer (ibuffer) in CipherInputStream does not contain the
+     * whole message.
+     * This test:
+     *   1) Encrypts a 600 byte message with AES/CBC/PKCS5Padding
+     *   2) Read one byte from the stream
+     *   3) Close and expect no exception
+     */
+
+    static void cbc_shortRead600() throws Exception {
+        System.out.println("Running cbc_shortRead600");
+
+        // Encrypt 600 byte with AES/CBC/PKCS5Padding
+        byte[] ct = encryptedText("CBC", 600);
+        // Create stream with encrypted data
+        CipherInputStream in = getStream("CBC", ct);
+
+        try {
+            in.read();
+            in.close();
+            System.out.println("  Pass.");
+        } catch (IOException e) {
+            System.out.println("  Fail:  " + e.getMessage());
+            throw new RuntimeException(e.getCause());
+        }
+    }
+
+    /* Check that exception is thrown when message is fully read
+     * This test:
+     *   1) Encrypts a 96 byte message with AES/CBC/PKCS5Padding
+     *   2) Create a stream that sends 95 bytes.
+     *   3) Read stream to the end
+     *   4) Expect IllegalBlockSizeException thrown
+     */
+
+    static void cbc_readAllIllegalBlockSize() throws Exception {
+        byte[] read = new byte[200];
+
+        System.out.println("Running cbc_readAllIllegalBlockSize test");
+
+        // Encrypt 96 byte with AES/CBC/PKCS5Padding
+        byte[] ct = encryptedText("CBC", 96);
+        // Create a stream with only 95 bytes of encrypted data
+        CipherInputStream in = getStream("CBC", ct, 95);
+
+        try {
+            int s, size = 0;
+            while ((s = in.read(read)) != -1) {
+                size += s;
+            }
+            throw new RuntimeException("Fail: No IllegalBlockSizeException. " +
+                    "CipherInputStream.read() returned " + size);
+
+        } catch (IOException e) {
+            Throwable ec = e.getCause();
+            if (ec instanceof IllegalBlockSizeException) {
+                System.out.println("  Pass.");
+            } else {
+                System.out.println("  Fail: " + ec.getMessage());
+                throw new RuntimeException(ec);
+            }
+        }
+    }
+
+    /* Generic method to create encrypted text */
+    static byte[] encryptedText(String mode, int length) throws Exception{
+        return encryptedText(mode, new byte[length]);
+    }
+
+    /* Generic method to create encrypted text */
+    static byte[] encryptedText(String mode, byte[] pt) throws Exception{
+        Cipher c;
+        if (mode.compareTo("GCM") == 0) {
+            c = Cipher.getInstance("AES/GCM/PKCS5Padding", "SunJCE");
+            c.init(Cipher.ENCRYPT_MODE, key, gcmspec);
+        } else if (mode.compareTo("CBC") == 0) {
+            c = Cipher.getInstance("AES/CBC/PKCS5Padding", "SunJCE");
+            c.init(Cipher.ENCRYPT_MODE, key, iv);
+        } else {
+            return null;
+        }
+
+        return c.doFinal(pt);
+    }
+
+    /* Generic method to get a properly setup CipherInputStream */
+    static CipherInputStream getStream(String mode, byte[] ct) throws Exception {
+        return getStream(mode, ct, ct.length);
+    }
+
+    /* Generic method to get a properly setup CipherInputStream */
+    static CipherInputStream getStream(String mode, byte[] ct, int length)
+            throws Exception {
+        Cipher c;
+
+        if (mode.compareTo("GCM") == 0) {
+            c = Cipher.getInstance("AES/GCM/PKCS5Padding", "SunJCE");
+            c.init(Cipher.DECRYPT_MODE, key, gcmspec);
+        } else if (mode.compareTo("CBC") == 0) {
+            c = Cipher.getInstance("AES/CBC/PKCS5Padding", "SunJCE");
+            c.init(Cipher.DECRYPT_MODE, key, iv);
+        } else {
+            return null;
+        }
+
+        return new CipherInputStream(new ByteArrayInputStream(ct, 0, length), c);
+
+    }
+
+    /* Generic method for corrupting a GCM message.  Change the last
+     * byte on of the authentication tag
+     */
+    static byte[] corruptGCM(byte[] ct) {
+        ct[ct.length - 1] = (byte) (ct[ct.length - 1] + 1);
+        return ct;
+    }
+
+    public static void main(String[] args) throws Exception {
+        gcm_AEADBadTag();
+        gcm_shortReadAEAD();
+        gcm_suppressUnreadCorrupt();
+        gcm_oneReadByte();
+        gcm_oneReadByteCorrupt();
+        cbc_shortStream();
+        cbc_shortRead400();
+        cbc_shortRead600();
+        cbc_readAllIllegalBlockSize();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/html/parser/8074956/bug8074956.java	Thu Apr 23 16:04:22 2015 -0700
@@ -0,0 +1,47 @@
+/*
+ * 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 javax.swing.text.html.parser.ContentModel;
+import javax.swing.text.html.parser.DTD;
+import javax.swing.text.html.parser.Element;
+
+/*
+ * @test
+ * @bug 8074956
+ * @author Alexey Ivanov
+ * @summary Tests correct handling of additional HTML elements in ContentModel
+ * @run main bug8074956
+ */
+public class bug8074956 {
+    public static void main(String[] args) throws Exception {
+        final DTD html32 = DTD.getDTD("html32");
+        ContentModel contentModel = new ContentModel('&', new ContentModel());
+
+        Element elem1 = html32.getElement("html-element");
+        contentModel.first(elem1);
+
+        Element elem2 = html32.getElement("test-element");
+        // Shouldn't throw ArrayIndexOutOfBoundsException
+        contentModel.first(elem2);
+    }
+}
--- a/test/javax/xml/ws/8046817/GenerateEnumSchema.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/javax/xml/ws/8046817/GenerateEnumSchema.java	Thu Apr 23 16:04:22 2015 -0700
@@ -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
@@ -23,57 +23,83 @@
 
 /*
  * @test
- * @bug 8046817
- * @summary schemagen fails to generate xsd for enum types
+ * @bug 8046817 8073357
+ * @summary schemagen fails to generate xsd for enum types.
+ * Check that order of Enum values is preserved.
  * @run main/othervm GenerateEnumSchema
  */
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.file.Files;
 import java.nio.file.Paths;
-import java.util.Scanner;
+import java.util.stream.Collectors;
 
 public class GenerateEnumSchema {
 
     private static final String SCHEMA_OUTPUT_FILENAME = "schema1.xsd";
     private static final File schemaOutputFile = new File(SCHEMA_OUTPUT_FILENAME);
+    private static final String[] expectedEnums = {
+        "\"FIRST\"", "\"ONE\"", "\"TWO\"", "\"THREE\"",
+        "\"FOUR\"", "\"FIVE\"", "\"SIX\"", "\"LAST\""};
+    private static String schemaContent = "";
 
-    public static void main(String[] args) throws Exception, IOException {
+    public static void main(String[] args) throws Exception {
+
         //Check schema generation for class type
         runSchemaGen("TestClassType.java");
         checkIfSchemaGenerated();
+        readSchemaContent();
         checkSchemaContent("<xs:complexType name=\"testClassType\">");
         checkSchemaContent("<xs:element name=\"a\" type=\"xs:int\"/>");
-        schemaOutputFile.delete();
+
         //Check schema generation for enum type
         runSchemaGen("TestEnumType.java");
         checkIfSchemaGenerated();
+        readSchemaContent();
+        //Check if Enum type schema is generated
         checkSchemaContent("<xs:simpleType name=\"testEnumType\">");
-        checkSchemaContent("<xs:enumeration value=\"ONE\"/>");
-        checkSchemaContent("<xs:enumeration value=\"TWO\"/>");
-        checkSchemaContent("<xs:enumeration value=\"THREE\"/>");
+        //Check the sequence of enum values order
+        checkEnumOrder();
         schemaOutputFile.delete();
     }
 
+    // Check if schema file successfully generated by schemagen
     private static void checkIfSchemaGenerated() {
         if (!schemaOutputFile.exists()) {
             throw new RuntimeException("FAIL:" + SCHEMA_OUTPUT_FILENAME + " was not generated by schemagen tool");
         }
     }
 
-    private static void checkSchemaContent(String exp_token) throws FileNotFoundException {
-        System.out.print("Check if generated schema contains '" + exp_token + "' string: ");
-        try (Scanner scanner = new Scanner(schemaOutputFile)) {
-            if (scanner.findWithinHorizon(exp_token, 0) != null) {
-                System.out.println("OK");
-                return;
-            }
+    //Read schema content from file
+    private static void readSchemaContent() throws Exception {
+        schemaContent = Files.lines(schemaOutputFile.toPath()).collect(Collectors.joining(""));
+    }
+
+    // Check if schema file contains specific string
+    private static void checkSchemaContent(String expContent) {
+        System.out.print("Check if generated schema contains '" + expContent + "' string: ");
+        if (schemaContent.contains(expContent)) {
+            System.out.println("OK");
+            return;
         }
         System.out.println("FAIL");
-        throw new RuntimeException("The '" + exp_token + "' is not found in generated schema");
+        throw new RuntimeException("The '" + expContent + "' is not found in generated schema");
+    }
 
+    // Check if the generated schema contains all enum constants
+    // and their order is preserved
+    private static void checkEnumOrder() throws Exception {
+        int prevElem = -1;
+        for (String elem : expectedEnums) {
+            int curElem = schemaContent.indexOf(elem);
+            System.out.println(elem + " position = " + curElem);
+            if (curElem < prevElem) {
+                throw new RuntimeException("FAIL: Enum values order is incorrect or " + elem + " element is not found");
+            }
+            prevElem = curElem;
+        }
     }
 
     private static String getClassFilePath(String filename) {
--- a/test/javax/xml/ws/8046817/TestEnumType.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/javax/xml/ws/8046817/TestEnumType.java	Thu Apr 23 16:04:22 2015 -0700
@@ -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
@@ -25,5 +25,5 @@
 
 @XmlEnum(String.class)
 public enum TestEnumType {
-    ONE, TWO, THREE
+    FIRST, ONE, TWO, THREE, FOUR, FIVE, SIX, LAST
 }
--- a/test/sun/security/pkcs11/sslecc/CipherTest.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/sun/security/pkcs11/sslecc/CipherTest.java	Thu Apr 23 16:04:22 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
 public class CipherTest {
 
     // use any available port for the server socket
-    static int serverPort = 0;
+    static volatile int serverPort = 0;
 
     final int THREADS;
 
--- a/test/sun/security/pkcs11/sslecc/JSSEServer.java	Wed Apr 22 11:11:09 2015 -0700
+++ b/test/sun/security/pkcs11/sslecc/JSSEServer.java	Thu Apr 23 16:04:22 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
         serverContext.init(new KeyManager[] {cipherTest.keyManager}, new TrustManager[] {cipherTest.trustManager}, cipherTest.secureRandom);
 
         SSLServerSocketFactory factory = (SSLServerSocketFactory)serverContext.getServerSocketFactory();
-        serverSocket = (SSLServerSocket)factory.createServerSocket(cipherTest.serverPort);
+        serverSocket = (SSLServerSocket)factory.createServerSocket(0);
         cipherTest.serverPort = serverSocket.getLocalPort();
         serverSocket.setEnabledCipherSuites(factory.getSupportedCipherSuites());
         serverSocket.setWantClientAuth(true);