changeset 47906:ecee53e22939 lvti

Automatic merge with default
author mcimadamore
date Fri, 10 Nov 2017 18:50:32 +0100
parents 4907f462bec0 259dffd8dabc
children 73898f09fed8
files src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyListeners.java
diffstat 209 files changed, 3215 insertions(+), 2377 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Nov 06 20:03:58 2017 +0100
+++ b/.hgtags	Fri Nov 10 18:50:32 2017 +0100
@@ -455,3 +455,4 @@
 92f08900cb3c0d694e5c529a676c1c9e5909193f jdk-10+28
 a6e591e12f122768f675428e1e5a838fd0e9c7ec jdk-10+29
 8fee80b92e65149f7414250fd5e34b6f35d417b4 jdk-10+30
+e6278add9ff28fab70fe1cc4c1d65f7363dc9445 jdk-10+31
--- a/make/common/MakeBase.gmk	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/common/MakeBase.gmk	Fri Nov 10 18:50:32 2017 +0100
@@ -529,7 +529,7 @@
 	$(call MakeDir, $(@D))
 	$(RM) '$(call DecodeSpace, $@)'
 	$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
-	if [ -n "`$(XATTR) -l '$(call DecodeSpace, $@)'`" ]; then $(XATTR) -c '$(call DecodeSpace, $@)'; fi
+	if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then $(XATTR) -cs '$(call DecodeSpace, $@)'; fi
   endef
 else
   define install-file
--- a/make/conf/jib-profiles.js	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/conf/jib-profiles.js	Fri Nov 10 18:50:32 2017 +0100
@@ -518,32 +518,6 @@
                                             common.slowdebug_profile_base);
     });
 
-    // Generate open only profiles for all the main profiles for JPRT and reference
-    // implementation builds.
-    common.main_profile_names.forEach(function (name) {
-        var openName = name + common.open_suffix;
-        profiles[openName] = concatObjects(profiles[name],
-                                           common.open_profile_base);
-    });
-    // The open only profiles on linux are used for reference builds and should
-    // produce the compact profile images by default. This adds "profiles" as an
-    // extra default target.
-    var openOnlyProfilesExtra = {
-        "linux-x86-open": {
-            default_make_targets: "profiles-bundles",
-            configure_args: "--with-jvm-variants=client,server"
-        }
-    };
-    profiles = concatObjects(profiles, openOnlyProfilesExtra);
-
-    // Generate debug profiles for the open only profiles
-    common.main_profile_names.forEach(function (name) {
-        var openName = name + common.open_suffix;
-        var openDebugName = openName + common.debug_suffix;
-        profiles[openDebugName] = concatObjects(profiles[openName],
-                                                common.debug_profile_base);
-    });
-
     // Profiles for building the zero jvm variant. These are used for verification
     // in JPRT.
     var zeroProfiles = {
@@ -579,82 +553,6 @@
         profiles[debugName] = concatObjects(profiles[name], common.debug_profile_base);
     });
 
-    // Profiles used to run tests. Used in JPRT and Mach 5.
-    var testOnlyProfiles = {
-        "run-test-jprt": {
-            target_os: input.build_os,
-            target_cpu: input.build_cpu,
-            dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ],
-            labels: "test",
-            environment: {
-                "JT_JAVA": common.boot_jdk_home
-            }
-        },
-
-        "run-test": {
-            target_os: input.build_os,
-            target_cpu: input.build_cpu,
-            dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ],
-            labels: "test",
-            environment: {
-                "JT_JAVA": common.boot_jdk_home
-            }
-        }
-    };
-    profiles = concatObjects(profiles, testOnlyProfiles);
-
-    // Profiles used to run tests using Jib for internal dependencies.
-    var testedProfile = input.testedProfile;
-    if (testedProfile == null) {
-        testedProfile = input.build_os + "-" + input.build_cpu;
-    }
-    var testOnlyProfilesPrebuilt = {
-        "run-test-prebuilt": {
-            target_os: input.build_os,
-            target_cpu: input.build_cpu,
-            src: "src.conf",
-            dependencies: [ "jtreg", "gnumake", "boot_jdk", "jib", testedProfile + ".jdk",
-                testedProfile + ".test", "src.full"
-            ],
-            work_dir: input.get("src.full", "install_path") + "/test",
-            environment: {
-                "JT_JAVA": common.boot_jdk_home,
-                "PRODUCT_HOME": input.get(testedProfile + ".jdk", "home_path"),
-                "TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path"),
-                "TEST_OUTPUT_DIR": input.src_top_dir
-            },
-            labels: "test"
-        }
-    };
-    // If actually running the run-test-prebuilt profile, verify that the input
-    // variable is valid and if so, add the appropriate target_* values from
-    // the tested profile.
-    if (input.profile == "run-test-prebuilt") {
-        if (profiles[testedProfile] == null) {
-            error("testedProfile is not defined: " + testedProfile);
-        }
-    }
-    if (profiles[testedProfile] != null) {
-        testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
-            = profiles[testedProfile]["target_os"];
-        testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
-            = profiles[testedProfile]["target_cpu"];
-    }
-    profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
-
-    // On macosx add the devkit bin dir to the path in all the run-test profiles.
-    // This gives us a guaranteed working version of lldb for the jtreg failure handler.
-    if (input.build_os == "macosx") {
-        macosxRunTestExtra = {
-            dependencies: [ "devkit" ],
-            environment_path: input.get("devkit", "install_path")
-                + "/Xcode.app/Contents/Developer/usr/bin"
-        }
-        profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
-        profiles["run-test-jprt"] = concatObjects(profiles["run-test-jprt"], macosxRunTestExtra);
-        profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
-    }
-
     //
     // Define artifacts for profiles
     //
@@ -707,7 +605,6 @@
             common.debug_profile_artifacts(artifactData[name]));
     });
 
-    // Extra profile specific artifacts
     profilesArtifacts = {
         "linux-x64": {
             artifacts: {
@@ -719,261 +616,51 @@
                     ],
                 },
             }
-        },
-
-        "linux-x64-open": {
-            artifacts: {
-                jdk: {
-                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/linux-x64/jdk-" + data.version
-                            + "_linux-x64_bin.tar.gz",
-                        "bundles/openjdk/GPL/linux-x64/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jre: {
-                    local: "bundles/\\(jre.*bin.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
-                },
-                test: {
-                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/linux-x64/jdk-" + data.version
-                            + "_linux-x64_bin-tests.tar.gz",
-                        "bundles/openjdk/GPL/linux-x64/\\1"
-                    ]
-                },
-                jdk_symbols: {
-                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/linux-x64/jdk-" + data.version
-                            + "_linux-x64_bin-symbols.tar.gz",
-                        "bundles/openjdk/GPL/linux-x64/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jre_symbols: {
-                    local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
-                },
-                doc_api_spec: {
-                    local: "bundles/\\(jdk.*doc-api-spec.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
-                },
-            }
-        },
-
-        "linux-x86-open": {
-            artifacts: {
-                jdk: {
-                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/linux-x86/jdk-" + data.version
-                            + "_linux-x86_bin.tar.gz",
-                        "bundles/openjdk/GPL/linux-x86/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jdk_symbols: {
-                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/linux-x86/jdk-" + data.version
-                            + "_linux-x86_bin-symbols.tar.gz",
-                        "bundles/openjdk/GPL/linux-x86/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                test: {
-                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/linux-x86/jdk-" + data.version
-                            + "_linux-x86_bin-tests.tar.gz",
-                        "bundles/openjdk/GPL/linux-x86/\\1"
-                    ]
-                },
-                jre: {
-                    // This regexp needs to not match the compact* files below
-                    local: "bundles/\\(jre.*[+][0-9]\\{1,\\}_linux-x86_bin.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },
-                jre_compact1: {
-                    local: "bundles/\\(jre.*-compact1_linux-x86_bin.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },
-                jre_compact2: {
-                    local: "bundles/\\(jre.*-compact2_linux-x86_bin.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },
-                jre_compact3: {
-                    local: "bundles/\\(jre.*-compact3_linux-x86_bin.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },
-            }
-        },
-
-        "macosx-x64-open": {
-            artifacts: {
-                jdk: {
-                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/osx-x64/jdk-" + data.version
-                            + "_osx-x64_bin.tar.gz",
-                        "bundles/openjdk/GPL/osx-x64/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jre: {
-                    local: "bundles/\\(jre.*bin.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/osx-x64/\\1",
-                },
-                test: {
-                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/osx-x64/jdk-" + data.version
-                            + "_osx-x64_bin-tests.tar.gz",
-                        "bundles/openjdk/GPL/osx-x64/\\1"
-                    ]
-                },
-                jdk_symbols: {
-                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/osx-x64/jdk-" + data.version
-                            + "_osx-x64_bin-symbols.tar.gz",
-                        "bundles/openjdk/GPL/osx-x64/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jre_symbols: {
-                    local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/osx-x64/\\1",
-                },
-                doc_api_spec: {
-                    local: "bundles/\\(jdk.*doc-api-spec.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/osx-x64/\\1",
-                },
-            }
-        },
-
-        "windows-x86-open": {
-            artifacts: {
-                jdk: {
-                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/windows-x86/jdk-" + data.version
-                            + "_windows-x86_bin.tar.gz",
-                        "bundles/openjdk/GPL/windows-x86/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jre: {
-                    local: "bundles/\\(jre.*bin.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/windows-x86/\\1"
-                },
-                test: {
-                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/windows-x86/jdk-" + data.version
-                            + "_windows-x86_bin-tests.tar.gz",
-                        "bundles/openjdk/GPL/windows-x86/\\1"
-                    ]
-                },
-                jdk_symbols: {
-                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/windows-x86/jdk-" + data.version
-                            + "_windows-x86_bin-symbols.tar.gz",
-                        "bundles/openjdk/GPL/windows-x86/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jre_symbols: {
-                    local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/windows-x86/\\1",
-                }
-            }
-        },
-
-        "windows-x64-open": {
-            artifacts: {
-                jdk: {
-                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/windows-x64/jdk-" + data.version
-                            + "_windows-x64_bin.tar.gz",
-                        "bundles/openjdk/GPL/windows-x64/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jre: {
-                    local: "bundles/\\(jre.*bin.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/windows-x64/\\1"
-                },
-                test: {
-                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/windows-x64/jdk-" + data.version
-                            + "_windows-x64_bin-tests.tar.gz",
-                        "bundles/openjdk/GPL/windows-x64/\\1"
-                    ]
-                },
-                jdk_symbols: {
-                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
-                    remote: [
-                        "bundles/openjdk/GPL/windows-x64/jdk-" + data.version
-                            + "_windows-x64_bin-symbols.tar.gz",
-                        "bundles/openjdk/GPL/windows-x64/\\1"
-                    ],
-                    subdir: "jdk-" + data.version
-                },
-                jre_symbols: {
-                    local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/windows-x64/\\1",
-                }
-            }
-        },
-
-        "linux-x86-open-debug": {
-            artifacts: {
-                jdk: {
-                    local: "bundles/\\(jdk.*bin-debug.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },
-                jre: {
-                    local: "bundles/\\(jre.*bin-debug.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },
-                jdk_symbols: {
-                    local: "bundles/\\(jdk.*bin-debug-symbols.tar.gz\\)",
-                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },
-            }
-        },
-
+        }
     };
     profiles = concatObjects(profiles, profilesArtifacts);
 
+    // Generate open only profiles for all the main and debug profiles.
+    // Rewrite artifact remote paths by adding "openjdk/GPL".
+    common.main_profile_names.forEach(function (name) {
+        var openName = name + common.open_suffix;
+        profiles[openName] = concatObjects(profiles[name],
+            common.open_profile_base);
+        for (artifactName in profiles[openName].artifacts) {
+            var artifact = profiles[openName].artifacts[artifactName];
+            artifact.remote = replaceAll(
+                "bundles\/", "bundles/openjdk/GPL/",
+                (artifact.remote != null ? artifact.remote : artifact.local));
+        }
+        var debugName = name + common.debug_suffix;
+        var openDebugName = name + common.open_suffix + common.debug_suffix;
+        profiles[openDebugName] = concatObjects(profiles[debugName],
+            common.open_profile_base);
+        for (artifactName in profiles[openDebugName].artifacts) {
+            var artifact = profiles[openDebugName].artifacts[artifactName];
+            artifact.remote = replaceAll(
+                "bundles\/", "bundles/openjdk/GPL/",
+                (artifact.remote != null ? artifact.remote : artifact.local));
+        }
+    });
 
     // Define the reference implementation profiles. These are basically the same
-    // as the open profiles, but upload artifacts to a different location and
-    // are only defined for specific platforms.
-    profiles["linux-x64-ri"] = clone(profiles["linux-x64-open"]);
-    profiles["linux-x86-ri"] = clone(profiles["linux-x86-open"]);
-    profiles["linux-x86-ri-debug"] = clone(profiles["linux-x86-open-debug"]);
-    profiles["macosx-x64-ri"] = clone(profiles["macosx-x64-open"]);
-    profiles["windows-x86-ri"] = clone(profiles["windows-x86-open"]);
-    profiles["windows-x64-ri"] = clone(profiles["windows-x64-open"]);
-
-    // Generate artifacts for ri profiles
-    [ "linux-x64-ri", "linux-x86-ri", "linux-x86-ri-debug", "macosx-x64-ri", "windows-x86-ri", "windows-x64-ri" ]
-        .forEach(function (name) {
-            // Rewrite all remote dirs to "bundles/openjdk/BCL/..."
-            for (artifactName in profiles[name].artifacts) {
-                var artifact = profiles[name].artifacts[artifactName];
-                artifact.remote = replaceAll("\/GPL\/", "/BCL/",
-                    (artifact.remote != null ? artifact.remote : artifact.local));
-            }
-        });
+    // as the open profiles, but upload artifacts to a different location.
+    common.main_profile_names.forEach(function (name) {
+        var riName = name + "-ri";
+        var riDebugName = riName + common.debug_suffix;
+        var openName = name + common.open_suffix;
+        var openDebugName = openName + common.debug_suffix;
+        profiles[riName] = clone(profiles[openName]);
+        profiles[riDebugName] = clone(profiles[openDebugName]);
+        // Rewrite all remote dirs to "bundles/openjdk/BCL/..."
+        for (artifactName in profiles[riName].artifacts) {
+            var artifact = profiles[riName].artifacts[artifactName];
+            artifact.remote = replaceAll(
+                "\/GPL\/", "/BCL/",
+                (artifact.remote != null ? artifact.remote : artifact.local));
+        }
+    });
 
     // The windows ri profile needs to add the freetype license file
     profilesRiFreetype = {
@@ -990,6 +677,83 @@
     };
     profiles = concatObjects(profiles, profilesRiFreetype);
 
+    // Profiles used to run tests. Used in JPRT and Mach 5.
+    var testOnlyProfiles = {
+        "run-test-jprt": {
+            target_os: input.build_os,
+            target_cpu: input.build_cpu,
+            dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ],
+            labels: "test",
+            environment: {
+                "JT_JAVA": common.boot_jdk_home
+            }
+        },
+
+        "run-test": {
+            target_os: input.build_os,
+            target_cpu: input.build_cpu,
+            dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ],
+            labels: "test",
+            environment: {
+                "JT_JAVA": common.boot_jdk_home
+            }
+        }
+    };
+    profiles = concatObjects(profiles, testOnlyProfiles);
+
+    // Profiles used to run tests using Jib for internal dependencies.
+    var testedProfile = input.testedProfile;
+    if (testedProfile == null) {
+        testedProfile = input.build_os + "-" + input.build_cpu;
+    }
+    var testOnlyProfilesPrebuilt = {
+        "run-test-prebuilt": {
+            target_os: input.build_os,
+            target_cpu: input.build_cpu,
+            src: "src.conf",
+            dependencies: [ "jtreg", "gnumake", "boot_jdk", "jib", testedProfile + ".jdk",
+                testedProfile + ".test", "src.full"
+            ],
+            work_dir: input.get("src.full", "install_path") + "/test",
+            environment: {
+                "JT_JAVA": common.boot_jdk_home,
+                "PRODUCT_HOME": input.get(testedProfile + ".jdk", "home_path"),
+                "TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path"),
+                "TEST_OUTPUT_DIR": input.src_top_dir
+            },
+            labels: "test"
+        }
+    };
+
+    // If actually running the run-test-prebuilt profile, verify that the input
+    // variable is valid and if so, add the appropriate target_* values from
+    // the tested profile.
+    if (input.profile == "run-test-prebuilt") {
+        if (profiles[testedProfile] == null) {
+            error("testedProfile is not defined: " + testedProfile);
+        }
+    }
+    if (profiles[testedProfile] != null) {
+        testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
+            = profiles[testedProfile]["target_os"];
+        testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
+            = profiles[testedProfile]["target_cpu"];
+    }
+    profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
+
+    // On macosx add the devkit bin dir to the path in all the run-test profiles.
+    // This gives us a guaranteed working version of lldb for the jtreg failure handler.
+    if (input.build_os == "macosx") {
+        macosxRunTestExtra = {
+            dependencies: [ "devkit" ],
+            environment_path: input.get("devkit", "install_path")
+                + "/Xcode.app/Contents/Developer/usr/bin"
+        }
+        profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
+        profiles["run-test-jprt"] = concatObjects(profiles["run-test-jprt"], macosxRunTestExtra);
+        profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
+    }
+
     // Generate the missing platform attributes
     profiles = generatePlatformAttributes(profiles);
     profiles = generateDefaultMakeTargetsConfigureArg(common, profiles);
@@ -1060,7 +824,7 @@
         jtreg: {
             server: "javare",
             revision: "4.2",
-            build_number: "b09",
+            build_number: "b10",
             checksum_file: "MD5_VALUES",
             file: "jtreg_bin-4.2.zip",
             environment_name: "JT_HOME",
--- a/make/data/tzdata/VERSION	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/VERSION	Fri Nov 10 18:50:32 2017 +0100
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2017b
+tzdata2017c
--- a/make/data/tzdata/africa	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/africa	Fri Nov 10 18:50:32 2017 +0100
@@ -49,7 +49,7 @@
 #
 # For data circa 1899, a common source is:
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
-# http://www.jstor.org/stable/1774359
+# https://www.jstor.org/stable/1774359
 #
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@@ -241,7 +241,7 @@
 # saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
 # From Jesper Nørgaard Welen (2007-08-15): [The following agree:]
 # http://www.nentjes.info/Bill/bill5.htm
-# http://www.timeanddate.com/worldclock/city.html?n=53
+# https://www.timeanddate.com/worldclock/city.html?n=53
 # From Steffen Thorsen (2007-09-04): The official information...:
 # http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
 Rule	Egypt	2007	only	-	Sep	Thu>=1	24:00	0	-
@@ -279,8 +279,8 @@
 # timeanddate[2] and another site I've found[3] also support that.
 #
 # [1] https://bugzilla.redhat.com/show_bug.cgi?id=492263
-# [2] http://www.timeanddate.com/worldclock/clockchange.html?n=53
-# [3] http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
+# [2] https://www.timeanddate.com/worldclock/clockchange.html?n=53
+# [3] https://wwp.greenwichmeantime.com/time-zone/africa/egypt/
 
 # From Arthur David Olson (2009-04-20):
 # In 2009 (and for the next several years), Ramadan ends before the fourth
@@ -290,10 +290,10 @@
 # From Steffen Thorsen (2009-08-11):
 # We have been able to confirm the August change with the Egyptian Cabinet
 # Information and Decision Support Center:
-# http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
+# https://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
 #
 # The Middle East News Agency
-# http://www.mena.org.eg/index.aspx
+# https://www.mena.org.eg/index.aspx
 # also reports "Egypt starts winter time on August 21"
 # today in article numbered "71, 11/08/2009 12:25 GMT."
 # Only the title above is available without a subscription to their service,
@@ -343,7 +343,7 @@
 # Thursday of April....  Clocks will still be turned back for Ramadan, but
 # dates not yet announced....
 # http://almogaz.com/news/weird-news/2015/04/05/1947105 ...
-# http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
+# https://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
 
 # From Ahmed Nazmy (2015-04-20):
 # Egypt's ministers cabinet just announced ... that it will cancel DST at
@@ -470,11 +470,11 @@
 
 # From Even Scharning (2012-11-10):
 # Libya set their time one hour back at 02:00 on Saturday November 10.
-# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
+# https://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
 # Here is an official source [in Arabic]: http://ls.ly/fb6Yc
 #
 # Steffen Thorsen forwarded a translation (2012-11-10) in
-# http://mm.icann.org/pipermail/tz/2012-November/018451.html
+# https://mm.icann.org/pipermail/tz/2012-November/018451.html
 #
 # From Tim Parenti (2012-11-11):
 # Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1.
@@ -485,7 +485,7 @@
 # From Even Scharning (2013-10-25):
 # The scheduled end of DST in Libya on Friday, October 25, 2013 was
 # cancelled yesterday....
-# http://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
+# https://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
 #
 # From Paul Eggert (2013-10-25):
 # For now, assume they're reverting to the pre-2012 rules of permanent UT +02.
@@ -538,7 +538,7 @@
 # basis....
 # It seems that Mauritius observed daylight saving time from 1982-10-10 to
 # 1983-03-20 as well, but that was not successful....
-# http://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
+# https://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
 
 # From Alex Krivenyshev (2008-06-25):
 # http://economicdevelopment.gov.mu/portal/site/Mainhomepage/menuitem.a42b24128104d9845dabddd154508a0c/?content_id=0a7cee8b5d69a110VgnVCM1000000a04a8c0RCRD
@@ -606,7 +606,7 @@
 # http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
 #
 # Our wrap-up:
-# http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
+# https://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
 
 # From Arthur David Olson (2009-07-11):
 # The "mauritius-dst-will-not-repeat" wrapup includes this:
@@ -638,7 +638,7 @@
 # be one hour ahead of GMT between 1 June and 27 September, according to
 # Communication Minister and Government Spokesman, Khalid Naciri...."
 #
-# http://www.worldtimezone.net/dst_news/dst_news_morocco01.html
+# http://www.worldtimezone.com/dst_news/dst_news_morocco01.html
 # http://en.afrik.com/news11892.html
 
 # From Alex Krivenyshev (2008-05-09):
@@ -651,7 +651,7 @@
 
 # From Patrice Scattolin (2008-05-09):
 # According to this article:
-# http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
+# https://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
 # (and republished here: <http://www.actu.ma/heure-dete-comment_i127896_0.html>)
 # the changes occur at midnight:
 #
@@ -673,7 +673,7 @@
 # posted in English).
 #
 # The following Google query will generate many relevant hits:
-# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
+# https://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
 
 # From Steffen Thorsen (2008-08-27):
 # Morocco will change the clocks back on the midnight between August 31
@@ -684,7 +684,7 @@
 # http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default
 #
 # We have some further details posted here:
-# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
+# https://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
 
 # From Steffen Thorsen (2009-03-17):
 # Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
@@ -694,7 +694,7 @@
 # (French)
 #
 # Our summary:
-# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
+# https://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
 
 # From Alexander Krivenyshev (2009-03-17):
 # Here is a link to official document from Royaume du Maroc Premier Ministre,
@@ -717,7 +717,7 @@
 # http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
 # (French)
 # Our page:
-# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# https://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 
 # From Dan Abitol (2011-03-30):
 # ...Rules for Africa/Casablanca are the following (24h format)
@@ -734,7 +734,7 @@
 # They said that the decision was already taken.
 #
 # More articles in the press
-# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
+# https://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
 # http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
 # http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
 
@@ -826,7 +826,7 @@
 # 1433 (18 April 2012) and the decision of the Head of Government of
 # 16 N. 3-29-15 Chaaban 1435 (4 June 2015).
 # Source (french):
-# http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
+# https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
 #
 # From Milamber (2015-06-09):
 # http://www.mmsp.gov.ma/fr/actualites.aspx?id=863
@@ -835,7 +835,7 @@
 # [The gov.ma announcement] would (probably) make the switch on 2015-07-19 go
 # from 03:00 to 04:00 rather than from 02:00 to 03:00, as in the patch....
 # I think the patch is correct and the quoted text is wrong; the text in
-# <http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
+# <https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
 # with the patch.
 
 # From Paul Eggert (2015-06-08):
@@ -960,9 +960,17 @@
 Link Africa/Maputo Africa/Lubumbashi	# E Dem. Rep. of Congo
 Link Africa/Maputo Africa/Lusaka	# Zambia
 
+
 # Namibia
-# The 1994-04-03 transition is from Shanks & Pottenger.
-# Shanks & Pottenger report no DST after 1998-04; go with IATA.
+
+# From Arthur David Olson (2017-08-09):
+# The text of the "Namibia Time Act, 1994" is available online at
+# www.lac.org.na/laws/1994/811.pdf
+# and includes this nugget:
+# Notwithstanding the provisions of subsection (2) of section 1, the
+# first winter period after the commencement of this Act shall
+# commence at OOhOO on Monday 21 March 1994 and shall end at 02h00 on
+# Sunday 4 September 1994.
 
 # From Petronella Sibeene (2007-03-30):
 # http://allafrica.com/stories/200703300178.html
@@ -978,19 +986,30 @@
 # observes Botswana time, we have no details about historical practice.
 # In the meantime people there can use Africa/Gaborone.
 # See: Immanuel S. The Namibian. 2017-02-23.
-# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
+# https://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
+
+# From Steffen Thorsen (2017-08-09):
+# Namibia is going to change their time zone to what is now their DST:
+# https://www.newera.com.na/2017/02/23/namibias-winter-time-might-be-repealed/
+# This video is from the government decision:
+# https://www.nbc.na/news/na-passes-namibia-time-bill-repealing-1994-namibia-time-act.8665
+# We have made the assumption so far that they will change their time zone at
+# the same time they would normally start DST, the first Sunday in September:
+# https://www.timeanddate.com/news/time/namibia-new-time-zone.html
 
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Namibia	1994	max	-	Sep	Sun>=1	2:00	1:00	S
-Rule	Namibia	1995	max	-	Apr	Sun>=1	2:00	0	-
+Rule	Namibia	1994	only	-	Mar	21	0:00	0	-
+Rule	Namibia	1994	2016	-	Sep	Sun>=1	2:00	1:00	S
+Rule	Namibia	1995	2017	-	Apr	Sun>=1	2:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Windhoek	1:08:24 -	LMT	1892 Feb 8
 			1:30	-	+0130	1903 Mar
 			2:00	-	SAST	1942 Sep 20  2:00
 			2:00	1:00	SAST	1943 Mar 21  2:00
 			2:00	-	SAST	1990 Mar 21 # independence
-			2:00	-	CAT	1994 Apr  3
-			1:00	Namibia	WA%sT
+			2:00	-	CAT	1994 Mar 21  0:00
+			1:00	Namibia	WA%sT	2017 Sep  3  2:00
+			2:00	-	CAT
 
 # Niger
 # See Africa/Lagos.
@@ -1077,14 +1096,24 @@
 # no information
 
 # Sudan
-#
+
 # From <http://www.sunanews.net/sn13jane.html>
 # Sudan News Agency (2000-01-13),
 # also reported by Michaël De Beukelaer-Dossche via Steffen Thorsen:
 # Clocks will be moved ahead for 60 minutes all over the Sudan as of noon
 # Saturday....  This was announced Thursday by Caretaker State Minister for
 # Manpower Abdul-Rahman Nur-Eddin.
+
+# From Ahmed Atyya, National Telecommunications Corp. (NTC), Sudan (2017-10-17):
+# ... the Republic of Sudan is going to change the time zone from (GMT+3:00)
+# to (GMT+ 2:00) starting from Wednesday 1 November 2017.
 #
+# From Paul Eggert (2017-10-18):
+# A scanned copy (in Arabic) of Cabinet Resolution No. 352 for the
+# year 2017 can be found as an attachment in email today from Yahia
+# Abdalla of NTC, archived at:
+# https://mm.icann.org/pipermail/tz/2017-October/025333.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Sudan	1970	only	-	May	 1	0:00	1:00	S
 Rule	Sudan	1970	1985	-	Oct	15	0:00	0	-
@@ -1093,10 +1122,14 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Khartoum	2:10:08 -	LMT	1931
 			2:00	Sudan	CA%sT	2000 Jan 15 12:00
-			3:00	-	EAT
+			3:00	-	EAT	2017 Nov  1
+			2:00	-	CAT
 
 # South Sudan
-Link Africa/Khartoum Africa/Juba
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Juba	2:06:28 -	LMT	1931
+			2:00	Sudan	CA%sT	2000 Jan 15 12:00
+			3:00	-	EAT
 
 # Swaziland
 # See Africa/Johannesburg.
@@ -1134,11 +1167,11 @@
 # According to several news sources, Tunisia will not observe DST this year.
 # (Arabic)
 # http://www.elbashayer.com/?page=viewn&nid=42546
-# http://www.babnet.net/kiwidetail-15295.asp
+# https://www.babnet.net/kiwidetail-15295.asp
 #
 # We have also confirmed this with the US embassy in Tunisia.
 # We have a wrap-up about this on the following page:
-# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
+# https://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
 
 # From Alexander Krivenyshev (2009-03-17):
 # Here is a link to Tunis Afrique Presse News Agency
--- a/make/data/tzdata/antarctica	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/antarctica	Fri Nov 10 18:50:32 2017 +0100
@@ -49,7 +49,7 @@
 # Heard Island, McDonald Islands (uninhabited)
 #	previously sealers and scientific personnel wintered
 #	Margaret Turner reports
-#	http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
+#	https://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
 #	(1999-09-30) that they're UT +05, with no DST;
 #	presumably this is when they have visitors.
 #
@@ -70,7 +70,7 @@
 # http://www.aad.gov.au/default.asp?casid=37079
 #
 # We have more background information here:
-# http://www.timeanddate.com/news/time/antarctica-new-times.html
+# https://www.timeanddate.com/news/time/antarctica-new-times.html
 
 # From Steffen Thorsen (2010-03-10):
 # We got these changes from the Australian Antarctic Division: ...
@@ -85,7 +85,7 @@
 # - Mawson station stays on UTC+5.
 #
 # Background:
-# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
+# https://www.timeanddate.com/news/time/antartica-time-changes-2010.html
 
 # From Steffen Thorsen (2016-10-28):
 # Australian Antarctica Division informed us that Casey changed time
@@ -168,7 +168,7 @@
 #
 # year-round base in the main continent
 # Dumont d'Urville, Île des Pétrels, -6640+14001, since 1956-11
-# <http://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
+# <https://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
 #
 # Another base at Port-Martin, 50km east, began operation in 1947.
 # It was destroyed by fire on 1952-01-14.
--- a/make/data/tzdata/asia	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/asia	Fri Nov 10 18:50:32 2017 +0100
@@ -49,7 +49,7 @@
 #
 # For data circa 1899, a common source is:
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
-# http://www.jstor.org/stable/1774359
+# https://www.jstor.org/stable/1774359
 #
 # For Russian data circa 1919, a source is:
 # Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
@@ -98,8 +98,8 @@
 Rule RussiaAsia	1981	1984	-	Apr	1	 0:00	1:00	S
 Rule RussiaAsia	1981	1983	-	Oct	1	 0:00	0	-
 Rule RussiaAsia	1984	1995	-	Sep	lastSun	 2:00s	0	-
-Rule RussiaAsia	1985	2011	-	Mar	lastSun	 2:00s	1:00	S
-Rule RussiaAsia	1996	2011	-	Oct	lastSun	 2:00s	0	-
+Rule RussiaAsia	1985	2010	-	Mar	lastSun	 2:00s	1:00	S
+Rule RussiaAsia	1996	2010	-	Oct	lastSun	 2:00s	0	-
 
 # Afghanistan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -132,13 +132,17 @@
 # or
 # (brief)
 # http://www.worldtimezone.com/dst_news/dst_news_armenia03.html
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule Armenia	2011	only	-	Mar	lastSun	 2:00s	1:00	S
+Rule Armenia	2011	only	-	Oct	lastSun	 2:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Yerevan	2:58:00 -	LMT	1924 May  2
 			3:00	-	+03	1957 Mar
 			4:00 RussiaAsia +04/+05	1991 Mar 31  2:00s
 			3:00 RussiaAsia	+03/+04	1995 Sep 24  2:00s
 			4:00	-	+04	1997
-			4:00 RussiaAsia	+04/+05
+			4:00 RussiaAsia	+04/+05	2011
+			4:00	Armenia	+04/+05
 
 # Azerbaijan
 
@@ -150,7 +154,7 @@
 # From Steffen Thorsen (2016-03-17):
 # ... the Azerbaijani Cabinet of Ministers has cancelled switching to
 # daylight saving time....
-# http://www.azernews.az/azerbaijan/94137.html
+# https://www.azernews.az/azerbaijan/94137.html
 # http://vestnikkavkaza.net/news/Azerbaijani-Cabinet-of-Ministers-cancels-daylight-saving-time.html
 # http://en.apa.az/xeber_azerbaijan_abolishes_daylight_savings_ti_240862.html
 
@@ -191,11 +195,11 @@
 # the 19th and 20th, and they have not set the end date yet.
 #
 # Some sources:
-# http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
+# https://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
 # http://bdnews24.com/details.php?id=85889&cid=2
 #
 # Our wrap-up:
-# http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
+# https://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
 
 # From A. N. M. Kamrus Saadat (2009-06-15):
 # Finally we've got the official mail regarding DST start time where DST start
@@ -281,9 +285,15 @@
 
 # Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
 
+# From Paul Eggert (2017-04-20):
+# Page 27 of Reed & Low (cited for Asia/Kolkata) says "Rangoon local time is
+# used upon the railways and telegraphs of Burma, and is 6h. 24m. 47s. ahead
+# of Greenwich."  This refers to the period before Burma's transition to +0630,
+# a transition for which Shanks is the only source.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Yangon	6:24:40 -	LMT	1880        # or Rangoon
-			6:24:40	-	RMT	1920        # Rangoon Mean Time?
+Zone	Asia/Yangon	6:24:47 -	LMT	1880        # or Rangoon
+			6:24:47	-	RMT	1920        # Rangoon local time
 			6:30	-	+0630	1942 May
 			9:00	-	+09	1945 May  3
 			6:30	-	+0630
@@ -340,7 +350,7 @@
 #
 # From Jesper Nørgaard Welen (2006-07-14):
 # I have investigated the timezones around 1970 on the
-# http://www.astro.com/atlas site [with provinces and county
+# https://www.astro.com/atlas site [with provinces and county
 # boundaries summarized below]....  A few other exceptions were two
 # counties on the Sichuan side of the Xizang-Sichuan border,
 # counties Dege and Baiyu which lies on the Sichuan side and are
@@ -492,7 +502,7 @@
 
 # From David Cochrane (2014-03-26):
 # Just a confirmation that Ürümqi time was implemented in Ürümqi on 1 Feb 1986:
-# http://content.time.com/time/magazine/article/0,9171,960684,00.html
+# https://content.time.com/time/magazine/article/0,9171,960684,00.html
 
 # From Luther Ma (2014-04-22):
 # I have interviewed numerous people of various nationalities and from
@@ -649,7 +659,7 @@
 # (both in Okinawa) adopt the Western Standard Time which is based on
 # 120E. The adoption began from Jan 1, 1896. The original text can be
 # found on Wikisource:
-# http://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
+# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
 # ... This could be the first adoption of time zone in Taiwan, because
 # during the Qing Dynasty, it seems that there was no time zone
 # declared officially.
@@ -662,7 +672,7 @@
 # territory, including later occupations, adopt Japan Central Time
 # (UTC+9). The adoption began on Oct 1, 1937. The original text can
 # be found on Wikisource:
-# http://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
+# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
 #
 # That is, the time zone of Taipei switched to UTC+9 on Oct 1, 1937.
 
@@ -798,6 +808,12 @@
 # Looks like the time zone split in Cyprus went through last night.
 # http://cyprus-mail.com/2016/10/30/cyprus-new-division-two-time-zones-now-reality/
 
+# From Paul Eggert (2017-10-18):
+# Northern Cyprus will reinstate winter time on October 29, thus
+# staying in sync with the rest of Cyprus.  See: Anastasiou A.
+# Cyprus to remain united in time.  Cyprus Mail 2017-10-17.
+# https://cyprus-mail.com/2017/10/17/cyprus-remain-united-time/
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cyprus	1975	only	-	Apr	13	0:00	1:00	S
 Rule	Cyprus	1975	only	-	Oct	12	0:00	0	-
@@ -815,7 +831,8 @@
 Zone	Asia/Famagusta	2:15:48	-	LMT	1921 Nov 14
 			2:00	Cyprus	EE%sT	1998 Sep
 			2:00	EUAsia	EE%sT	2016 Sep  8
-			3:00	-	+03
+			3:00	-	+03	2017 Oct 29 1:00u
+			2:00	EUAsia	EE%sT
 
 # Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
 # However, for various reasons many users expect to find it under Europe.
@@ -875,7 +892,7 @@
 
 # From João Carrascalão, brother of the former governor of East Timor, in
 # East Timor may be late for its millennium
-# <http://etan.org/et99c/december/26-31/30ETMAY.htm> (1999-12-26/31):
+# <https://etan.org/et99c/december/26-31/30ETMAY.htm> (1999-12-26/31):
 # Portugal tried to change the time forward in 1974 because the sun
 # rises too early but the suggestion raised a lot of problems with the
 # Timorese and I still don't think it would work today because it
@@ -903,21 +920,62 @@
 # India
 
 # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic
-# http://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/
+# https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/
 # (2015-12-22):
 # In January 1906, several thousand cotton-mill workers rioted on the
 # outskirts of Bombay....  They were protesting the proposed abolition of
 # local time in favor of Indian Standard Time....  Journalists called this
 # dispute the "Battle of the Clocks."  It lasted nearly half a century.
 
+# From Paul Eggert (2017-04-20):
+# Good luck trying to nail down old timekeeping records in India.
+# "... in the nineteenth century ... Madras Observatory took its magnetic
+# measurements on Göttingen time, its meteorological measurements on Madras
+# (local) time, dropped its time ball on Greenwich (ocean navigator's) time,
+# and distributed civil (local time)." -- Bartky IR. Selling the true time:
+# 19th-century timekeeping in america. Stanford U Press (2000), 247 note 19.
+# "A more potent cause of resistance to the general adoption of the present
+# standard time lies in the fact that it is Madras time.  The citizen of
+# Bombay, proud of being 'primus in Indis' and of Calcutta, equally proud of
+# his city being the Capital of India, and - for a part of the year - the Seat
+# of the Supreme Government, alike look down on Madras, and refuse to change
+# the time they are using, for that of what they regard as a benighted
+# Presidency; while Madras, having for long given the standard time to the
+# rest of India, would resist the adoption of any other Indian standard in its
+# place." -- Oldham RD. On Time in India: a suggestion for its improvement.
+# Proceedings of the Asiatic Society of Bengal (April 1899), 49-55.
+#
+# "In 1870 ... Madras time - 'now used by the telegraph and regulated from the
+# only government observatory' - was suggested as a standard railway time,
+# first to be adopted on the Great Indian Peninsular Railway (GIPR)....
+# Calcutta, Bombay, and Karachi, were to be allowed to continue with their
+# local time for civil purposes." - Prasad R. Tracks of Change: Railways and
+# Everyday Life in Colonial India. Cambridge University Press (2016), 145.
+#
+# Reed S, Low F. The Indian Year Book 1936-37. Bennett, Coleman, pp 27-8.
+# https://archive.org/details/in.ernet.dli.2015.282212
+# This lists +052110 as Madras local time used in railways, and says that on
+# 1906-01-01 railways and telegraphs in India switched to +0530.  Some
+# municipalities retained their former time, and the time in Calcutta
+# continued to depend on whether you were at the railway station or at
+# government offices.  Government time was at +055320 (according to Shanks) or
+# at +0554 (according to the Indian Year Book).  Railway time is more
+# appropriate for our purposes, as it was better documented, it is what we do
+# elsewhere (e.g., Europe/London before 1880), and after 1906 it was
+# consistent in the region now identified by Asia/Kolkata.  So, use railway
+# time for 1870-1941.  Shanks is our only (and dubious) source for the
+# 1941-1945 data.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Kolkata	5:53:28 -	LMT	1880        # Kolkata
-			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
-			6:30	-	+0630	1942 May 15
+Zone	Asia/Kolkata	5:53:28 -	LMT	1854 Jun 28 # Kolkata
+			5:53:20	-	HMT	1870	    # Howrah Mean Time?
+			5:21:10	-	MMT	1906 Jan  1 # Madras local time
+			5:30	-	IST	1941 Oct
+			5:30	1:00	+0630	1942 May 15
 			5:30	-	IST	1942 Sep
 			5:30	1:00	+0630	1945 Oct 15
 			5:30	-	IST
-# The following are like Asia/Kolkata:
+# Since 1970 the following are like Asia/Kolkata:
 #	Andaman Is
 #	Lakshadweep (Laccadive, Minicoy and Amindivi Is)
 #	Nicobar Is
@@ -1059,7 +1117,7 @@
 # From Reuters (2007-09-16), with a heads-up from Jesper Nørgaard Welen:
 # ... the Guardian Council ... approved a law on Sunday to re-introduce
 # daylight saving time ...
-# http://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
+# https://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
 #
 # From Roozbeh Pournader (2007-11-05):
 # This is quoted from Official Gazette of the Islamic Republic of
@@ -1158,7 +1216,7 @@
 # http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10
 #
 # We have published a short article in English about the change:
-# http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
+# https://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Iraq	1982	only	-	May	1	0:00	1:00	D
@@ -1466,12 +1524,12 @@
 # From Yu-Cheng Chuang (2013-07-12):
 # ...the Meiji Emperor announced Ordinance No. 167 of Meiji Year 28 "The clause
 # about standard time" ... The adoption began from Jan 1, 1896.
-# http://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
+# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
 #
 # ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which
 # means the whole Japan territory, including later occupations, adopt Japan
 # Central Time (UTC+9). The adoption began on Oct 1, 1937.
-# http://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
+# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 31 15:00u
@@ -1533,7 +1591,7 @@
 # Official, in Arabic:
 # http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14
 # ... Our background/permalink about it
-# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
+# https://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
 # ...
 # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P
 # ... says midnight for the coming one and 1:00 for the ones in the future
@@ -1891,9 +1949,9 @@
 # between 1987 and 1988 ...
 
 # From Sanghyuk Jung (2014-10-29):
-# http://mm.icann.org/pipermail/tz/2014-October/021830.html
+# https://mm.icann.org/pipermail/tz/2014-October/021830.html
 # According to the Korean Wikipedia
-# http://ko.wikipedia.org/wiki/한국_표준시
+# https://ko.wikipedia.org/wiki/한국_표준시
 # [oldid=12896437 2014-09-04 08:03 UTC]
 # DST in Republic of Korea was as follows....  And I checked old
 # newspapers in Korean, all articles correspond with data in Wikipedia.
@@ -2115,7 +2173,7 @@
 # +08:00 instead. Different sources appear to disagree with the tz
 # database on this, e.g.:
 #
-# http://www.timeanddate.com/worldclock/city.html?n=1026
+# https://www.timeanddate.com/worldclock/city.html?n=1026
 # http://www.worldtimeserver.com/current_time_in_MN.aspx
 #
 # both say GMT+08:00.
@@ -2245,7 +2303,7 @@
 # help reduce load shedding by approving the closure of commercial centres at
 # 9pm and moving clocks forward by one hour for the next three months. ...."
 #
-# http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan01.html
 # http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4
 
 # From Arthur David Olson (2008-05-19):
@@ -2311,7 +2369,7 @@
 #
 # We have confirmed this year's end date with both with the Ministry of
 # Water and Power and the Pakistan Electric Power Company:
-# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
+# https://www.timeanddate.com/news/time/pakistan-ends-dst09.html
 
 # From Christoph Göhre (2009-10-01):
 # [T]he German Consulate General in Karachi reported me today that Pakistan
@@ -2493,7 +2551,7 @@
 #
 # We are not sure if Gaza will do the same, last year they had a different
 # end date, we will keep this page updated:
-# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
+# https://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
 
 # From Alexander Krivenyshev (2009-09-02):
 # Seems that Gaza Strip will go back to Winter Time same date as West Bank.
@@ -2531,7 +2589,7 @@
 # the clocks were set back one hour at 2010-08-11 00:00:00 local time in
 # Gaza and the West Bank.
 # Some more background info:
-# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
+# https://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
 
 # From Steffen Thorsen (2011-08-26):
 # Gaza and the West Bank did go back to standard time in the beginning of
@@ -2541,7 +2599,7 @@
 #
 # http://www.maannews.net/eng/ViewDetails.aspx?ID=416217
 # Additional info:
-# http://www.timeanddate.com/news/time/palestine-dst-2011.html
+# https://www.timeanddate.com/news/time/palestine-dst-2011.html
 
 # From Alexander Krivenyshev (2011-08-27):
 # According to the article in The Jerusalem Post:
@@ -2551,7 +2609,7 @@
 # The Hamas government said on Saturday that it won't observe summertime after
 # the Muslim feast of Id al-Fitr, which begins on Tuesday..."
 # ...
-# http://www.jpost.com/MiddleEast/Article.aspx?id=235650
+# https://www.jpost.com/MiddleEast/Article.aspx?id=235650
 # http://www.worldtimezone.com/dst_news/dst_news_gazastrip05.html
 # The rules for Egypt are stolen from the 'africa' file.
 
@@ -2572,7 +2630,7 @@
 # http://safa.ps/details/news/74352/%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-%D8%A8%D8%A7%D9%84%D8%B6%D9%81%D8%A9-%D9%88%D8%BA%D8%B2%D8%A9-%D9%84%D9%8A%D9%84%D8%A9-%D8%A7%D9%84%D8%AC%D9%85%D8%B9%D8%A9.html
 #
 # Our brief summary:
-# http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
+# https://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
 
 # From Steffen Thorsen (2013-03-26):
 # The following news sources tells that Palestine will "start daylight saving
@@ -2592,11 +2650,11 @@
 
 # From Steffen Thorsen (2015-03-03):
 # Sources such as http://www.alquds.com/news/article/view/id/548257
-# and http://www.raya.ps/ar/news/890705.html say Palestine areas will
+# and https://www.raya.ps/ar/news/890705.html say Palestine areas will
 # start DST on 2015-03-28 00:00 which is one day later than expected.
 #
 # From Paul Eggert (2015-03-03):
-# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
+# https://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
 # says that the fall 2014 transition was Oct 23 at 24:00.
 
 # From Hannah Kreitem (2016-03-09):
@@ -2620,8 +2678,8 @@
 #
 # From Paul Eggert (2016-10-19):
 # It's also consistent with predictions in the following URLs today:
-# http://www.timeanddate.com/time/change/gaza-strip/gaza
-# http://www.timeanddate.com/time/change/west-bank/hebron
+# https://www.timeanddate.com/time/change/gaza-strip/gaza
+# https://www.timeanddate.com/time/change/west-bank/hebron
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2684,7 +2742,7 @@
 # Philippines, issued a proclamation announcing that 1844-12-30 was to
 # be immediately followed by 1845-01-01; see R.H. van Gent's
 # History of the International Date Line
-# http://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
+# https://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
 # The rest of the data entries are from Shanks & Pottenger.
 
 # From Jesper Nørgaard Welen (2006-04-26):
@@ -2948,7 +3006,7 @@
 # We have not found any sources saying anything about when DST ends this year.
 #
 # Our summary
-# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
+# https://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
 
 # From Steffen Thorsen (2009-10-27):
 # The Syrian Arab News Network on 2009-09-29 reported that Syria will
@@ -2975,7 +3033,7 @@
 # http://www.sana.sy/ara/2/2012/03/26/408215.htm
 #
 # Our brief summary:
-# http://www.timeanddate.com/news/time/syria-dst-2012.html
+# https://www.timeanddate.com/news/time/syria-dst-2012.html
 
 # From Arthur David Olson (2012-03-27):
 # Assume last Friday in March going forward XXX.
@@ -3058,7 +3116,7 @@
 # is quoted verbatim in:
 # http://www.thoigian.com.vn/?mPage=P80D01
 # is translated by Brian Inglis in:
-# http://mm.icann.org/pipermail/tz/2014-October/021654.html
+# https://mm.icann.org/pipermail/tz/2014-October/021654.html
 # and is the basis for the information below.
 #
 # The 1906 transition was effective July 1 and standardized Indochina to
--- a/make/data/tzdata/australasia	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/australasia	Fri Nov 10 18:50:32 2017 +0100
@@ -316,7 +316,7 @@
 # http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=1096:3310-cabinet-approves-change-in-daylight-savings-dates&catid=49:cabinet-releases&Itemid=166
 #
 # A bit more background info here:
-# http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
+# https://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
 
 # From Alexander Krivenyshev (2010-10-24):
 # According to Radio Fiji and Fiji Times online, Fiji will end DST 3
@@ -380,9 +380,12 @@
 # clocks go forward an hour at 2am to 3am....  Daylight Saving will
 # end at 3.00am on Sunday 15th January 2017."
 
-# From Paul Eggert (2016-10-03):
-# For now, guess DST from 02:00 the first Sunday in November to
-# 03:00 the third Sunday in January.  Although ad hoc, it matches
+# From Paul Eggert (2017-08-21):
+# Dominic Fok writes (2017-08-20) that DST ends 2018-01-14, citing
+# Extraordinary Government of Fiji Gazette Supplement No. 21 (2017-08-27),
+# [Legal Notice No. 41] of an order of the previous day by J Usamate.
+# For now, guess DST from 02:00 the first Sunday in November to 03:00
+# the first Sunday on or after January 14.  Although ad hoc, it matches
 # transitions since late 2014 and seems more likely to match future
 # practice than guessing no DST.
 
@@ -396,7 +399,7 @@
 Rule	Fiji	2012	2013	-	Jan	Sun>=18	3:00	0	-
 Rule	Fiji	2014	only	-	Jan	Sun>=18	2:00	0	-
 Rule	Fiji	2014	max	-	Nov	Sun>=1	2:00	1:00	S
-Rule	Fiji	2015	max	-	Jan	Sun>=15	3:00	0	-
+Rule	Fiji	2015	max	-	Jan	Sun>=14	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:55:44 -	LMT	1915 Oct 26 # Suva
 			12:00	Fiji	+12/+13
@@ -580,7 +583,7 @@
 # The World War II entries below are instead based on Arawa-Kieta.
 # The Japanese occupied Kieta in July 1942,
 # according to the Pacific War Online Encyclopedia
-# http://pwencycl.kgbudge.com/B/o/Bougainville.htm
+# https://pwencycl.kgbudge.com/B/o/Bougainville.htm
 # and seem to have controlled it until their 1945-08-21 surrender.
 #
 # The Autonomous Region of Bougainville switched from UT +10 to +11
@@ -602,7 +605,7 @@
 			-8:00	-	-08
 
 # American Samoa
-Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1879 Jul  5
+Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1892 Jul  5
 			-11:22:48 -	LMT	1911
 			-11:00	-	SST	            # S=Samoa
 Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
@@ -618,7 +621,7 @@
 # Sunday of April 2011."
 #
 # Background info:
-# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
+# https://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
 #
 # Samoa's Daylight Saving Time Act 2009 is available here, but does not
 # contain any dates:
@@ -682,7 +685,7 @@
 Rule	WS	2012	max	-	Apr	Sun>=1	4:00	0	S
 Rule	WS	2012	max	-	Sep	lastSun	3:00	1	D
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
+Zone Pacific/Apia	 12:33:04 -	LMT	1892 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	-1130	1950
 			-11:00	WS	-11/-10	2011 Dec 29 24:00
@@ -709,7 +712,7 @@
 # From Paul Eggert (2012-07-25)
 # A Google Books snippet of Appendix to the Journals of the House of
 # Representatives of New Zealand, Session 1948,
-# <http://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
+# <https://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
 # was "11 hours slow on G.M.T."  Go with Thorsen and assume Shanks & Pottenger
 # are off by an hour starting in 1901.
 
@@ -724,8 +727,8 @@
 Rule	Tonga	2000	only	-	Mar	19	2:00s	0	-
 Rule	Tonga	2000	2001	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Tonga	2001	2002	-	Jan	lastSun	2:00	0	-
-Rule	Tonga	2016	max	-	Nov	Sun>=1	2:00	1:00	S
-Rule	Tonga	2017	max	-	Jan	Sun>=15	3:00	0	-
+Rule	Tonga	2016	only	-	Nov	Sun>=1	2:00	1:00	S
+Rule	Tonga	2017	only	-	Jan	Sun>=15	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Tongatapu	12:19:20 -	LMT	1901
 			12:20	-	+1220	1941
@@ -779,7 +782,7 @@
 # Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin,
 # "The United States High-Altitude Test Experience: A Review Emphasizing the
 # Impact on the Environment", Los Alamos LA-6405, Oct 1976.
-# http://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf
+# https://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf
 # See the table on page 4 where he lists GMT and local times for the tests; a
 # footnote for the JI tests reads that local time is "JI time = Hawaii Time
 # Minus One Hour".
@@ -845,7 +848,7 @@
 #
 # For data circa 1899, a common source is:
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
-# http://www.jstor.org/stable/1774359
+# https://www.jstor.org/stable/1774359
 #
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@@ -992,7 +995,7 @@
 #   AEST ACST AWST AEDT ACDT
 #
 #   Parliamentary Library (2008-11-10)
-#   http://www.aph.gov.au/binaries/library/pubs/rp/2008-09/09rp14.pdf
+#   https://www.aph.gov.au/binaries/library/pubs/rp/2008-09/09rp14.pdf
 #   EST CST WST preferred for standard time; AEST AEDT ACST ACDT also used
 #
 #   The Transport Safety Bureau has an extensive series of accident reports,
@@ -1028,13 +1031,13 @@
 #
 # NSW (including LHI and Broken Hill):
 # Standard Time Act 1987 (updated 1995-04-04)
-# http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html
+# https://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html
 # ACT
 # Standard Time and Summer Time Act 1972
-# http://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html
+# https://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html
 # SA
 # Standard Time Act, 1898
-# http://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html
+# https://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html
 
 # From David Grosz (2005-06-13):
 # It was announced last week that Daylight Saving would be extended by
@@ -1329,7 +1332,7 @@
 # http://abc.net.au/news/regionals/neweng/monthly/regeng-22jul1999-1.htm
 # (1999-07-22).  For now, we'll wait to see if this really happens.
 #
-# Victoria will following NSW.  See:
+# Victoria will follow NSW.  See:
 # Vic to extend daylight saving (1999-07-28)
 # http://abc.net.au/local/news/olympics/1999/07/item19990728112314_1.htm
 #
@@ -1432,7 +1435,7 @@
 # the ACT for all 52 weeks of the year...
 #
 # We have a wrap-up here:
-# http://www.timeanddate.com/news/time/south-australia-extends-dst.html
+# https://www.timeanddate.com/news/time/south-australia-extends-dst.html
 ###############################################################################
 
 # New Zealand
@@ -1486,7 +1489,7 @@
 # From Paul Eggert (2014-07-14):
 # Chatham Island time was formally standardized on 1957-01-01 by
 # New Zealand's Standard Time Amendment Act 1956 (1956-10-26).
-# http://www.austlii.edu.au/nz/legis/hist_act/staa19561956n100244.pdf
+# https://www.austlii.edu.au/nz/legis/hist_act/staa19561956n100244.pdf
 # According to Google Books snippet view, a speaker in the New Zealand
 # parliamentary debates in 1956 said "Clause 78 makes provision for standard
 # time in the Chatham Islands.  The time there is 45 minutes in advance of New
@@ -1601,7 +1604,7 @@
 # the Norfolk Island Museum and the Australian Bureau of Meteorology's
 # Norfolk Island station, and found no record of Norfolk observing DST
 # other than in 1974/5.  See:
-# http://www.timeanddate.com/time/australia/norfolk-island.html
+# https://www.timeanddate.com/time/australia/norfolk-island.html
 
 # Pitcairn
 
@@ -1629,11 +1632,13 @@
 
 # (Western) Samoa and American Samoa
 
-# Howse writes (p 153, citing p 10 of the 1883-11-18 New York Herald)
-# that in 1879 the King of Samoa decided to change
+# Howse writes (p 153) that after the 1879 standardization on Antipodean
+# time by the British governor of Fiji, the King of Samoa decided to change
 # "the date in his kingdom from the Antipodean to the American system,
 # ordaining - by a masterpiece of diplomatic flattery - that
 # the Fourth of July should be celebrated twice in that year."
+# This happened in 1892, according to the Evening News (Sydney) of 1892-07-20.
+# https://www.staff.science.uu.nl/~gent0113/idl/idl.htm
 
 # Although Shanks & Pottenger says they both switched to UT -11:30
 # in 1911, and to -11 in 1950. many earlier sources give -11
@@ -1644,6 +1649,7 @@
 # day in 2011.  Assume also that the Samoas follow the US and New
 # Zealand's "ST"/"DT" style of daylight-saving abbreviations.
 
+
 # Tonga
 
 # From Paul Eggert (1996-01-22):
@@ -1738,6 +1744,15 @@
 # Assume Tonga will observe DST from the first Sunday in November at 02:00
 # through the third Sunday in January at 03:00, like Fiji, for now.
 
+# From David Wade (2017-10-18):
+# In August government was disolved by the King.  The current prime minister
+# continued in office in care taker mode.  It is easy to see that few
+# decisions will be made until elections 16th November.
+#
+# From Paul Eggert (2017-10-18):
+# For now, guess that DST is discontinued.  That's what the IATA is guessing.
+
+
 # Wake
 
 # From Vernice Anderson, Personal Secretary to Philip Jessup,
@@ -1750,7 +1765,7 @@
 # making calculation of time in Washington difficult if not almost
 # impossible.
 #
-# http://www.trumanlibrary.org/wake/meeting.htm
+# https://www.trumanlibrary.org/oralhist/andrsonv.htm
 
 # From Paul Eggert (2003-03-23):
 # We have no other report of DST in Wake Island, so omit this info for now.
@@ -1778,7 +1793,7 @@
 # an international standard, there are some places on the high seas where the
 # correct date is ambiguous.
 
-# From Wikipedia <http://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
+# From Wikipedia <https://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
 # Before 1920, all ships kept local apparent time on the high seas by setting
 # their clocks at night or at the morning sight so that, given the ship's
 # speed and direction, it would be 12 o'clock when the Sun crossed the ship's
--- a/make/data/tzdata/backward	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/backward	Fri Nov 10 18:50:32 2017 +0100
@@ -84,7 +84,9 @@
 Link	America/Manaus		Brazil/West
 Link	America/Halifax		Canada/Atlantic
 Link	America/Winnipeg	Canada/Central
-Link	America/Regina		Canada/East-Saskatchewan
+# This line is commented out, as the name exceeded the 14-character limit
+# and was an unused misnomer.
+#Link	America/Regina		Canada/East-Saskatchewan
 Link	America/Toronto		Canada/Eastern
 Link	America/Edmonton	Canada/Mountain
 Link	America/St_Johns	Canada/Newfoundland
--- a/make/data/tzdata/europe	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/europe	Fri Nov 10 18:50:32 2017 +0100
@@ -60,14 +60,14 @@
 #	[PDF] (1914-03)
 #
 #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
-#	<http://www.jstor.org/stable/1774359>.  He writes:
+#	<https://www.jstor.org/stable/1774359>.  He writes:
 #	"It is requested that corrections and additions to these tables
 #	may be sent to Mr. John Milne, Royal Geographical Society,
 #	Savile Row, London."  Nowadays please email them to tz@iana.org.
 #
 #	Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
 #	This Russian-language source was consulted by Vladimir Karpinsky; see
-#	http://mm.icann.org/pipermail/tz/2014-August/021320.html
+#	https://mm.icann.org/pipermail/tz/2014-August/021320.html
 #	The full Russian citation is:
 #	Бялокоз, Евгений Людвигович. Новый счет времени в течении суток
 #	введенный декретом Совета народных комиссаров для всей России с 1-го
@@ -210,7 +210,7 @@
 # foundations of civilization throughout the world.
 #	-- "A Silent Toast to William Willett", Pictorial Weekly;
 #	republished in Finest Hour (Spring 2002) 1(114):26
-#	http://www.winstonchurchill.org/images/finesthour/Vol.01%20No.114.pdf
+#	https://www.winstonchurchill.org/publications/finest-hour/finest-hour-114/a-silent-toast-to-william-willett-by-winston-s-churchill
 
 # From Paul Eggert (2015-08-08):
 # The OED Supplement says that the English originally said "Daylight Saving"
@@ -248,8 +248,8 @@
 # official designation; the reply of the 21st was that there wasn't
 # but he couldn't think of anything better than the "Double British
 # Summer Time" that the BBC had been using informally.
-# http://www.polyomino.org.uk/british-time/bbc-19410418.png
-# http://www.polyomino.org.uk/british-time/ho-19410421.png
+# https://www.polyomino.org.uk/british-time/bbc-19410418.png
+# https://www.polyomino.org.uk/british-time/ho-19410421.png
 
 # From Sir Alexander Maxwell in the above-mentioned letter (1941-04-21):
 # [N]o official designation has as far as I know been adopted for the time
@@ -266,13 +266,13 @@
 # the history of summer time legislation in the United Kingdom.
 # Since 1998 Joseph S. Myers has been updating
 # and extending this list, which can be found in
-# http://www.polyomino.org.uk/british-time/
+# https://www.polyomino.org.uk/british-time/
 
 # From Joseph S. Myers (1998-01-06):
 #
 # The legal time in the UK outside of summer time is definitely GMT, not UTC;
 # see Lord Tanlaw's speech
-# http://www.publications.parliament.uk/pa/ld199798/ldhansrd/vo970611/text/70611-10.htm#70611-10_head0
+# https://www.publications.parliament.uk/pa/ld199798/ldhansrd/vo970611/text/70611-10.htm#70611-10_head0
 # (Lords Hansard 11 June 1997 columns 964 to 976).
 
 # From Paul Eggert (2006-03-22):
@@ -318,7 +318,7 @@
 # Irish 'public feeling (was) outraged by forcing of English time on us'."
 # -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising.
 # Irish Times 2014-10-27.
-# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
+# https://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
 
 # From Joseph S. Myers (2005-01-26):
 # Irish laws are available online at <http://www.irishstatutebook.ie>.
@@ -371,6 +371,12 @@
 # Justice (tel +353 1 678 9711) who confirmed to me that the correct name is
 # "Irish Summer Time", abbreviated to "IST".
 
+# Michael Deckers (2017-06-01) gave the following URLs for Ireland's
+# Summer Time Act, 1925 and Summer Time Orders, 1926 and 1947:
+# http://www.irishstatutebook.ie/eli/1925/act/8/enacted/en/print.html
+# http://www.irishstatutebook.ie/eli/1926/sro/919/made/en/print.html
+# http://www.irishstatutebook.ie/eli/1947/sro/71/made/en/print.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 # Summer Time Act, 1916
 Rule	GB-Eire	1916	only	-	May	21	2:00s	1:00	BST
@@ -495,14 +501,14 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Dublin	-0:25:00 -	LMT	1880 Aug  2
-			-0:25:21 -	DMT	1916 May 21  2:00 # Dublin MT
+			-0:25:21 -	DMT	1916 May 21  2:00s # Dublin MT
 			-0:25:21 1:00	IST	1916 Oct  1  2:00s
 			 0:00	GB-Eire	%s	1921 Dec  6 # independence
-			 0:00	GB-Eire	GMT/IST	1940 Feb 25  2:00
-			 0:00	1:00	IST	1946 Oct  6  2:00
-			 0:00	-	GMT	1947 Mar 16  2:00
-			 0:00	1:00	IST	1947 Nov  2  2:00
-			 0:00	-	GMT	1948 Apr 18  2:00
+			 0:00	GB-Eire	GMT/IST	1940 Feb 25  2:00s
+			 0:00	1:00	IST	1946 Oct  6  2:00s
+			 0:00	-	GMT	1947 Mar 16  2:00s
+			 0:00	1:00	IST	1947 Nov  2  2:00s
+			 0:00	-	GMT	1948 Apr 18  2:00s
 			 0:00	GB-Eire	GMT/IST	1968 Oct 27
 			 1:00	-	IST	1971 Oct 31  2:00u
 			 0:00	GB-Eire	GMT/IST	1996
@@ -648,7 +654,7 @@
 # Council of Ministers of the USSR from 1989-03-14 No. 227.
 #
 # I did not find full texts of these acts.  For the 1989 one we have
-# title at http://base.garant.ru/70754136/ :
+# title at https://base.garant.ru/70754136/ :
 # "About change in calculation of time on the territories of
 # Lithuanian SSR, Latvian SSR and Estonian SSR, Astrakhan,
 # Kaliningrad, Kirov, Kuybyshev, Ulyanovsk and Uralsk oblasts".
@@ -679,7 +685,7 @@
 # http://bmockbe.ru/events/?ID=7583
 #
 # Medvedev signed a law on the calculation of the time (in russian):
-# http://www.regnum.ru/news/polit/1413906.html
+# https://www.regnum.ru/news/polit/1413906.html
 
 # From Arthur David Olson (2011-06-15):
 # Take "abolishing daylight saving time" to mean that time is now considered
@@ -806,7 +812,7 @@
 # Sources (Russian language):
 # http://www.belta.by/ru/all_news/society/V-Belarusi-otmenjaetsja-perexod-na-sezonnoe-vremja_i_572952.html
 # http://naviny.by/rubrics/society/2011/09/16/ic_articles_116_175144/
-# http://news.tut.by/society/250578.html
+# https://news.tut.by/society/250578.html
 #
 # From Alexander Bokovoy (2014-10-09):
 # Belarussian government decided against changing to winter time....
@@ -1127,7 +1133,7 @@
 # for their standard and summer times. He says no, they use "suveaeg"
 # (summer time) and "talveaeg" (winter time).
 
-# From The Baltic Times <http://www.baltictimes.com/> (1999-09-09)
+# From The Baltic Times <https://www.baltictimes.com/> (1999-09-09)
 # via Steffen Thorsen:
 # This year will mark the last time Estonia shifts to summer time,
 # a council of the ruling coalition announced Sept. 6....
@@ -1179,7 +1185,7 @@
 # This is documented in Heikki Oja: Aikakirja 2007, published by The Almanac
 # Office of University of Helsinki, ISBN 952-10-3221-9, available online (in
 # Finnish) at
-# http://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
+# https://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
 #
 # Page 105 (56 in PDF version) has a handy table of all past daylight savings
 # transitions. It is easy enough to interpret without Finnish skills.
@@ -1192,7 +1198,7 @@
 
 # From Konstantin Hyppönen (2014-06-13):
 # [Heikki Oja's book Aikakirja 2013]
-# http://almanakka.helsinki.fi/images/aikakirja/Aikakirja2013kokonaan.pdf
+# https://almanakka.helsinki.fi/images/aikakirja/Aikakirja2013kokonaan.pdf
 # pages 104-105, including a scan from a newspaper published on Apr 2 1942
 # say that ... [o]n Apr 2 1942, 24 o'clock (which means Apr 3 1942,
 # 00:00), clocks were moved one hour forward. The newspaper
@@ -1322,7 +1328,7 @@
 
 # From Jörg Schilling (2002-10-23):
 # In 1945, Berlin was switched to Moscow Summer time (GMT+4) by
-# http://www.dhm.de/lemo/html/biografien/BersarinNikolai/
+# https://www.dhm.de/lemo/html/biografien/BersarinNikolai/
 # General [Nikolai] Bersarin.
 
 # From Paul Eggert (2003-03-08):
@@ -1547,7 +1553,7 @@
 # From Paul Eggert (2016-10-27):
 # Go with INRiM for DST rules, except as corrected by Inglis for 1944
 # for the Kingdom of Italy.  This is consistent with Renzo Baldini.
-# Model Rome's occupation by using using C-Eur rules from 1943-09-10
+# Model Rome's occupation by using C-Eur rules from 1943-09-10
 # to 1944-06-04; although Rome was an open city during this period, it
 # was effectively controlled by Germany.
 #
@@ -1862,14 +1868,14 @@
 # Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
 # Tiraspol will go back to winter time on October 30, 2011.
 # News from Moldova (in russian):
-# http://ru.publika.md/link_317061.html
+# https://ru.publika.md/link_317061.html
 
 # From Roman Tudos (2015-07-02):
 # http://lex.justice.md/index.php?action=view&view=doc&lang=1&id=355077
 # From Paul Eggert (2015-07-01):
 # The abovementioned official link to IGO1445-868/2014 states that
 # 2014-10-26's fallback transition occurred at 03:00 local time.  Also,
-# http://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
+# https://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
 # says the 2014-03-30 spring-forward transition was at 02:00 local time.
 # Guess that since 1997 Moldova has switched one hour before the EU.
 
@@ -1941,7 +1947,7 @@
 # Amsterdam mean time.
 
 # The data entries before 1945 are taken from
-# http://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
+# https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Neth	1916	only	-	May	 1	0:00	1:00	NST	# Netherlands Summer Time
@@ -2022,7 +2028,7 @@
 # so it must have diverged from Oslo time during the war, as Oslo was
 # keeping Berlin time.
 #
-# <http://home.no.net/janmayen/history.htm> says that the meteorologists
+# <https://www.jan-mayen.no/history.htm> says that the meteorologists
 # burned down their station in 1940 and left the island, but returned in
 # 1941 with a small Norwegian garrison and continued operations despite
 # frequent air attacks from Germans.  In 1943 the Americans established a
@@ -2060,7 +2066,7 @@
 Rule	Poland	1945	only	-	Nov	 1	0:00	0	-
 # For 1946 on the source is Kazimierz Borkowski,
 # Toruń Center for Astronomy, Dept. of Radio Astronomy, Nicolaus Copernicus U.,
-# http://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1
+# https://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1
 # Thanks to Przemysław Augustyniak (2005-05-28) for this reference.
 # He also gives these further references:
 # Mon Pol nr 13, poz 162 (1995) <http://www.abc.com.pl/serwis/mp/1995/0162.htm>
@@ -2094,7 +2100,7 @@
 #
 # From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne:
 # According to a Portuguese decree (1911-05-26)
-# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# https://dre.pt/application/dir/pdf1sdip/1911/05/12500/23132313.pdf
 # Lisbon was at -0:36:44.68, but switched to GMT on 1912-01-01 at 00:00.
 # Round the old offset to -0:36:45.  This agrees with Willett but disagrees
 # with Shanks, who says the transition occurred on 1911-05-24 at 00:00 for
@@ -2276,7 +2282,7 @@
 # 2011 No. 725" and contains no other dates or "effective date" information.
 #
 # Another source is
-# http://www.rg.ru/2011/09/06/chas-zona-dok.html
+# https://rg.ru/2011/09/06/chas-zona-dok.html
 # which, according to translate.google.com, begins "Resolution of the
 # Government of the Russian Federation on August 31, 2011 N 725" and also
 # contains "Date first official publication: September 6, 2011 Posted on:
@@ -2284,7 +2290,7 @@
 # does not contain any "effective date" information.
 #
 # Another source is
-# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
+# https://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
 # which, in note 8, contains "Resolution No. 725 of August 31, 2011...
 # Effective as of after 7 days following the day of the official publication"
 # but which does not contain any reference to September 6, 2011.
@@ -2320,7 +2326,7 @@
 # http://itar-tass.com/obschestvo/1333711
 # http://www.pravo.gov.ru:8080/page.aspx?111660
 # http://www.kremlin.ru/acts/46279
-# From October 26, 2014 the new Russian time zone map will looks like this:
+# From October 26, 2014 the new Russian time zone map will look like this:
 # http://www.worldtimezone.com/dst_news/dst_news_russia-map-2014-07.html
 
 # From Paul Eggert (2006-03-22):
@@ -2367,7 +2373,7 @@
 # with maintenance only and represent our best guesses as to which regions
 # are covered by each zone.  They are not meant to be taken as an authoritative
 # listing.  The region codes listed come from
-# http://en.wikipedia.org/w/?title=Federal_subjects_of_Russia&oldid=611810498
+# https://en.wikipedia.org/w/?title=Federal_subjects_of_Russia&oldid=611810498
 # and are used for convenience only; no guarantees are made regarding their
 # future stability.  ISO 3166-2:RU codes are also listed for first-level
 # divisions where available.
@@ -2532,7 +2538,7 @@
 # http://www.kaliningradka.ru/site_pc/cherez/index.php?ELEMENT_ID=40091
 # says that Kaliningrad decided not to be an exception 2 days before the
 # 1991-03-31 switch and one person at
-# http://izhevsk.ru/forum_light_message/50/682597-m8369040.html
+# https://izhevsk.ru/forum_light_message/50/682597-m8369040.html
 # says he remembers that Samara opted out of the 1992-01-19 exception
 # 2 days before the switch.
 #
@@ -2604,7 +2610,7 @@
 			 3:00	-	MSK	1997 Mar lastSun  1:00u
 # From Alexander Krivenyshev (2014-03-17):
 # time change at 2:00 (2am) on March 30, 2014
-# http://vz.ru/news/2014/3/17/677464.html
+# https://vz.ru/news/2014/3/17/677464.html
 # From Paul Eggert (2014-03-30):
 # Simferopol and Sevastopol reportedly changed their central town clocks
 # late the previous day, but this appears to have been ceremonial
@@ -2787,7 +2793,7 @@
 # suggests that Altai Republic transitioned to Moscow+3 on
 # 1995-05-28.
 #
-# http://regnum.ru/news/society/1957270.html
+# https://regnum.ru/news/society/1957270.html
 # has some historical data for Altai Krai:
 # before 1957: west part on UTC+6, east on UTC+7
 # after 1957: UTC+7
@@ -3161,8 +3167,8 @@
 # districts, but have very similar populations.  In fact, Wikipedia currently
 # lists them both as having 3528 people, exactly 1668 males and 1860 females
 # each!  (Yikes!)
-# http://en.wikipedia.org/w/?title=Srednekolymsky_District&oldid=603435276
-# http://en.wikipedia.org/w/?title=Verkhnekolymsky_District&oldid=594378493
+# https://en.wikipedia.org/w/?title=Srednekolymsky_District&oldid=603435276
+# https://en.wikipedia.org/w/?title=Verkhnekolymsky_District&oldid=594378493
 # Assume this is a mistake, albeit an amusing one.
 #
 # Looking at censuses, the populations of the two municipalities seem to have
@@ -3483,7 +3489,7 @@
 #
 # From Alois Treindl (2013-09-11):
 # The Federal regulations say
-# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html
+# https://www.admin.ch/opc/de/classified-compilation/20071096/index.html
 # ... the meridian for Bern mean time ... is 7 degrees 26' 22.50".
 # Expressed in time, it is 0h29m45.5s.
 
@@ -3560,9 +3566,9 @@
 # According to the articles linked below, Turkey will change into summer
 # time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
 # This change is due to a nationwide exam on 27th.
-# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
+# https://www.worldbulletin.net/?aType=haber&ArticleID=70872
 # Turkish:
-# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
+# https://www.hurriyet.com.tr/yaz-saati-uygulamasi-bir-gun-ileri-alindi-17230464
 
 # From Faruk Pasin (2014-02-14):
 # The DST for Turkey has been changed for this year because of the
@@ -3698,7 +3704,7 @@
 # http://www.segodnya.ua/news/14290482.html
 #
 # Deputies cancelled the winter time (in Russian)
-# http://www.pravda.com.ua/rus/news/2011/09/20/6600616/
+# https://www.pravda.com.ua/rus/news/2011/09/20/6600616/
 #
 # From Philip Pizzey (2011-10-18):
 # Today my Ukrainian colleagues have informed me that the
--- a/make/data/tzdata/leapseconds	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/leapseconds	Fri Nov 10 18:50:32 2017 +0100
@@ -26,19 +26,18 @@
 # This file is in the public domain.
 
 # This file is generated automatically from the data in the public-domain
-# leap-seconds.list file available from most NIST time servers.
-# If the URL <ftp://time.nist.gov/pub/leap-seconds.list> does not work,
-# you should be able to pick up leap-seconds.list from a secondary NIST server.
-# See <http://tf.nist.gov/tf-cgi/servers.cgi> for a list of secondary servers.
+# leap-seconds.list file, which is copied from:
+# ftp://ftp.nist.gov/pub/time/leap-seconds.list
 # For more about leap-seconds.list, please see
 # The NTP Timescale and Leap Seconds
-# http://www.eecis.udel.edu/~mills/leap.html
+# https://www.eecis.udel.edu/~mills/leap.html
 
 # The International Earth Rotation and Reference Systems Service
 # periodically uses leap seconds to keep UTC to within 0.9 s of UT1
 # (which measures the true angular orientation of the earth in space); see
-# Terry J Quinn, The BIPM and the accurate measure of time,
-# Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>.
+# Levine J. Coordinated Universal Time and the leap second.
+# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995
+# http://ieeexplore.ieee.org/document/7909995/
 # There were no leap seconds before 1972, because the official mechanism
 # accounting for the discrepancy between atomic time and the earth's rotation
 # did not exist until the early 1970s.
@@ -81,5 +80,5 @@
 Leap	2015	Jun	30	23:59:60	+	S
 Leap	2016	Dec	31	23:59:60	+	S
 
-#	Updated through IERS Bulletin C53
-#	File expires on:  28 December 2017
+#	Updated through IERS Bulletin C54
+#	File expires on:  28 June 2018
--- a/make/data/tzdata/northamerica	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/northamerica	Fri Nov 10 18:50:32 2017 +0100
@@ -128,10 +128,13 @@
 # Last night I heard part of a rebroadcast of a 1945 Arch Oboler radio drama.
 # In the introduction, Oboler spoke of "Eastern Peace Time."
 # An AltaVista search turned up:
-# http://rowayton.org/rhs/hstaug45.html
+# https://web.archive.org/web/20000926032210/http://rowayton.org/rhs/hstaug45.html
 # "When the time is announced over the radio now, it is 'Eastern Peace
 # Time' instead of the old familiar 'Eastern War Time.'  Peace is wonderful."
 # (August 1945) by way of confirmation.
+#
+# From Paul Eggert (2017-09-23):
+# This was the V-J Day issue of the Clamdigger, a Rowayton, CT newsletter.
 
 # From Joseph Gallant citing
 # George H. Douglas, _The Early Days of Radio Broadcasting_ (1987):
@@ -280,7 +283,7 @@
 # HST and HDT are standardized abbreviations for Hawaii-Aleutian
 # standard and daylight times.  See section 9.47 (p 234) of the
 # U.S. Government Printing Office Style Manual (2008)
-# http://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
+# https://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
 
 # From Arthur David Olson, 2005-08-09
 # The following was signed into law on 2005-08-08.
@@ -369,7 +372,7 @@
 # western Tennessee, most of Texas, Wisconsin
 
 # From Larry M. Smith (2006-04-26) re Wisconsin:
-# http://www.legis.state.wi.us/statutes/Stat0175.pdf ...
+# https://docs.legis.wisconsin.gov/statutes/statutes/175.pdf
 # is currently enforced at the 01:00 time of change.  Because the local
 # "bar time" in the state corresponds to 02:00, a number of citations
 # are issued for the "sale of class 'B' alcohol after prohibited
@@ -378,7 +381,7 @@
 # From Douglas R. Bomberg (2007-03-12):
 # Wisconsin has enacted (nearly eleventh-hour) legislation to get WI
 # Statue 175 closer in synch with the US Congress' intent....
-# http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf
+# https://docs.legis.wisconsin.gov/2007/related/acts/3
 
 # From an email administrator of the City of Fort Pierre, SD (2015-12-21):
 # Fort Pierre is technically located in the Mountain time zone as is
@@ -425,7 +428,7 @@
 # ...it appears that Mercer County, North Dakota, changed from the
 # mountain time zone to the central time zone at the last transition from
 # daylight-saving to standard time (on Nov. 7, 2010):
-# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
+# https://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
 # http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
 
 # From Andy Lipscomb (2011-01-24):
@@ -476,7 +479,7 @@
 # legal time, and is not part of the data here.)  See:
 # Ross SA. An energy crisis from the past: Northern California in 1948.
 # Working Paper No. 8, Institute of Governmental Studies, UC Berkeley,
-# 1973-11.  http://escholarship.org/uc/item/8x22k30c
+# 1973-11.  https://escholarship.org/uc/item/8x22k30c
 #
 # In another measure to save electricity, DST was instituted from 1948-03-14
 # at 02:01 to 1949-01-16 at 02:00, with the governor having the option to move
@@ -497,8 +500,8 @@
 # which established DST from April's last Sunday at 01:00 until September's
 # last Sunday at 02:00. This was amended by 1962's Proposition 6, which changed
 # the fall-back date to October's last Sunday. See:
-# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
-# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
+# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
+# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
 #
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
 Rule	CA	1948	only	-	Mar	14	2:01	1:00	D
@@ -515,20 +518,31 @@
 # Alaska
 # AK%sT is the modern abbreviation for -09 per USNO.
 #
-# From Paul Eggert (2001-05-30):
+# From Paul Eggert (2017-06-15):
 # Howse writes that Alaska switched from the Julian to the Gregorian calendar,
 # and from east-of-GMT to west-of-GMT days, when the US bought it from Russia.
-# This was on 1867-10-18, a Friday; the previous day was 1867-10-06 Julian,
-# also a Friday.  Include only the time zone part of this transition,
-# ignoring the switch from Julian to Gregorian, since we can't represent
-# the Julian calendar.
+# On Friday, 1867-10-18 (Gregorian), at precisely 15:30 local time, the
+# Russian forts and fleet at Sitka fired salutes to mark the ceremony of
+# formal transfer.  See the Sacramento Daily Union (1867-11-14), p 3, col 2.
+# https://cdnc.ucr.edu/cgi-bin/cdnc?a=d&d=SDU18671114.2.12.1
+# Sitka workers did not change their calendars until Sunday, 1867-10-20,
+# and so celebrated two Sundays that week.  See: Ahllund T (tr Hallamaa P).
+# From the memoirs of a Finnish workman. Alaska History. 2006 Fall;21(2):1-25.
+# http://alaskahistoricalsociety.org/wp-content/uploads/2016/12/Ahllund-2006-Memoirs-of-a-Finnish-Workman.pdf
+# Include only the time zone part of this transition, ignoring the switch
+# from Julian to Gregorian, since we can't represent the Julian calendar.
 #
-# As far as we know, none of the exact locations mentioned below were
+# As far as we know, of the locations mentioned below only Sitka was
 # permanently inhabited in 1867 by anyone using either calendar.
-# (Yakutat was colonized by the Russians in 1799, but the settlement
-# was destroyed in 1805 by a Yakutat-kon war party.)  However, there
-# were nearby inhabitants in some cases and for our purposes perhaps
-# it's best to simply use the official transition.
+# (Yakutat was colonized by the Russians in 1799, but the settlement was
+# destroyed in 1805 by a Yakutat-kon war party.)  Many of Alaska's inhabitants
+# were unaware of the US acquisition of Alaska, much less of any calendar or
+# time change.  However, the Russian-influenced part of Alaska did observe
+# Russian time, and it is more accurate to model this than to ignore it.
+# The database format requires an exact transition time; use the Russian
+# salute as a somewhat-arbitrary time for the formal transfer of control for
+# all of Alaska.  Sitka's UTC offset is -9:01:13; adjust its 15:30 to the
+# local times of other Alaskan locations so that they change simultaneously.
 
 # From Paul Eggert (2014-07-18):
 # One opinion of the early-1980s turmoil in Alaska over time zones and
@@ -581,10 +595,10 @@
 # It seems Metlakatla did go off PST on Sunday, November 1, changing
 # their time to AKST and are going to follow Alaska's DST, switching
 # between AKST and AKDT from now on....
-# http://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/
+# https://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
+Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 19 15:33:32
 			 -8:57:41 -	LMT	1900 Aug 20 12:00
 			 -8:00	-	PST	1942
 			 -8:00	US	P%sT	1946
@@ -594,7 +608,7 @@
 			 -8:00	US	P%sT	1983 Oct 30  2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
-Zone America/Sitka	 14:58:47 -	LMT	1867 Oct 18
+Zone America/Sitka	 14:58:47 -	LMT	1867 Oct 19 15:30
 			 -9:01:13 -	LMT	1900 Aug 20 12:00
 			 -8:00	-	PST	1942
 			 -8:00	US	P%sT	1946
@@ -602,7 +616,7 @@
 			 -8:00	US	P%sT	1983 Oct 30  2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
-Zone America/Metlakatla	 15:13:42 -	LMT	1867 Oct 18
+Zone America/Metlakatla	 15:13:42 -	LMT	1867 Oct 19 15:44:55
 			 -8:46:18 -	LMT	1900 Aug 20 12:00
 			 -8:00	-	PST	1942
 			 -8:00	US	P%sT	1946
@@ -610,14 +624,14 @@
 			 -8:00	US	P%sT	1983 Oct 30  2:00
 			 -8:00	-	PST	2015 Nov  1  2:00
 			 -9:00	US	AK%sT
-Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
+Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 19 15:12:18
 			 -9:18:55 -	LMT	1900 Aug 20 12:00
 			 -9:00	-	YST	1942
 			 -9:00	US	Y%sT	1946
 			 -9:00	-	YST	1969
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
-Zone America/Anchorage	 14:00:24 -	LMT	1867 Oct 18
+Zone America/Anchorage	 14:00:24 -	LMT	1867 Oct 19 14:31:37
 			 -9:59:36 -	LMT	1900 Aug 20 12:00
 			-10:00	-	AST	1942
 			-10:00	US	A%sT	1967 Apr
@@ -625,7 +639,7 @@
 			-10:00	US	AH%sT	1983 Oct 30  2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
-Zone America/Nome	 12:58:21 -	LMT	1867 Oct 18
+Zone America/Nome	 12:58:22 -	LMT	1867 Oct 19 13:29:35
 			-11:01:38 -	LMT	1900 Aug 20 12:00
 			-11:00	-	NST	1942
 			-11:00	US	N%sT	1946
@@ -634,7 +648,7 @@
 			-11:00	US	B%sT	1983 Oct 30  2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
-Zone America/Adak	 12:13:21 -	LMT	1867 Oct 18
+Zone America/Adak	 12:13:22 -	LMT	1867 Oct 19 12:44:35
 			-11:46:38 -	LMT	1900 Aug 20 12:00
 			-11:00	-	NST	1942
 			-11:00	US	N%sT	1946
@@ -670,7 +684,7 @@
 # "Hawaiian Time" by Robert C. Schmitt and Doak C. Cox appears on pages 207-225
 # of volume 26 of The Hawaiian Journal of History (1992). As of 2010-12-09,
 # the article is available at
-# http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
+# https://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
 # and indicates that standard time was adopted effective noon, January
 # 13, 1896 (page 218), that in "1933, the Legislature decreed daylight
 # saving for the period between the last Sunday of each April and the
@@ -769,7 +783,7 @@
 # Indiana
 #
 # For a map of Indiana's time zone regions, see:
-# http://en.wikipedia.org/wiki/Time_in_Indiana
+# https://en.wikipedia.org/wiki/Time_in_Indiana
 #
 # From Paul Eggert (2007-08-17):
 # Since 1970, most of Indiana has been like America/Indiana/Indianapolis,
@@ -996,7 +1010,7 @@
 # From Paul Eggert (2001-07-16):
 # The final rule was published in the
 # Federal Register 65, 160 (2000-08-17), pp 50154-50158.
-# http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=2000_register&docid=fr17au00-22
+# https://www.gpo.gov/fdsys/pkg/FR-2000-08-17/html/00-20854.htm
 #
 Zone America/Kentucky/Monticello -5:39:24 - LMT	1883 Nov 18 12:20:36
 			-6:00	US	C%sT	1946
@@ -1022,7 +1036,7 @@
 # West Wendover, NV officially switched from Pacific to mountain time on
 # 1999-10-31.  See the
 # Federal Register 64, 203 (1999-10-21), pp 56705-56707.
-# http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=1999_register&docid=fr21oc99-15
+# https://www.gpo.gov/fdsys/pkg/FR-1999-10-21/html/99-27240.htm
 # However, the Federal Register says that West Wendover already operated
 # on mountain time, and the rule merely made this official;
 # hence a separate tz entry is not needed.
@@ -1052,12 +1066,23 @@
 # one hour in 1914."  This change is not in Shanks.  We have no more
 # info, so omit this for now.
 #
+# From Paul Eggert (2017-07-26):
+# Although Shanks says Detroit observed DST in 1967 from 06-14 00:01
+# until 10-29 00:01, I now see multiple reports that this is incorrect.
+# For example, according to a 50-year anniversary report about the 1967
+# Detroit riots and a major-league doubleheader on 1967-07-23, "By the time
+# the last fly ball of the doubleheader settled into the glove of leftfielder
+# Lenny Green, it was after 7 p.m.  Detroit did not observe daylight saving
+# time, so light was already starting to fail.  Twilight was made even deeper
+# by billowing columns of smoke that ascended in an unbroken wall north of the
+# ballpark."  See: Dow B. Detroit '67: As violence unfolded, Tigers played two
+# at home vs. Yankees. Detroit Free Press 2017-07-23.
+# https://www.freep.com/story/sports/mlb/tigers/2017/07/23/detroit-tigers-1967-riot-new-york-yankees/499951001/
+#
 # Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
 Rule	Detroit	1948	only	-	Apr	lastSun	2:00	1:00	D
 Rule	Detroit	1948	only	-	Sep	lastSun	2:00	0	S
-Rule	Detroit	1967	only	-	Jun	14	2:00	1:00	D
-Rule	Detroit	1967	only	-	Oct	lastSun	2:00	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Detroit	-5:32:11 -	LMT	1905
 			-6:00	-	CST	1915 May 15  2:00
@@ -1121,7 +1146,7 @@
 #	[PDF] (1914-03)
 #
 #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
-#	<http://www.jstor.org/stable/1774359>.
+#	<https://www.jstor.org/stable/1774359>.
 #
 # See the 'europe' file for Greenland.
 
@@ -1167,19 +1192,19 @@
 # The British Columbia government announced yesterday that it will
 # adjust daylight savings next year to align with changes in the
 # U.S. and the rest of Canada....
-# http://www2.news.gov.bc.ca/news_releases_2005-2009/2006AG0014-000330.htm
+# https://archive.news.gov.bc.ca/releases/news_releases_2005-2009/2006AG0014-000330.htm
 # ...
 # Nova Scotia
 # Daylight saving time will be extended by four weeks starting in 2007....
-# http://www.gov.ns.ca/just/regulations/rg2/2006/ma1206.pdf
+# https://www.novascotia.ca/just/regulations/rg2/2006/ma1206.pdf
 #
 # [For New Brunswick] the new legislation dictates that the time change is to
 # be done at 02:00 instead of 00:01.
-# http://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
+# https://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
 # ...
 # Manitoba has traditionally changed the clock every fall at 03:00.
 # As of 2006, the transition is to take place one hour earlier at 02:00.
-# http://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
+# https://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
 # ...
 # [Alberta, Ontario, Quebec] will follow US rules.
 # http://www.qp.gov.ab.ca/documents/spring/CH03_06.CFM
@@ -1193,7 +1218,7 @@
 # http://www.hoa.gov.nl.ca/hoa/bills/Bill0634.htm
 # ...
 # Yukon
-# http://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
+# https://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
 # ...
 # N.W.T. will follow US rules.  Whoever maintains the government web site
 # does not seem to believe in bookmarks.  To see the news release, click the
@@ -1214,8 +1239,8 @@
 # time and daylight saving time arrangements in Canada circa 1998.
 #
 # National Research Council Canada maintains info about time zones and DST.
-# http://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
-# http://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
+# https://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
+# https://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
 # Its unofficial information is often taken from Matthews and Vincent.
 
 # From Paul Eggert (2006-06-27):
@@ -1252,11 +1277,13 @@
 
 # Newfoundland and Labrador
 
-# From Paul Eggert (2000-10-02):
-# Matthews and Vincent (1998) write that Labrador should use NST/NDT,
-# but the only part of Labrador that follows the rules is the
-# southeast corner, including Port Hope Simpson and Mary's Harbour,
-# but excluding, say, Black Tickle.
+# From Paul Eggert (2017-10-14):
+# Legally Labrador should observe Newfoundland time; see:
+# McLeod J. Labrador time - legal or not? St. John's Telegram, 2017-10-07
+# http://www.thetelegram.com/news/local/labrador-time--legal-or-not-154860/
+# Matthews and Vincent (1998) write that the only part of Labrador
+# that follows the rules is the southeast corner, including Port Hope
+# Simpson and Mary's Harbour, but excluding, say, Black Tickle.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	StJohns	1917	only	-	Apr	 8	2:00	1:00	D
@@ -1456,7 +1483,7 @@
 # http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
 # that the coastal strip from just east of Natashquan to Blanc-Sablon
 # observes Atlantic standard time all year round.
-# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
+# https://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
 # says this common practice was codified into law as of 2007.
 # For lack of better info, guess this practice began around 1970, contra to
 # Shanks & Pottenger who have this region observing AST/ADT.
@@ -1488,6 +1515,11 @@
 # earlier in June).
 #
 # Kenora, Ontario, was to abandon DST on 1914-06-01 (-05-21).
+#
+# From Paul Eggert (2017-07-08):
+# For more on Orillia, see: Daubs K. Bold attempt at daylight saving
+# time became a comic failure in Orillia. Toronto Star 2017-07-08.
+# https://www.thestar.com/news/insight/2017/07/08/bold-attempt-at-daylight-saving-time-became-a-comic-failure-in-orillia.html
 
 # From Paul Eggert (1997-10-17):
 # Mark Brader writes that an article in the 1997-10-14 Toronto Star
@@ -1979,7 +2011,7 @@
 #	* 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
 #	c. 7 defines Yukon standard time as UTC-9....
 #	see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
-#	[http://canlii.ca/t/7vhg]
+#	[https://www.canlii.org/en/ca/laws/stat/rsc-1985-c-i-21/latest/rsc-1985-c-i-21.html]
 #	* C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
 #	* O.I.C. 1980/02 established DST.
 #	* O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
@@ -2044,7 +2076,7 @@
 #     hours behind Greenwich Time.
 #
 # * Yukon Standard Time defined as Pacific Standard Time, YCO 1973/214
-#   http://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
+#   https://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
 #   C.O. 1973/214 INTERPRETATION ACT ...
 #
 #     1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby
@@ -2059,7 +2091,7 @@
 #   http://? - no online source found
 #
 # * Yukon Daylight Saving Time, YOIC 1987/56
-#   http://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
+#   https://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
 #   O.I.C. 1987/056 INTERPRETATION ACT ...
 #
 #   In every year between
@@ -2071,7 +2103,7 @@
 #   Dated ... 9th day of March, A.D., 1987.
 #
 # * Yukon Daylight Saving Time 2006, YOIC 2006/127
-#   http://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
+#   https://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
 #   O.I.C. 2006/127 INTERPRETATION ACT ...
 #
 #     1. In Yukon each year the time for general purposes shall be 7 hours
@@ -2085,7 +2117,7 @@
 #     3. This order comes into force January 1, 2007.
 #
 # * Interpretation Act, RSY 2002, c 125
-# http://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
+# https://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
 
 # From Rives McDow (1999-09-04):
 # Nunavut ... moved ... to incorporate the whole territory into one time zone.
@@ -2128,7 +2160,7 @@
 
 # From Michaela Rodrigue, writing in the
 # Nunatsiaq News (1999-11-19):
-# http://www.nunatsiaq.com/archives/nunavut991130/nvt91119_17.html
+# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html
 # Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones,
 # central - or Nunavut time - for government offices, and eastern time
 # for municipal offices and schools....  Igloolik [was similar but then]
@@ -2146,7 +2178,7 @@
 # Central Time and Southampton Island [in the Central zone] is not
 # required to use daylight savings.
 
-# From <http://www.nunatsiaq.com/archives/nunavut001130/nvt21110_02.html>
+# From <http://www.nunatsiaqonline.ca/archives/nunavut001130/nvt21110_02.html>
 # Nunavut now has two time zones (2000-11-10):
 # The Nunavut government would allow its employees in Kugluktuk and
 # Cambridge Bay to operate on central time year-round, putting them
@@ -2477,7 +2509,7 @@
 # http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/V2-101209.html
 #
 # Our page:
-# http://www.timeanddate.com/news/time/north-mexico-dst-change.html
+# https://www.timeanddate.com/news/time/north-mexico-dst-change.html
 
 # From Arthur David Olson (2010-01-20):
 # The page
@@ -2896,7 +2928,7 @@
 # http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm
 #
 # Some more background information is posted here:
-# http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
+# https://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
 #
 # The article also says that Cuba has been observing DST since 1963,
 # while Shanks (and tzdata) has 1965 as the first date (except in the
@@ -2943,7 +2975,7 @@
 # http://granma.co.cu/2011/03/08/nacional/artic01.html
 #
 # Our info:
-# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
+# https://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
 #
 # From Steffen Thorsen (2011-10-30)
 # Cuba will end DST two weeks later this year. Instead of going back
@@ -2953,7 +2985,7 @@
 # http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
 #
 # Our page:
-# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# https://www.timeanddate.com/news/time/cuba-time-changes-2011.html
 #
 # From Steffen Thorsen (2012-03-01)
 # According to Radio Reloj, Cuba will start DST on Midnight between March
@@ -2963,7 +2995,7 @@
 # http://www.radioreloj.cu/index.php/noticias-radio-reloj/71-miscelaneas/7529-cuba-aplicara-el-horario-de-verano-desde-el-1-de-abril
 #
 # Our info on it:
-# http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
+# https://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
 
 # From Steffen Thorsen (2012-11-03):
 # Radio Reloj and many other sources report that Cuba is changing back
@@ -3158,8 +3190,8 @@
 # From Steffen Thorsen (2016-03-12):
 # Jean Antoine, editor of www.haiti-reference.com informed us that Haiti
 # are not going on DST this year.  Several other resources confirm this: ...
-# http://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
-# http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
+# https://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
+# https://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
 # http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
 
 # From Steffen Thorsen (2017-03-12):
@@ -3358,7 +3390,7 @@
 # Turks and Caicos
 #
 # From Chris Dunn in
-# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415007
+# https://bugs.debian.org/415007
 # (2007-03-15): In the Turks & Caicos Islands (America/Grand_Turk) the
 # daylight saving dates for time changes have been adjusted to match
 # the recent U.S. change of dates.
@@ -3380,12 +3412,25 @@
 # "permanent daylight saving time" by one year....
 # http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm
 #
+# From the Turks & Caicos Cabinet (2017-07-20), heads-up from Steffen Thorsen:
+# ... agreed to the reintroduction in TCI of Daylight Saving Time (DST)
+# during the summer months and Standard Time, also known as Local
+# Time, during the winter months with effect from April 2018 ...
+# https://www.gov.uk/government/news/turks-and-caicos-post-cabinet-meeting-statement--3
+#
+# From Paul Eggert (2017-08-26):
+# The date of effect of the spring 2018 change appears to be March 11,
+# which makes more sense.  See: Hamilton D. Time change back
+# by March 2018 for TCI. Magnetic Media. 2017-08-25.
+# http://magneticmediatv.com/2017/08/time-change-back-by-march-2018-for-tci/
+#
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Grand_Turk	-4:44:32 -	LMT	1890
 			-5:07:11 -	KMT	1912 Feb # Kingston Mean Time
 			-5:00	-	EST	1979
 			-5:00	US	E%sT	2015 Nov Sun>=1 2:00
-			-4:00	-	AST
+			-4:00	-	AST	2018 Mar 11 3:00
+			-5:00	US	E%sT
 
 # British Virgin Is
 # Virgin Is
--- a/make/data/tzdata/southamerica	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/southamerica	Fri Nov 10 18:50:32 2017 +0100
@@ -45,7 +45,7 @@
 #
 # For data circa 1899, a common source is:
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
-# http://www.jstor.org/stable/1774359
+# https://www.jstor.org/stable/1774359
 #
 # These tables use numeric abbreviations like -03 and -0330 for
 # integer hour and minute UTC offsets.  Although earlier editions used
@@ -288,8 +288,8 @@
 #
 # Es inminente que en San Luis atrasen una hora los relojes
 # (It is imminent in San Luis clocks one hour delay)
-# http://www.lagaceta.com.ar/nota/253414/Economia/Es-inminente-que-en-San-Luis-atrasen-una-hora-los-relojes.html
-# http://www.worldtimezone.net/dst_news/dst_news_argentina02.html
+# https://www.lagaceta.com.ar/nota/253414/Economia/Es-inminente-que-en-San-Luis-atrasen-una-hora-los-relojes.html
+# http://www.worldtimezone.com/dst_news/dst_news_argentina02.html
 
 # From Jesper Nørgaard Welen (2008-01-18):
 # The page of the San Luis provincial government
@@ -408,7 +408,7 @@
 # Perhaps San Luis operates on the legal fiction that it is at -04
 # with perpetual summer time, but ordinary usage typically seems to
 # just say it's at -03; see, for example,
-# http://es.wikipedia.org/wiki/Hora_oficial_argentina
+# https://es.wikipedia.org/wiki/Hora_oficial_argentina
 # We've documented similar situations as being plain changes to
 # standard time, so let's do that here too.  This does not change UTC
 # offsets, only tm_isdst and the time zone abbreviations.  One minor
@@ -739,7 +739,7 @@
 # (Portuguese)
 #
 # We have a written a short article about it as well:
-# http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
+# https://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
 #
 # From Alexander Krivenyshev (2011-10-04):
 # State Bahia will return to Daylight savings time this year after 8 years off.
@@ -748,7 +748,7 @@
 
 # In Portuguese:
 # http://g1.globo.com/bahia/noticia/2011/10/governador-jaques-wagner-confirma-horario-de-verao-na-bahia.html
-# http://noticias.terra.com.br/brasil/noticias/0,,OI5390887-EI8139,00-Bahia+volta+a+ter+horario+de+verao+apos+oito+anos.html
+# https://noticias.terra.com.br/brasil/noticias/0,,OI5390887-EI8139,00-Bahia+volta+a+ter+horario+de+verao+apos+oito+anos.html
 
 # From Guilherme Bernardes Rodrigues (2011-10-07):
 # There is news in the media, however there is still no decree about it.
@@ -774,16 +774,16 @@
 
 # From Rodrigo Severo (2012-10-16):
 # Tocantins state will have DST.
-# http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
+# https://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
 
 # From Steffen Thorsen (2013-09-20):
 # Tocantins in Brazil is very likely not to observe DST from October....
 # http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
 # We will keep this article updated when this is confirmed:
-# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
+# https://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
 
 # From Steffen Thorsen (2013-10-17):
-# http://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
+# https://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
 # Senator Jorge Viana announced that Acre will change time zone on November 10.
 # He did not specify the time of the change, nor if western parts of Amazonas
 # will change as well.
@@ -1099,18 +1099,18 @@
 # the following source, cited by Oscar van Vlijmen (2006-10-08):
 # [1] Chile Law
 # http://www.webexhibits.org/daylightsaving/chile.html
-# This contains a copy of a this official table:
+# This contains a copy of this official table:
 # Cambios en la hora oficial de Chile desde 1900 (retrieved 2008-03-30)
-# http://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
+# https://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
 # [1] needs several corrections, though.
 #
 # The first set of corrections is from:
 # [2] History of the Official Time of Chile
 # http://www.horaoficial.cl/ing/horaof_ing.html (retrieved 2012-03-06).  See:
-# http://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
+# https://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
 # This is an English translation of:
 # Historia de la hora oficial de Chile (retrieved 2012-10-24).  See:
-# http://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
+# https://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
 # A fancier Spanish version (requiring mouse-clicking) is at:
 # http://www.horaoficial.cl/historia_hora.html
 # Conflicts between [1] and [2] were resolved as follows:
@@ -1386,10 +1386,10 @@
 # Milne says the Central and South American Telegraph Company used -5:24:15.
 #
 # From Alois Treindl (2016-12-15):
-# http://www.elcomercio.com/actualidad/hora-sixto-1993.html
+# https://www.elcomercio.com/actualidad/hora-sixto-1993.html
 # ... Whether the law applied also to Galápagos, I do not know.
 # From Paul Eggert (2016-12-15):
-# http://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
+# https://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
 # This says President Sixto Durán Ballén signed decree No. 285, which
 # established DST from 1992-11-28 to 1993-02-05; it does not give transition
 # times.  The people called it "hora de Sixto" ("Sixto hour").  The change did
@@ -1801,7 +1801,7 @@
 # hours of presidential broadcasts, hours of lines,' quipped comedian
 # Jean Mary Curró ...". See: Cawthorne A, Kai D. Venezuela scraps
 # half-hour time difference set by Chavez. Reuters 2016-04-15 14:50 -0400
-# http://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
+# https://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
 #
 # From Matt Johnson (2016-04-20):
 # ... published in the official Gazette [2016-04-18], here:
--- a/make/data/tzdata/zone.tab	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/data/tzdata/zone.tab	Fri Nov 10 18:50:32 2017 +0100
@@ -209,7 +209,7 @@
 GD	+1203-06145	America/Grenada
 GE	+4143+04449	Asia/Tbilisi
 GF	+0456-05220	America/Cayenne
-GG	+4927-00232	Europe/Guernsey
+GG	+492717-0023210	Europe/Guernsey
 GH	+0533-00013	Africa/Accra
 GI	+3608-00521	Europe/Gibraltar
 GL	+6411-05144	America/Godthab	Greenland (most areas)
@@ -244,7 +244,7 @@
 IR	+3540+05126	Asia/Tehran
 IS	+6409-02151	Atlantic/Reykjavik
 IT	+4154+01229	Europe/Rome
-JE	+4912-00207	Europe/Jersey
+JE	+491101-0020624	Europe/Jersey
 JM	+175805-0764736	America/Jamaica
 JO	+3157+03556	Asia/Amman
 JP	+353916+1394441	Asia/Tokyo
--- a/make/mapfiles/libjava/mapfile-vers	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/mapfiles/libjava/mapfile-vers	Fri Nov 10 18:50:32 2017 +0100
@@ -130,8 +130,8 @@
 		Java_java_lang_ClassLoader_defineClass2;
 		Java_java_lang_ClassLoader_findBuiltinLib;
 		Java_java_lang_ClassLoader_findLoadedClass0;
-		Java_java_lang_ClassLoader_00024NativeLibrary_find;
-		Java_java_lang_ClassLoader_00024NativeLibrary_load;
+		Java_java_lang_ClassLoader_00024NativeLibrary_findEntry;
+		Java_java_lang_ClassLoader_00024NativeLibrary_load0;
 		Java_java_lang_ClassLoader_00024NativeLibrary_unload;
 		Java_java_lang_ClassLoader_registerNatives;
 		Java_java_lang_Double_longBitsToDouble;
--- a/make/mapfiles/libjava/reorder-sparc	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/mapfiles/libjava/reorder-sparc	Fri Nov 10 18:50:32 2017 +0100
@@ -48,8 +48,8 @@
 text: .text%Java_java_io_FileInputStream_close0;
 text: .text%Java_java_lang_System_mapLibraryName;
 text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
-text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load;
-text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_find;
+text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load0;
+text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_findEntry;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
 text: .text%Java_java_io_UnixFileSystem_list;
 text: .text%JNU_ClassString;
--- a/make/mapfiles/libjava/reorder-sparcv9	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/mapfiles/libjava/reorder-sparcv9	Fri Nov 10 18:50:32 2017 +0100
@@ -57,8 +57,8 @@
 text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
 text: .text%Java_java_lang_System_mapLibraryName;
-text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load;
-text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_find;
+text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load0;
+text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_findEntry;
 text: .text%Java_java_io_UnixFileSystem_getLength;
 text: .text%Java_java_lang_Object_getClass;
 text: .text%Java_java_lang_ClassLoader_defineClass0;
--- a/make/mapfiles/libjava/reorder-x86	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/mapfiles/libjava/reorder-x86	Fri Nov 10 18:50:32 2017 +0100
@@ -50,8 +50,8 @@
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
 text: .text%Java_java_lang_System_mapLibraryName;
 text: .text%cpchars: OUTPUTDIR/System.o;
-text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load;
-text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_find;
+text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load0;
+text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_findEntry;
 text: .text%Java_java_lang_Float_floatToRawIntBits;
 text: .text%Java_java_lang_Double_doubleToRawLongBits;
 text: .text%Java_java_io_FileInputStream_open0;
--- a/make/test/JtregNativeJdk.gmk	Mon Nov 06 20:03:58 2017 +0100
+++ b/make/test/JtregNativeJdk.gmk	Fri Nov 10 18:50:32 2017 +0100
@@ -44,6 +44,7 @@
 # Add more directories here when needed.
 BUILD_JDK_JTREG_NATIVE_SRC += \
     $(TOPDIR)/test/jdk/native_sanity \
+    $(TOPDIR)/test/jdk/java/lang/ClassLoader/nativeLibrary \
     $(TOPDIR)/test/jdk/java/lang/String/nativeEncoding \
     #
 
--- a/src/java.base/share/classes/java/io/ObjectInputFilter.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java	Fri Nov 10 18:50:32 2017 +0100
@@ -495,8 +495,8 @@
                         // Wildcard cases
                         if (p.endsWith(".*")) {
                             // Pattern is a package name with a wildcard
-                            final String pkg = p.substring(poffset, nameLen - 1);
-                            if (pkg.length() < 2) {
+                            final String pkg = p.substring(poffset, nameLen - 2);
+                            if (pkg.isEmpty()) {
                                 throw new IllegalArgumentException("package missing in: \"" + pattern + "\"");
                             }
                             if (negate) {
@@ -651,13 +651,12 @@
              * Returns {@code true} if the class is in the package.
              *
              * @param c   a class
-             * @param pkg a package name (including the trailing ".")
+             * @param pkg a package name
              * @return {@code true} if the class is in the package,
              * otherwise {@code false}
              */
             private static boolean matchesPackage(Class<?> c, String pkg) {
-                String n = c.getName();
-                return n.startsWith(pkg) && n.lastIndexOf('.') == pkg.length() - 1;
+                return pkg.equals(c.getPackageName());
             }
 
             /**
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1580,18 +1580,7 @@
      */
     private static boolean packageEquals(Class<?> cl1, Class<?> cl2) {
         return (cl1.getClassLoader() == cl2.getClassLoader() &&
-                getPackageName(cl1).equals(getPackageName(cl2)));
-    }
-
-    /**
-     * Returns package name of given class.
-     */
-    private static String getPackageName(Class<?> cl) {
-        String s = cl.getName();
-        int i = s.lastIndexOf('[');
-        i = (i < 0) ? 0 : i + 2;
-        int j = s.lastIndexOf('.');
-        return (i < j) ? s.substring(i, j) : "";
+                cl1.getPackageName().equals(cl2.getPackageName()));
     }
 
     /**
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Fri Nov 10 18:50:32 2017 +0100
@@ -37,17 +37,20 @@
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
 import java.security.cert.Certificate;
+import java.util.Arrays;
 import java.util.Collections;
+import java.util.Deque;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Hashtable;
+import java.util.LinkedList;
 import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Objects;
 import java.util.Set;
 import java.util.Spliterator;
 import java.util.Spliterators;
-import java.util.Stack;
 import java.util.Vector;
 import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
@@ -58,9 +61,9 @@
 import jdk.internal.perf.PerfCounter;
 import jdk.internal.loader.BootLoader;
 import jdk.internal.loader.ClassLoaders;
-import jdk.internal.misc.SharedSecrets;
 import jdk.internal.misc.Unsafe;
 import jdk.internal.misc.VM;
+import jdk.internal.ref.CleanerFactory;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 import sun.reflect.misc.ReflectUtil;
@@ -672,12 +675,11 @@
                 return;
             }
 
-            final String name = cls.getName();
-            final int i = name.lastIndexOf('.');
-            if (i != -1) {
+            final String packageName = cls.getPackageName();
+            if (!packageName.isEmpty()) {
                 AccessController.doPrivileged(new PrivilegedAction<>() {
                     public Void run() {
-                        sm.checkPackageAccess(name.substring(0, i));
+                        sm.checkPackageAccess(packageName);
                         return null;
                     }
                 }, new AccessControlContext(new ProtectionDomain[] {pd}));
@@ -2375,75 +2377,161 @@
      * @since    1.2
      */
     static class NativeLibrary {
+        // the class from which the library is loaded, also indicates
+        // the loader this native library belongs.
+        final Class<?> fromClass;
+        // the canonicalized name of the native library.
+        // or static library name
+        final String name;
+        // Indicates if the native library is linked into the VM
+        final boolean isBuiltin;
+
         // opaque handle to native library, used in native code.
         long handle;
         // the version of JNI environment the native library requires.
-        private int jniVersion;
-        // the class from which the library is loaded, also indicates
-        // the loader this native library belongs.
-        private Class<?> fromClass;
-        // the canonicalized name of the native library.
-        // or static library name
-        String name;
-        // Indicates if the native library is linked into the VM
-        boolean isBuiltin;
-        // Indicates if the native library is loaded
-        boolean loaded;
-        native void load(String name, boolean isBuiltin);
+        int jniVersion;
 
-        native long find(String name);
-        native void unload(String name, boolean isBuiltin);
+        native boolean load0(String name, boolean isBuiltin);
 
-        public NativeLibrary(Class<?> fromClass, String name, boolean isBuiltin) {
+        native long findEntry(String name);
+
+        NativeLibrary(Class<?> fromClass, String name, boolean isBuiltin) {
             this.name = name;
             this.fromClass = fromClass;
             this.isBuiltin = isBuiltin;
         }
 
-        @SuppressWarnings("deprecation")
-        protected void finalize() {
+        /*
+         * Loads the native library and registers for cleanup when its
+         * associated class loader is unloaded
+         */
+        boolean load() {
+            if (handle != 0) {
+                throw new InternalError("Native library " + name + " has been loaded");
+            }
+
+            if (!load0(name, isBuiltin)) return false;
+
+            // register the class loader for cleanup when unloaded
+            // built class loaders are never unloaded
+            ClassLoader loader = fromClass.getClassLoader();
+            if (loader != null &&
+                loader != getBuiltinPlatformClassLoader() &&
+                loader != getBuiltinAppClassLoader()) {
+                CleanerFactory.cleaner().register(loader,
+                        new Unloader(name, handle, isBuiltin));
+            }
+            return true;
+        }
+
+        static boolean loadLibrary(Class<?> fromClass, String name, boolean isBuiltin) {
+            ClassLoader loader =
+                fromClass == null ? null : fromClass.getClassLoader();
+
             synchronized (loadedLibraryNames) {
-                if (fromClass.getClassLoader() != null && loaded) {
-                    this.fromClass = null;   // no context when unloaded
+                Map<String, NativeLibrary> libs =
+                    loader != null ? loader.nativeLibraries() : systemNativeLibraries();
+                if (libs.containsKey(name)) {
+                    return true;
+                }
 
-                    /* remove the native library name */
-                    int size = loadedLibraryNames.size();
-                    for (int i = 0; i < size; i++) {
-                        if (name.equals(loadedLibraryNames.elementAt(i))) {
-                            loadedLibraryNames.removeElementAt(i);
-                            break;
+                if (loadedLibraryNames.contains(name)) {
+                    throw new UnsatisfiedLinkError("Native Library " + name +
+                        " already loaded in another classloader");
+                }
+
+                /*
+                 * When a library is being loaded, JNI_OnLoad function can cause
+                 * another loadLibrary invocation that should succeed.
+                 *
+                 * We use a static stack to hold the list of libraries we are
+                 * loading because this can happen only when called by the
+                 * same thread because Runtime.load and Runtime.loadLibrary
+                 * are synchronous.
+                 *
+                 * If there is a pending load operation for the library, we
+                 * immediately return success; otherwise, we raise
+                 * UnsatisfiedLinkError.
+                 */
+                for (NativeLibrary lib : nativeLibraryContext) {
+                    if (name.equals(lib.name)) {
+                        if (loader == lib.fromClass.getClassLoader()) {
+                            return true;
+                        } else {
+                            throw new UnsatisfiedLinkError("Native Library " +
+                                name + " is being loaded in another classloader");
                         }
                     }
-                    /* unload the library. */
-                    ClassLoader.nativeLibraryContext.push(this);
+                }
+                NativeLibrary lib = new NativeLibrary(fromClass, name, isBuiltin);
+                // load the native library
+                nativeLibraryContext.push(lib);
+                try {
+                    if (!lib.load()) return false;
+                } finally {
+                    nativeLibraryContext.pop();
+                }
+                // register the loaded native library
+                loadedLibraryNames.add(name);
+                libs.put(name, lib);
+            }
+            return true;
+        }
+
+        // Invoked in the VM to determine the context class in JNI_OnLoad
+        // and JNI_OnUnload
+        static Class<?> getFromClass() {
+            return nativeLibraryContext.peek().fromClass;
+        }
+
+        // native libraries being loaded
+        static Deque<NativeLibrary> nativeLibraryContext = new LinkedList<>();
+
+        /*
+         * The run() method will be invoked when this class loader becomes
+         * phantom reachable to unload the native library.
+         */
+        static class Unloader implements Runnable {
+            // This represents the context when a native library is unloaded
+            // and getFromClass() will return null,
+            static final NativeLibrary UNLOADER =
+                new NativeLibrary(null, "dummy", false);
+            final String name;
+            final long handle;
+            final boolean isBuiltin;
+
+            Unloader(String name, long handle, boolean isBuiltin) {
+                if (handle == 0) {
+                    throw new IllegalArgumentException(
+                        "Invalid handle for native library " + name);
+                }
+
+                this.name = name;
+                this.handle = handle;
+                this.isBuiltin = isBuiltin;
+            }
+
+            @Override
+            public void run() {
+                synchronized (loadedLibraryNames) {
+                    /* remove the native library name */
+                    loadedLibraryNames.remove(name);
+                    nativeLibraryContext.push(UNLOADER);
                     try {
-                        unload(name, isBuiltin);
+                        unload(name, isBuiltin, handle);
                     } finally {
-                        ClassLoader.nativeLibraryContext.pop();
+                        nativeLibraryContext.pop();
                     }
+
                 }
             }
         }
-        // Invoked in the VM to determine the context class in
-        // JNI_Load/JNI_Unload
-        static Class<?> getFromClass() {
-            return ClassLoader.nativeLibraryContext.peek().fromClass;
-        }
+
+        // JNI FindClass expects the caller class if invoked from JNI_OnLoad
+        // and JNI_OnUnload is NativeLibrary class
+        static native void unload(String name, boolean isBuiltin, long handle);
     }
 
-    // All native library names we've loaded.
-    private static Vector<String> loadedLibraryNames = new Vector<>();
-
-    // Native libraries belonging to system classes.
-    private static Vector<NativeLibrary> systemNativeLibraries
-        = new Vector<>();
-
-    // Native libraries associated with the class loader.
-    private Vector<NativeLibrary> nativeLibraries = new Vector<>();
-
-    // native libraries being loaded/unloaded.
-    private static Stack<NativeLibrary> nativeLibraryContext = new Stack<>();
-
     // The paths searched for libraries
     private static String usr_paths[];
     private static String sys_paths[];
@@ -2455,7 +2543,7 @@
         int psCount = 0;
 
         if (ClassLoaderHelper.allowsQuotedPathElements &&
-                ldPath.indexOf('\"') >= 0) {
+            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.
@@ -2465,7 +2553,7 @@
                 char ch = ldPath.charAt(i);
                 if (ch == '\"') {
                     while (++i < ldLen &&
-                            (ch = ldPath.charAt(i)) != '\"') {
+                        (ch = ldPath.charAt(i)) != '\"') {
                         buf[bufLen++] = ch;
                     }
                 } else {
@@ -2481,7 +2569,7 @@
             ps = '\"';
         } else {
             for (int i = ldPath.indexOf(ps); i >= 0;
-                    i = ldPath.indexOf(ps, i + 1)) {
+                 i = ldPath.indexOf(ps, i + 1)) {
                 psCount++;
             }
         }
@@ -2491,11 +2579,11 @@
         for (int j = 0; j < psCount; ++j) {
             int pathEnd = ldPath.indexOf(ps, pathStart);
             paths[j] = (pathStart < pathEnd) ?
-                    ldPath.substring(pathStart, pathEnd) : ".";
+                ldPath.substring(pathStart, pathEnd) : ".";
             pathStart = pathEnd + 1;
         }
         paths[psCount] = (pathStart < ldLen) ?
-                ldPath.substring(pathStart, ldLen) : ".";
+            ldPath.substring(pathStart, ldLen) : ".";
         return paths;
     }
 
@@ -2520,7 +2608,7 @@
                 File libfile = new File(libfilename);
                 if (!libfile.isAbsolute()) {
                     throw new UnsatisfiedLinkError(
-    "ClassLoader.findLibrary failed to return an absolute path: " + libfilename);
+                        "ClassLoader.findLibrary failed to return an absolute path: " + libfilename);
                 }
                 if (loadLibrary0(fromClass, libfile)) {
                     return;
@@ -2551,10 +2639,11 @@
             }
         }
         // Oops, it failed
-        throw new UnsatisfiedLinkError("no " + name + " in java.library.path");
+        throw new UnsatisfiedLinkError("no " + name +
+            " in java.library.path: " + Arrays.toString(usr_paths));
     }
 
-    static native String findBuiltinLib(String name);
+    private static native String findBuiltinLib(String name);
 
     private static boolean loadLibrary0(Class<?> fromClass, final File file) {
         // Check to see if we're attempting to access a static library
@@ -2575,85 +2664,72 @@
                 return false;
             }
         }
-        ClassLoader loader =
-            (fromClass == null) ? null : fromClass.getClassLoader();
-        Vector<NativeLibrary> libs =
-            loader != null ? loader.nativeLibraries : systemNativeLibraries;
-        synchronized (libs) {
-            int size = libs.size();
-            for (int i = 0; i < size; i++) {
-                NativeLibrary lib = libs.elementAt(i);
-                if (name.equals(lib.name)) {
-                    return true;
-                }
-            }
-
-            synchronized (loadedLibraryNames) {
-                if (loadedLibraryNames.contains(name)) {
-                    throw new UnsatisfiedLinkError
-                        ("Native Library " +
-                         name +
-                         " already loaded in another classloader");
-                }
-                /* If the library is being loaded (must be by the same thread,
-                 * because Runtime.load and Runtime.loadLibrary are
-                 * synchronous). The reason is can occur is that the JNI_OnLoad
-                 * function can cause another loadLibrary invocation.
-                 *
-                 * Thus we can use a static stack to hold the list of libraries
-                 * we are loading.
-                 *
-                 * If there is a pending load operation for the library, we
-                 * immediately return success; otherwise, we raise
-                 * UnsatisfiedLinkError.
-                 */
-                int n = nativeLibraryContext.size();
-                for (int i = 0; i < n; i++) {
-                    NativeLibrary lib = nativeLibraryContext.elementAt(i);
-                    if (name.equals(lib.name)) {
-                        if (loader == lib.fromClass.getClassLoader()) {
-                            return true;
-                        } else {
-                            throw new UnsatisfiedLinkError
-                                ("Native Library " +
-                                 name +
-                                 " is being loaded in another classloader");
-                        }
-                    }
-                }
-                NativeLibrary lib = new NativeLibrary(fromClass, name, isBuiltin);
-                nativeLibraryContext.push(lib);
-                try {
-                    lib.load(name, isBuiltin);
-                } finally {
-                    nativeLibraryContext.pop();
-                }
-                if (lib.loaded) {
-                    loadedLibraryNames.addElement(name);
-                    libs.addElement(lib);
-                    return true;
-                }
-                return false;
-            }
-        }
+        return NativeLibrary.loadLibrary(fromClass, name, isBuiltin);
     }
 
-    // Invoked in the VM class linking code.
-    static long findNative(ClassLoader loader, String name) {
-        Vector<NativeLibrary> libs =
-            loader != null ? loader.nativeLibraries : systemNativeLibraries;
-        synchronized (libs) {
-            int size = libs.size();
-            for (int i = 0; i < size; i++) {
-                NativeLibrary lib = libs.elementAt(i);
-                long entry = lib.find(name);
-                if (entry != 0)
-                    return entry;
-            }
+    /*
+     * Invoked in the VM class linking code.
+     */
+    private static long findNative(ClassLoader loader, String entryName) {
+        Map<String, NativeLibrary> libs =
+            loader != null ? loader.nativeLibraries() : systemNativeLibraries();
+        if (libs.isEmpty())
+            return 0;
+
+        // the native libraries map may be updated in another thread
+        // when a native library is being loaded.  No symbol will be
+        // searched from it yet.
+        for (NativeLibrary lib : libs.values()) {
+            long entry = lib.findEntry(entryName);
+            if (entry != 0) return entry;
         }
         return 0;
     }
 
+    // All native library names we've loaded.
+    // This also serves as the lock to obtain nativeLibraries
+    // and write to nativeLibraryContext.
+    private static final Set<String> loadedLibraryNames = new HashSet<>();
+
+    // Native libraries belonging to system classes.
+    private static volatile Map<String, NativeLibrary> systemNativeLibraries;
+
+    // Native libraries associated with the class loader.
+    private volatile Map<String, NativeLibrary> nativeLibraries;
+
+    /*
+     * Returns the native libraries map associated with bootstrap class loader
+     * This method will create the map at the first time when called.
+     */
+    private static Map<String, NativeLibrary> systemNativeLibraries() {
+        Map<String, NativeLibrary> libs = systemNativeLibraries;
+        if (libs == null) {
+            synchronized (loadedLibraryNames) {
+                libs = systemNativeLibraries;
+                if (libs == null) {
+                    libs = systemNativeLibraries = new ConcurrentHashMap<>();
+                }
+            }
+        }
+        return libs;
+    }
+
+    /*
+     * Returns the native libraries map associated with this class loader
+     * This method will create the map at the first time when called.
+     */
+    private Map<String, NativeLibrary> nativeLibraries() {
+        Map<String, NativeLibrary> libs = nativeLibraries;
+        if (libs == null) {
+            synchronized (loadedLibraryNames) {
+                libs = nativeLibraries;
+                if (libs == null) {
+                    libs = nativeLibraries = new ConcurrentHashMap<>();
+                }
+            }
+        }
+        return libs;
+    }
 
     // -- Assertion management --
 
--- a/src/java.base/share/classes/java/lang/Runtime.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/java/lang/Runtime.java	Fri Nov 10 18:50:32 2017 +0100
@@ -765,7 +765,9 @@
      * with the VM, then the JNI_OnLoad_L function exported by the library
      * is invoked rather than attempting to load a dynamic library.
      * A filename matching the argument does not have to exist in the file
-     * system. See the JNI Specification for more details.
+     * system.
+     * See the <a href="{@docRoot}/../specs/jni/index.html"> JNI Specification</a>
+     * for more details.
      *
      * Otherwise, the filename argument is mapped to a native library image in
      * an implementation-dependent manner.
@@ -818,7 +820,8 @@
      * specific prefix, file extension or path. If a native library
      * called {@code libname} is statically linked with the VM, then the
      * JNI_OnLoad_{@code libname} function exported by the library is invoked.
-     * See the JNI Specification for more details.
+     * See the <a href="{@docRoot}/../specs/jni/index.html"> JNI Specification</a>
+     * for more details.
      *
      * Otherwise, the libname argument is loaded from a system library
      * location and mapped to a native library image in an implementation-
--- a/src/java.base/share/classes/java/lang/System.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/java/lang/System.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1799,7 +1799,8 @@
      * is invoked rather than attempting to load a dynamic library.
      * A filename matching the argument does not have to exist in the
      * file system.
-     * See the JNI Specification for more details.
+     * See the <a href="{@docRoot}/../specs/jni/index.html"> JNI Specification</a>
+     * for more details.
      *
      * Otherwise, the filename argument is mapped to a native library image in
      * an implementation-dependent manner.
@@ -1835,7 +1836,8 @@
      * specific prefix, file extension or path. If a native library
      * called <code>libname</code> is statically linked with the VM, then the
      * JNI_OnLoad_<code>libname</code> function exported by the library is invoked.
-     * See the JNI Specification for more details.
+     * See the <a href="{@docRoot}/../specs/jni/index.html"> JNI Specification</a>
+     * for more details.
      *
      * Otherwise, the libname argument is loaded from a system library
      * location and mapped to a native library image in an implementation-
--- a/src/java.base/share/classes/java/lang/reflect/Proxy.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/java/lang/reflect/Proxy.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1034,11 +1034,8 @@
 
                 // do permission check if the caller is in a different runtime package
                 // of the proxy class
-                int n = proxyClass.getName().lastIndexOf('.');
-                String pkg = (n == -1) ? "" : proxyClass.getName().substring(0, n);
-
-                n = caller.getName().lastIndexOf('.');
-                String callerPkg = (n == -1) ? "" : caller.getName().substring(0, n);
+                String pkg = proxyClass.getPackageName();
+                String callerPkg = caller.getPackageName();
 
                 if (pcl != ccl || !pkg.equals(callerPkg)) {
                     sm.checkPermission(new ReflectPermission("newProxyInPackage." + pkg));
--- a/src/java.base/share/classes/java/time/format/ZoneName.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/java/time/format/ZoneName.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, 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
@@ -192,7 +192,7 @@
         "Africa/Ndjamena", "Africa_Western", "Africa/Lagos",
         "Asia/Macau", "China", "Asia/Shanghai",
         "America/Lima", "Peru", "America/Lima",
-        "Africa/Windhoek", "Africa_Western", "Africa/Lagos",
+        "Africa/Windhoek", "Africa_Central", "Africa/Maputo",
         "America/Sitka", "Alaska", "America/Juneau",
         "America/Mazatlan", "America_Mountain", "America/Denver",
         "Asia/Saigon", "Indochina", "Asia/Saigon",
@@ -324,7 +324,7 @@
         "Atlantic/Faroe", "Europe_Western", "Atlantic/Canary",
         "America/Cambridge_Bay", "America_Mountain", "America/Denver",
         "America/Los_Angeles", "America_Pacific", "America/Los_Angeles",
-        "Africa/Khartoum", "Africa_Eastern", "Africa/Nairobi",
+        "Africa/Khartoum", "Africa_Central", "Africa/Maputo",
         "Europe/Simferopol", "Europe_Eastern", "Europe/Bucharest",
         "Australia/Currie", "Australia_Eastern", "Australia/Sydney",
         "Europe/Guernsey", "GMT", "Atlantic/Reykjavik",
@@ -744,7 +744,6 @@
         "UTC", "Etc/UTC",
         "Canada/Newfoundland", "America/St_Johns",
         "Europe/Skopje", "Europe/Belgrade",
-        "Canada/East-Saskatchewan", "America/Regina",
         "PRC", "Asia/Shanghai",
         "UCT", "Etc/UCT",
         "America/Mendoza", "America/Argentina/Mendoza",
--- a/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java	Fri Nov 10 18:50:32 2017 +0100
@@ -695,8 +695,9 @@
      * stale pointer that is now off the list.
      */
     final Node<E> pred(Node<E> p) {
-        Node<E> q = p.prev;
-        return (p == q) ? last() : q;
+        if (p == (p = p.prev))
+            p = last();
+        return p;
     }
 
     /**
@@ -867,31 +868,31 @@
 
     public E peekFirst() {
         restart: for (;;) {
-            for (Node<E> first = first(), p = first;;) {
-                final E item;
-                if ((item = p.item) != null) {
-                    // recheck for linearizability
-                    if (first.prev != null) continue restart;
-                    return item;
-                }
-                if ((p = succ(p)) == null)
-                    return null;
+            E item;
+            Node<E> first = first(), p = first;
+            while ((item = p.item) == null) {
+                if (p == (p = p.next)) continue restart;
+                if (p == null)
+                    break;
             }
+            // recheck for linearizability
+            if (first.prev != null) continue restart;
+            return item;
         }
     }
 
     public E peekLast() {
         restart: for (;;) {
-            for (Node<E> last = last(), p = last;;) {
-                final E item;
-                if ((item = p.item) != null) {
-                    // recheck for linearizability
-                    if (last.next != null) continue restart;
-                    return item;
-                }
-                if ((p = pred(p)) == null)
-                    return null;
+            E item;
+            Node<E> last = last(), p = last;
+            while ((item = p.item) == null) {
+                if (p == (p = p.prev)) continue restart;
+                if (p == null)
+                    break;
             }
+            // recheck for linearizability
+            if (last.next != null) continue restart;
+            return item;
         }
     }
 
@@ -921,8 +922,11 @@
                         return item;
                     }
                 }
-                if ((p = succ(p)) == null)
+                if (p == (p = p.next)) continue restart;
+                if (p == null) {
+                    if (first.prev != null) continue restart;
                     return null;
+                }
             }
         }
     }
@@ -939,8 +943,11 @@
                         return item;
                     }
                 }
-                if ((p = pred(p)) == null)
+                if (p == (p = p.prev)) continue restart;
+                if (p == null) {
+                    if (last.next != null) continue restart;
                     return null;
+                }
             }
         }
     }
--- a/src/java.base/share/classes/jdk/internal/misc/InnocuousThread.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/jdk/internal/misc/InnocuousThread.java	Fri Nov 10 18:50:32 2017 +0100
@@ -62,10 +62,16 @@
      * set to the system class loader.
      */
     public static Thread newThread(String name, Runnable target) {
-        return new InnocuousThread(INNOCUOUSTHREADGROUP,
-                                   target,
-                                   name,
-                                   ClassLoader.getSystemClassLoader());
+        return AccessController.doPrivileged(
+                new PrivilegedAction<Thread>() {
+                    @Override
+                    public Thread run() {
+                        return new InnocuousThread(INNOCUOUSTHREADGROUP,
+                                                   target,
+                                                   name,
+                                                   ClassLoader.getSystemClassLoader());
+                    }
+                });
     }
 
     /**
@@ -80,8 +86,14 @@
      * Returns a new InnocuousThread with null context class loader.
      */
     public static Thread newSystemThread(String name, Runnable target) {
-        return new InnocuousThread(INNOCUOUSTHREADGROUP,
-                                   target, name, null);
+        return AccessController.doPrivileged(
+                new PrivilegedAction<Thread>() {
+                    @Override
+                    public Thread run() {
+                        return new InnocuousThread(INNOCUOUSTHREADGROUP,
+                                                   target, name, null);
+                    }
+                });
     }
 
     private InnocuousThread(ThreadGroup group, Runnable target, String name, ClassLoader tccl) {
--- a/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java	Fri Nov 10 18:50:32 2017 +0100
@@ -332,16 +332,6 @@
         return Objects.equals(class1.getPackageName(), class2.getPackageName());
     }
 
-    /** Return the package name for this class.
-     */
-    public static String getPackageName(Class<?> cls) {
-        assert (!cls.isArray());
-        String name = cls.getName();
-        int dot = name.lastIndexOf('.');
-        if (dot < 0) return "";
-        return name.substring(0, dot);
-    }
-
     /**
      * Test if two classes are defined as part of the same package member (top-level class).
      * If this is true, they can share private access with each other.
--- a/src/java.base/share/classes/sun/nio/ch/IOUtil.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/sun/nio/ch/IOUtil.java	Fri Nov 10 18:50:32 2017 +0100
@@ -297,7 +297,7 @@
                      NativeDispatcher nd)
         throws IOException
     {
-        return read(fd, bufs, offset, bufs.length, false, -1, nd);
+        return read(fd, bufs, offset, length, false, -1, nd);
     }
 
     static long read(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
--- a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, 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
@@ -349,7 +349,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -374,7 +374,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -777,7 +777,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/java.base/share/native/libjava/ClassLoader.c	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.base/share/native/libjava/ClassLoader.c	Fri Nov 10 18:50:32 2017 +0100
@@ -260,7 +260,6 @@
 
 static jfieldID handleID;
 static jfieldID jniVersionID;
-static jfieldID loadedID;
 static void *procHandle;
 
 static jboolean initIDs(JNIEnv *env)
@@ -276,9 +275,6 @@
         jniVersionID = (*env)->GetFieldID(env, this, "jniVersion", "I");
         if (jniVersionID == 0)
             return JNI_FALSE;
-        loadedID = (*env)->GetFieldID(env, this, "loaded", "Z");
-        if (loadedID == 0)
-             return JNI_FALSE;
         procHandle = getProcessHandle();
     }
     return JNI_TRUE;
@@ -335,30 +331,31 @@
 
 /*
  * Class:     java_lang_ClassLoader_NativeLibrary
- * Method:    load
- * Signature: (Ljava/lang/String;Z)V
+ * Method:    load0
+ * Signature: (Ljava/lang/String;Z)Z
  */
-JNIEXPORT void JNICALL
-Java_java_lang_ClassLoader_00024NativeLibrary_load
+JNIEXPORT jboolean JNICALL
+Java_java_lang_ClassLoader_00024NativeLibrary_load0
   (JNIEnv *env, jobject this, jstring name, jboolean isBuiltin)
 {
     const char *cname;
     jint jniVersion;
     jthrowable cause;
     void * handle;
+    jboolean loaded = JNI_FALSE;
 
     if (!initIDs(env))
-        return;
+        return JNI_FALSE;
 
     cname = JNU_GetStringPlatformChars(env, name, 0);
     if (cname == 0)
-        return;
+        return JNI_FALSE;
     handle = isBuiltin ? procHandle : JVM_LoadLibrary(cname);
     if (handle) {
         JNI_OnLoad_t JNI_OnLoad;
         JNI_OnLoad = (JNI_OnLoad_t)findJniFunction(env, handle,
-                                               isBuiltin ? cname : NULL,
-                                               JNI_TRUE);
+                                                   isBuiltin ? cname : NULL,
+                                                   JNI_TRUE);
         if (JNI_OnLoad) {
             JavaVM *jvm;
             (*env)->GetJavaVM(env, &jvm);
@@ -400,20 +397,21 @@
         goto done;
     }
     (*env)->SetLongField(env, this, handleID, ptr_to_jlong(handle));
-    (*env)->SetBooleanField(env, this, loadedID, JNI_TRUE);
+    loaded = JNI_TRUE;
 
  done:
     JNU_ReleaseStringPlatformChars(env, name, cname);
+    return loaded;
 }
 
 /*
  * Class:     java_lang_ClassLoader_NativeLibrary
  * Method:    unload
- * Signature: (Z)V
+ * Signature: (Ljava/lang/String;ZJ)V
  */
 JNIEXPORT void JNICALL
 Java_java_lang_ClassLoader_00024NativeLibrary_unload
-(JNIEnv *env, jobject this, jstring name, jboolean isBuiltin)
+(JNIEnv *env, jclass cls, jstring name, jboolean isBuiltin, jlong address)
 {
     const char *onUnloadSymbols[] = JNI_ONUNLOAD_SYMBOLS;
     void *handle;
@@ -426,10 +424,10 @@
     if (cname == NULL) {
         return;
     }
-    handle = jlong_to_ptr((*env)->GetLongField(env, this, handleID));
+    handle = jlong_to_ptr(address);
     JNI_OnUnload = (JNI_OnUnload_t )findJniFunction(env, handle,
-                                                isBuiltin ? cname : NULL,
-                                                JNI_FALSE);
+                                                    isBuiltin ? cname : NULL,
+                                                    JNI_FALSE);
     if (JNI_OnUnload) {
         JavaVM *jvm;
         (*env)->GetJavaVM(env, &jvm);
@@ -443,11 +441,11 @@
 
 /*
  * Class:     java_lang_ClassLoader_NativeLibrary
- * Method:    find
+ * Method:    findEntry
  * Signature: (Ljava/lang/String;)J
  */
 JNIEXPORT jlong JNICALL
-Java_java_lang_ClassLoader_00024NativeLibrary_find
+Java_java_lang_ClassLoader_00024NativeLibrary_findEntry
   (JNIEnv *env, jobject this, jstring name)
 {
     jlong handle;
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriteParam.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriteParam.java	Fri Nov 10 18:50:32 2017 +0100
@@ -62,8 +62,6 @@
  * <tr>
  * <td>ZLib</td>
  * <td>"Deflate/Inflate" compression (see note following this table)</td>
- * <td><a href="http://partners.adobe.com/asn/developer/pdfs/tn/TIFFphotoshop.pdf">
- * Adobe Photoshop&#174; TIFF Technical Notes</a> (PDF)</td>
  * </tr>
  * <tr>
  * <td>PackBits</td>
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html	Fri Nov 10 18:50:32 2017 +0100
@@ -539,8 +539,6 @@
 <tr>
 <td>ZLib</td>
 <td>"Deflate/Inflate" compression (see note following this table)</td>
-<td><a href="http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf">
-Adobe Photoshop&#174; TIFF Technical Notes</a> (PDF)</td>
 </tr>
 <tr>
 <td>PackBits</td>
--- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java	Fri Nov 10 18:50:32 2017 +0100
@@ -56,7 +56,7 @@
  * </ul>
  *
  * @since 9
- * @see   <a href="http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">  TIFF 6.0 Specification</a>
+ * @see   <a href="https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf">  TIFF 6.0 Specification</a>
  */
 public final class BaselineTIFFTagSet extends TIFFTagSet {
 
@@ -201,7 +201,6 @@
      * A value to be used with the "Compression" tag.
      *
      * @see #TAG_COMPRESSION
-     * @see <a href="http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf">TIFF Specification Supplement 2</a>
      */
     public static final int COMPRESSION_JPEG = 7;
 
@@ -209,7 +208,6 @@
      * A value to be used with the "Compression" tag.
      *
      * @see #TAG_COMPRESSION
-     * @see <a href="http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf"> TIFF Specification Supplement 2</a>
      */
     public static final int COMPRESSION_ZLIB = 8;
 
@@ -225,7 +223,6 @@
      *
      * @see #TAG_COMPRESSION
      * @see <a href="https://tools.ietf.org/html/rfc1951">DEFLATE specification</a>
-     * @see <a href="http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf"> TIFF Specification Supplement 2</a>
      */
     public static final int COMPRESSION_DEFLATE = 32946;
 
@@ -303,7 +300,6 @@
      * A value to be used with the "PhotometricInterpretation" tag.
      *
      * @see #TAG_PHOTOMETRIC_INTERPRETATION
-     * @see <a href="http://partners.adobe.com/public/developer/en/tiff/TIFFPM6.pdf">TIFF Specification Supplement 1</a>
      */
     public static final int PHOTOMETRIC_INTERPRETATION_ICCLAB = 9;
 
@@ -898,7 +894,6 @@
     /**
      * Constant specifying the "JPEGTables" tag.
      *
-     * @see <a href="http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf">TIFF Specification Supplement 2</a>
      * @see <a href="ftp://ftp.sgi.com/graphics/tiff/TTN2.draft.txt">JPEG-in-TIFF compression</a>
      */
     public static final int TAG_JPEG_TABLES = 347;
--- a/src/java.desktop/windows/native/libawt/windows/awt_BitmapUtil.cpp	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.desktop/windows/native/libawt/windows/awt_BitmapUtil.cpp	Fri Nov 10 18:50:32 2017 +0100
@@ -246,17 +246,28 @@
     UINT height = abs(bi.bmiHeader.biHeight);
 
     BYTE * buf = (BYTE*)safe_Malloc(bi.bmiHeader.biSizeImage);
+    if (!buf) {
+        ::DeleteDC(hdc);
+        return NULL;
+    }
     bi.bmiHeader.biHeight = -(INT)height;
     ::GetDIBits(hdc, hBitmap, 0, height, buf,
             reinterpret_cast<BITMAPINFO*>(&bi), DIB_RGB_COLORS);
 
     /* reserving memory for the worst case */
     if (!IS_SAFE_SIZE_MUL(width / 2 + 1, height)) {
-        throw std::bad_alloc();
+        ::DeleteDC(hdc);
+        free(buf);
+        return NULL;
     }
     RGNDATA * pRgnData = (RGNDATA *) SAFE_SIZE_STRUCT_ALLOC(safe_Malloc,
             sizeof(RGNDATAHEADER),
             sizeof(RECT), (width / 2 + 1) * height);
+    if (!pRgnData) {
+        ::DeleteDC(hdc);
+        free(buf);
+        return NULL;
+    }
     RGNDATAHEADER * pRgnHdr = (RGNDATAHEADER *) pRgnData;
     pRgnHdr->dwSize = sizeof(RGNDATAHEADER);
     pRgnHdr->iType = RDH_RECTANGLES;
@@ -309,6 +320,10 @@
     UINT height = abs(bi.bmiHeader.biHeight);
 
     BYTE * buf = (BYTE*)safe_Malloc(bi.bmiHeader.biSizeImage);
+    if (!buf) {
+        ::DeleteDC(hdc);
+        return NULL;
+    }
     bi.bmiHeader.biHeight = -(INT)height;
     ::GetDIBits(hdc, hSrcBitmap, 0, height, buf,
             reinterpret_cast<BITMAPINFO*>(&bi), DIB_RGB_COLORS);
--- a/src/java.logging/share/classes/java/util/logging/FileHandler.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.logging/share/classes/java/util/logging/FileHandler.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, 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
@@ -616,79 +616,96 @@
      * @throws IOException
      */
     private File generate(String pattern, int generation, int unique)
-            throws IOException {
-        File file = null;
-        String word = "";
-        int ix = 0;
+            throws IOException
+    {
+        return generate(pattern, count, generation, unique);
+    }
+
+    // The static method here is provided for whitebox testing of the algorithm.
+    static File generate(String pat, int count, int generation, int unique)
+            throws IOException
+    {
+        Path path = Paths.get(pat);
+        Path result = null;
         boolean sawg = false;
         boolean sawu = false;
-        while (ix < pattern.length()) {
-            char ch = pattern.charAt(ix);
-            ix++;
-            char ch2 = 0;
-            if (ix < pattern.length()) {
-                ch2 = Character.toLowerCase(pattern.charAt(ix));
+        StringBuilder word = new StringBuilder();
+        Path prev = null;
+        for (Path elem : path) {
+            if (prev != null) {
+                prev = prev.resolveSibling(word.toString());
+                result = result == null ? prev : result.resolve(prev);
             }
-            if (ch == '/') {
-                if (file == null) {
-                    file = new File(word);
-                } else {
-                    file = new File(file, word);
+            String pattern = elem.toString();
+            int ix = 0;
+            word.setLength(0);
+            while (ix < pattern.length()) {
+                char ch = pattern.charAt(ix);
+                ix++;
+                char ch2 = 0;
+                if (ix < pattern.length()) {
+                    ch2 = Character.toLowerCase(pattern.charAt(ix));
                 }
-                word = "";
-                continue;
-            } else  if (ch == '%') {
-                if (ch2 == 't') {
-                    String tmpDir = System.getProperty("java.io.tmpdir");
-                    if (tmpDir == null) {
-                        tmpDir = System.getProperty("user.home");
+                if (ch == '%') {
+                    if (ch2 == 't') {
+                        String tmpDir = System.getProperty("java.io.tmpdir");
+                        if (tmpDir == null) {
+                            tmpDir = System.getProperty("user.home");
+                        }
+                        result = Paths.get(tmpDir);
+                        ix++;
+                        word.setLength(0);
+                        continue;
+                    } else if (ch2 == 'h') {
+                        result = Paths.get(System.getProperty("user.home"));
+                        if (jdk.internal.misc.VM.isSetUID()) {
+                            // Ok, we are in a set UID program.  For safety's sake
+                            // we disallow attempts to open files relative to %h.
+                            throw new IOException("can't use %h in set UID program");
+                        }
+                        ix++;
+                        word.setLength(0);
+                        continue;
+                    } else if (ch2 == 'g') {
+                        word = word.append(generation);
+                        sawg = true;
+                        ix++;
+                        continue;
+                    } else if (ch2 == 'u') {
+                        word = word.append(unique);
+                        sawu = true;
+                        ix++;
+                        continue;
+                    } else if (ch2 == '%') {
+                        word = word.append('%');
+                        ix++;
+                        continue;
                     }
-                    file = new File(tmpDir);
-                    ix++;
-                    word = "";
-                    continue;
-                } else if (ch2 == 'h') {
-                    file = new File(System.getProperty("user.home"));
-                    if (jdk.internal.misc.VM.isSetUID()) {
-                        // Ok, we are in a set UID program.  For safety's sake
-                        // we disallow attempts to open files relative to %h.
-                        throw new IOException("can't use %h in set UID program");
-                    }
-                    ix++;
-                    word = "";
-                    continue;
-                } else if (ch2 == 'g') {
-                    word = word + generation;
-                    sawg = true;
-                    ix++;
-                    continue;
-                } else if (ch2 == 'u') {
-                    word = word + unique;
-                    sawu = true;
-                    ix++;
-                    continue;
-                } else if (ch2 == '%') {
-                    word = word + "%";
-                    ix++;
-                    continue;
                 }
+                word = word.append(ch);
             }
-            word = word + ch;
+            prev = elem;
         }
+
         if (count > 1 && !sawg) {
-            word = word + "." + generation;
+            word = word.append('.').append(generation);
         }
         if (unique > 0 && !sawu) {
-            word = word + "." + unique;
+            word = word.append('.').append(unique);
         }
         if (word.length() > 0) {
-            if (file == null) {
-                file = new File(word);
-            } else {
-                file = new File(file, word);
-            }
+            String n = word.toString();
+            Path p = prev == null ? Paths.get(n) : prev.resolveSibling(n);
+            result = result == null ? p : result.resolve(p);
+        } else if (result == null) {
+            result = Paths.get("");
         }
-        return file;
+
+        if (path.getRoot() == null) {
+            return result.toFile();
+        } else {
+            return path.getRoot().resolve(result).toFile();
+        }
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java	Fri Nov 10 18:50:32 2017 +0100
@@ -946,7 +946,7 @@
           if (debug)
             debug_message("# Pop stack by one, state was # " +
                           (stack.peek()).parse_state);
-          left_pos = ((Symbol)stack.pop()).left;
+          left_pos = stack.pop().left;
           tos--;
 
           /* if we have hit bottom, we fail */
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -616,7 +616,7 @@
     public static boolean leapYear()
     {
       Calendar cal = Calendar.getInstance();
-      int yr = (int)cal.get(Calendar.YEAR);
+      int yr = cal.get(Calendar.YEAR);
       return (yr % 400 == 0 || (yr % 100 != 0 && yr % 4 == 0));
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -115,7 +115,7 @@
         final List<SyntaxTreeNode> contents = getContents();
         final int count = contents.size();
         for (int i=0; i<count; i++) {
-            SyntaxTreeNode child = (SyntaxTreeNode)contents.get(i);
+            SyntaxTreeNode child = contents.get(i);
             if (child instanceof XslAttribute) {
                 parser.getSymbolTable().setCurrentNode(child);
                 child.parseContents(parser);
@@ -184,7 +184,7 @@
         // Translate all local attributes
         final Iterator<SyntaxTreeNode> attributes = elements();
         while (attributes.hasNext()) {
-            SyntaxTreeNode element = (SyntaxTreeNode)attributes.next();
+            SyntaxTreeNode element = attributes.next();
             if (element instanceof XslAttribute) {
                 final XslAttribute attribute = (XslAttribute)element;
                 attribute.translate(classGen, methodGen);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -83,11 +83,11 @@
                                               new MethodType(Type.Void,
                                                              tleft, tright));
         if (ptype != null) {
-            final Type arg1 = (Type) ptype.argsType().get(0);
+            final Type arg1 = ptype.argsType().get(0);
             if (!arg1.identicalTo(tleft)) {
                 _left = new CastExpr(_left, arg1);
             }
-            final Type arg2 = (Type) ptype.argsType().get(1);
+            final Type arg2 = ptype.argsType().get(1);
             if (!arg2.identicalTo(tright)) {
                 _right = new CastExpr(_right, arg1);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -75,7 +75,7 @@
         if (_predicates != null) {
             final int n = _predicates.size();
             for (int i = 0; i < n; i++) {
-                final Expression exp = (Expression)_predicates.get(i);
+                final Expression exp = _predicates.get(i);
                 exp.setParser(parser);
                 exp.setParent(this);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -53,7 +53,7 @@
      */
     public FunctionAvailableCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
-        _arg = (Expression)arguments.get(0);
+        _arg = arguments.get(0);
         _type = null;
 
         if (_arg instanceof LiteralExpr) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -443,7 +443,7 @@
 
         if (ptype != null) {
             for (int i = 0; i < n; i++) {
-                final Type argType = (Type) ptype.argsType().get(i);
+                final Type argType = ptype.argsType().get(i);
                 final Expression exp = _arguments.get(i);
                 if (!argType.identicalTo(exp.getType())) {
                     try {
@@ -557,7 +557,7 @@
                     hasThisArgument = true;
 
                 Expression firstArg = _arguments.get(0);
-                Type firstArgType = (Type)firstArg.typeCheck(stable);
+                Type firstArgType = firstArg.typeCheck(stable);
 
                 if (_namespace_format == NAMESPACE_FORMAT_CLASS
                     && firstArgType instanceof ObjectType
@@ -608,7 +608,7 @@
         _type = null;                       // reset internal type
         for (int j, i = 0; i < nMethods; i++) {
             // Check if all paramteters to this method can be converted
-            final Method method = (Method)methods.get(i);
+            final Method method = methods.get(i);
             final Class<?>[] paramTypes = method.getParameterTypes();
 
             int currMethodDistance = 0;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -137,11 +137,11 @@
         // Yes, the operation is supported
         if (haveType != null) {
             // Check if left-hand side operand must be type casted
-            Type arg1 = (Type)haveType.argsType().get(0);
+            Type arg1 = haveType.argsType().get(0);
             if (!arg1.identicalTo(tleft))
                 _left = new CastExpr(_left, arg1);
             // Check if right-hand side operand must be type casted
-            Type arg2 = (Type) haveType.argsType().get(1);
+            Type arg2 = haveType.argsType().get(1);
             if (!arg2.identicalTo(tright))
                 _right = new CastExpr(_right, arg1);
             // Return the result type for the operator we will use
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Message.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Message.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -67,7 +67,7 @@
                 il.append(new PUSH(cpg, ""));
             break;
             case 1:
-                SyntaxTreeNode child = (SyntaxTreeNode) elementAt(0);
+                SyntaxTreeNode child = elementAt(0);
                 if (child instanceof Text) {
                     il.append(new PUSH(cpg, ((Text) child).getText()));
                     break;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -229,12 +229,12 @@
     }
 
     private int partition(List<Template> templates, int p, int r) {
-        final Template x = (Template)templates.get(p);
+        final Template x = templates.get(p);
         int i = p - 1;
         int j = r + 1;
         while (true) {
-            while (x.compareTo((Template)templates.get(--j)) > 0);
-            while (x.compareTo((Template)templates.get(++i)) < 0);
+            while (x.compareTo(templates.get(--j)) > 0);
+            while (x.compareTo(templates.get(++i)) < 0);
             if (i < j) {
                 templates.set(j, templates.set(i, templates.get(j)));
             }
@@ -366,7 +366,7 @@
             boolean inserted = false;
             for (int i = 0; i < patterns.size(); i++) {
                 final LocationPathPattern lppToCompare =
-                    (LocationPathPattern)patterns.get(i);
+                    patterns.get(i);
 
                 if (pattern.noSmallerThan(lppToCompare)) {
                     inserted = true;
@@ -1136,7 +1136,7 @@
         final boolean[] isAttribute = new boolean[types.length];
         final boolean[] isNamespace = new boolean[types.length];
         for (int i = 0; i < names.size(); i++) {
-            final String name = (String)names.get(i);
+            final String name = names.get(i);
             isAttribute[i+DTM.NTYPES] = isAttributeName(name);
             isNamespace[i+DTM.NTYPES] = isNamespaceName(name);
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -481,7 +481,7 @@
 
         // Initialize closure variables
         for (int i = 0; i < closureLen; i++) {
-            final VariableRefBase varRef = (VariableRefBase) _closureVars.get(i);
+            final VariableRefBase varRef = _closureVars.get(i);
             final VariableBase var = varRef.getVariable();
             final Type varType = var.getType();
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -433,7 +433,7 @@
             reader.setContentHandler(this);
             reader.parse(input);
             // Find the start of the stylesheet within the tree
-            return (SyntaxTreeNode)getStylesheet(_root);
+            return getStylesheet(_root);
         }
         catch (IOException e) {
             if (_xsltc.debug()) e.printStackTrace();
@@ -668,7 +668,7 @@
         else
             source = new InputSource(location);
 
-        SyntaxTreeNode external = (SyntaxTreeNode)parse(source);
+        SyntaxTreeNode external = parse(source);
         return(external);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -419,7 +419,7 @@
         final List<VariableRefBase> dups = new ArrayList<>();
 
         for (int j = 0; j < nsorts; j++) {
-            final Sort sort = (Sort) sortObjects.get(j);
+            final Sort sort = sortObjects.get(j);
             final int length = (sort._closureVars == null) ? 0 :
                 sort._closureVars.size();
 
@@ -553,7 +553,7 @@
         // Initialize closure in record class
         final int ndups = dups.size();
         for (int i = 0; i < ndups; i++) {
-            final VariableRefBase varRef = (VariableRefBase) dups.get(i);
+            final VariableRefBase varRef = dups.get(i);
             final VariableBase var = varRef.getVariable();
             final Type varType = var.getType();
 
@@ -617,7 +617,7 @@
             final int length = (sort._closureVars == null) ? 0 :
                 sort._closureVars.size();
             for (int i = 0; i < length; i++) {
-                final VariableRefBase varRef = (VariableRefBase) sort._closureVars.get(i);
+                final VariableRefBase varRef = sort._closureVars.get(i);
 
                 // Discard duplicate variable references
                 if (dups.contains(varRef)) continue;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -856,7 +857,7 @@
      */
     protected final SyntaxTreeNode lastChild() {
         if (_contents.isEmpty()) return null;
-        return (SyntaxTreeNode)_contents.get(_contents.size() - 1);
+        return _contents.get(_contents.size() - 1);
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -191,7 +191,7 @@
      * (e.g. match="A/B | A/C").
      */
     private InstructionHandle getTemplateHandle(Template template) {
-        return (InstructionHandle)_mode.getTemplateInstructionHandle(template);
+        return _mode.getTemplateInstructionHandle(template);
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -60,7 +60,7 @@
         final List<Expression> components = new ArrayList<>();
         flatten(components);
         final int size = components.size();
-        _components = (Expression[])components.toArray(new Expression[size]);
+        _components = components.toArray(new Expression[size]);
         for (int i = 0; i < size; i++) {
             _components[i].setParser(parser);
             _components[i].setParent(this);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1311,7 +1311,7 @@
               QName RESULT = null;
                 int qnameleft = (parser_stack.get(parser_top-0)).left;
                 int qnameright = (parser_stack.get(parser_top-0)).right;
-                String qname = (String)((Symbol) parser_stack.get(parser_top-0)).value;
+                String qname = (String)(parser_stack.get(parser_top-0)).value;
                  RESULT = parser.getQNameIgnoreDefaultNs(qname);
               parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1323,7 +1323,7 @@
               Object RESULT = null;
                 int qnleft = (parser_stack.get(parser_top-0)).left;
                 int qnright = (parser_stack.get(parser_top-0)).right;
-                QName qn = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
+                QName qn = (QName)(parser_stack.get(parser_top-0)).value;
                  RESULT = qn;
               parser_result = new Symbol(26/*NameTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1353,7 +1353,7 @@
               Object RESULT = null;
                 int lleft = (parser_stack.get(parser_top-1)).left;
                 int lright = (parser_stack.get(parser_top-1)).right;
-                String l = (String)((Symbol) parser_stack.get(parser_top-1)).value;
+                String l = (String)(parser_stack.get(parser_top-1)).value;
 
            QName name = parser.getQNameIgnoreDefaultNs("name");
            Expression exp = new EqualityExpr(Operators.EQ,
@@ -1400,7 +1400,7 @@
               Object RESULT = null;
                 int ntleft = (parser_stack.get(parser_top-0)).left;
                 int ntright = (parser_stack.get(parser_top-0)).right;
-                Object nt = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
+                Object nt = parser_stack.get(parser_top-0).value;
                  RESULT = nt;
               parser_result = new Symbol(25/*NodeTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1412,7 +1412,7 @@
               Expression RESULT = null;
                 int exleft = (parser_stack.get(parser_top-0)).left;
                 int exright = (parser_stack.get(parser_top-0)).right;
-                Expression ex = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ex = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ex;
               parser_result = new Symbol(3/*Argument*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1424,7 +1424,7 @@
               QName RESULT = null;
                 int vnameleft = (parser_stack.get(parser_top-0)).left;
                 int vnameright = (parser_stack.get(parser_top-0)).right;
-                QName vname = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
+                QName vname = (QName)(parser_stack.get(parser_top-0)).value;
 
             RESULT = vname;
 
@@ -1438,7 +1438,7 @@
               QName RESULT = null;
                 int fnameleft = (parser_stack.get(parser_top-0)).left;
                 int fnameright = (parser_stack.get(parser_top-0)).right;
-                QName fname = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
+                QName fname = (QName)(parser_stack.get(parser_top-0)).value;
 
             RESULT = fname;
 
@@ -1452,11 +1452,11 @@
                 List<Expression> RESULT = null;
                 int argleft = (parser_stack.get(parser_top-2)).left;
                 int argright = (parser_stack.get(parser_top-2)).right;
-                Expression arg = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression arg = (Expression)(parser_stack.get(parser_top-2)).value;
                 int arglleft = (parser_stack.get(parser_top-0)).left;
                 int arglright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-                List<Expression> argl = (ArrayList<Expression>)((Symbol) parser_stack.get(parser_top-0)).value;
+                List<Expression> argl = (ArrayList<Expression>)(parser_stack.get(parser_top-0)).value;
                 argl.add(0, arg);
                 RESULT = argl;
               parser_result = new Symbol(36/*NonemptyArgumentList*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
@@ -1469,7 +1469,7 @@
               List<Expression> RESULT = null;
                 int argleft = (parser_stack.get(parser_top-0)).left;
                 int argright = (parser_stack.get(parser_top-0)).right;
-                Expression arg = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression arg = (Expression)(parser_stack.get(parser_top-0)).value;
 
             List<Expression> temp = new ArrayList<>();
             temp.add(arg);
@@ -1485,11 +1485,11 @@
                 Expression RESULT = null;
                 int fnameleft = (parser_stack.get(parser_top-3)).left;
                 int fnameright = (parser_stack.get(parser_top-3)).right;
-                QName fname = (QName)((Symbol) parser_stack.get(parser_top-3)).value;
+                QName fname = (QName)(parser_stack.get(parser_top-3)).value;
                 int arglleft = (parser_stack.get(parser_top-1)).left;
                 int arglright = (parser_stack.get(parser_top-1)).right;
                 @SuppressWarnings("unchecked")
-                List<Expression> argl = (ArrayList<Expression>)((Symbol) parser_stack.get(parser_top-1)).value;
+                List<Expression> argl = (ArrayList<Expression>)(parser_stack.get(parser_top-1)).value;
 
           if (fname == parser.getQNameIgnoreDefaultNs("concat")) {
             RESULT = new ConcatCall(fname, argl);
@@ -1584,7 +1584,7 @@
               Expression RESULT = null;
                 int fnameleft = (parser_stack.get(parser_top-2)).left;
                 int fnameright = (parser_stack.get(parser_top-2)).right;
-                QName fname = (QName)((Symbol) parser_stack.get(parser_top-2)).value;
+                QName fname = (QName)(parser_stack.get(parser_top-2)).value;
 
 
           if (fname == parser.getQNameIgnoreDefaultNs("current")) {
@@ -1640,7 +1640,7 @@
               Expression RESULT = null;
                 int varNameleft = (parser_stack.get(parser_top-0)).left;
                 int varNameright = (parser_stack.get(parser_top-0)).right;
-                QName varName = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
+                QName varName = (QName)(parser_stack.get(parser_top-0)).value;
 
             // An empty qname prefix for a variable or parameter reference
             // should map to the null namespace and not the default URI.
@@ -1672,7 +1672,7 @@
               Expression RESULT = null;
                 int fcleft = (parser_stack.get(parser_top-0)).left;
                 int fcright = (parser_stack.get(parser_top-0)).right;
-                Expression fc = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression fc = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = fc;
               parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1684,7 +1684,7 @@
               Expression RESULT = null;
                 int numleft = (parser_stack.get(parser_top-0)).left;
                 int numright = (parser_stack.get(parser_top-0)).right;
-                Double num = (Double)((Symbol) parser_stack.get(parser_top-0)).value;
+                Double num = (Double)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RealExpr(num.doubleValue());
               parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1696,7 +1696,7 @@
               Expression RESULT = null;
                 int numleft = (parser_stack.get(parser_top-0)).left;
                 int numright = (parser_stack.get(parser_top-0)).right;
-                Long num = (Long)((Symbol) parser_stack.get(parser_top-0)).value;
+                Long num = (Long)(parser_stack.get(parser_top-0)).value;
 
            long value = num.longValue();
            if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
@@ -1723,7 +1723,7 @@
               Expression RESULT = null;
                 int stringleft = (parser_stack.get(parser_top-0)).left;
                 int stringright = (parser_stack.get(parser_top-0)).right;
-                String string = (String)((Symbol) parser_stack.get(parser_top-0)).value;
+                String string = (String)(parser_stack.get(parser_top-0)).value;
 
         /*
         * If the string appears to have the syntax of a QName, store
@@ -1751,7 +1751,7 @@
               Expression RESULT = null;
                 int exleft = (parser_stack.get(parser_top-1)).left;
                 int exright = (parser_stack.get(parser_top-1)).right;
-                Expression ex = (Expression)((Symbol) parser_stack.get(parser_top-1)).value;
+                Expression ex = (Expression)(parser_stack.get(parser_top-1)).value;
                  RESULT = ex;
               parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1763,7 +1763,7 @@
               Expression RESULT = null;
                 int vrleft = (parser_stack.get(parser_top-0)).left;
                 int vrright = (parser_stack.get(parser_top-0)).right;
-                Expression vr = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression vr = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = vr;
               parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1775,11 +1775,11 @@
               Expression RESULT = null;
                 int primaryleft = (parser_stack.get(parser_top-1)).left;
                 int primaryright = (parser_stack.get(parser_top-1)).right;
-                Expression primary = (Expression)((Symbol) parser_stack.get(parser_top-1)).value;
+                Expression primary = (Expression)(parser_stack.get(parser_top-1)).value;
                 int ppleft = (parser_stack.get(parser_top-0)).left;
                 int ppright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-                List<Expression> pp = (ArrayList<Expression>)((Symbol) parser_stack.get(parser_top-0)).value;
+                List<Expression> pp = (ArrayList<Expression>)(parser_stack.get(parser_top-0)).value;
                  RESULT = new FilterExpr(primary, pp);
               parser_result = new Symbol(6/*FilterExpr*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1791,7 +1791,7 @@
               Expression RESULT = null;
                 int primaryleft = (parser_stack.get(parser_top-0)).left;
                 int primaryright = (parser_stack.get(parser_top-0)).right;
-                Expression primary = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression primary = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = primary;
               parser_result = new Symbol(6/*FilterExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1947,7 +1947,7 @@
               Integer RESULT = null;
                 int anleft = (parser_stack.get(parser_top-1)).left;
                 int anright = (parser_stack.get(parser_top-1)).right;
-                Integer an = (Integer)((Symbol) parser_stack.get(parser_top-1)).value;
+                Integer an = (Integer)(parser_stack.get(parser_top-1)).value;
                  RESULT = an;
               parser_result = new Symbol(41/*AxisSpecifier*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1959,7 +1959,7 @@
               Expression RESULT = null;
                 int abbrevleft = (parser_stack.get(parser_top-0)).left;
                 int abbrevright = (parser_stack.get(parser_top-0)).right;
-                Expression abbrev = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression abbrev = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = abbrev;
               parser_result = new Symbol(7/*Step*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1971,10 +1971,10 @@
               Expression RESULT = null;
                 int axisleft = (parser_stack.get(parser_top-1)).left;
                 int axisright = (parser_stack.get(parser_top-1)).right;
-                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-1)).value;
+                Integer axis = (Integer)(parser_stack.get(parser_top-1)).value;
                 int ntestleft = (parser_stack.get(parser_top-0)).left;
                 int ntestright = (parser_stack.get(parser_top-0)).right;
-                Object ntest = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
+                Object ntest = parser_stack.get(parser_top-0).value;
                  RESULT = new Step(axis.intValue(),
                              parser.findNodeType(axis.intValue(), ntest),
                              null);
@@ -1989,14 +1989,14 @@
               Expression RESULT = null;
                 int axisleft = (parser_stack.get(parser_top-2)).left;
                 int axisright = (parser_stack.get(parser_top-2)).right;
-                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-2)).value;
+                Integer axis = (Integer)(parser_stack.get(parser_top-2)).value;
                 int ntestleft = (parser_stack.get(parser_top-1)).left;
                 int ntestright = (parser_stack.get(parser_top-1)).right;
-                Object ntest = (Object)((Symbol) parser_stack.get(parser_top-1)).value;
+                Object ntest = parser_stack.get(parser_top-1).value;
                 int ppleft = (parser_stack.get(parser_top-0)).left;
                 int ppright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
                  RESULT = new Step(axis.intValue(),
                              parser.findNodeType(axis.intValue(), ntest),
                              pp);
@@ -2011,11 +2011,11 @@
               Expression RESULT = null;
                 int ntestleft = (parser_stack.get(parser_top-1)).left;
                 int ntestright = (parser_stack.get(parser_top-1)).right;
-                Object ntest = (Object)((Symbol) parser_stack.get(parser_top-1)).value;
+                Object ntest = parser_stack.get(parser_top-1).value;
                 int ppleft = (parser_stack.get(parser_top-0)).left;
                 int ppright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
 
             if (ntest instanceof Step) {
                 Step step = (Step)ntest;
@@ -2037,7 +2037,7 @@
               Expression RESULT = null;
                 int ntestleft = (parser_stack.get(parser_top-0)).left;
                 int ntestright = (parser_stack.get(parser_top-0)).right;
-                Object ntest = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
+                Object ntest = parser_stack.get(parser_top-0).value;
 
             if (ntest instanceof Step) {
                 RESULT = (Step)ntest;
@@ -2058,7 +2058,7 @@
               Expression RESULT = null;
                 int rlpleft = (parser_stack.get(parser_top-0)).left;
                 int rlpright = (parser_stack.get(parser_top-0)).right;
-                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
 
            //
            // Expand '//' into '/descendant-or-self::node()/' or
@@ -2084,10 +2084,10 @@
               Expression RESULT = null;
                 int rlpleft = (parser_stack.get(parser_top-2)).left;
                 int rlpright = (parser_stack.get(parser_top-2)).right;
-                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-2)).value;
                 int stepleft = (parser_stack.get(parser_top-0)).left;
                 int stepright = (parser_stack.get(parser_top-0)).right;
-                Expression step = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression step = (Expression)(parser_stack.get(parser_top-0)).value;
 
            final Step right  = (Step)step;
            final int  axis   = right.getAxis();
@@ -2151,7 +2151,7 @@
               Expression RESULT = null;
                 int aalpleft = (parser_stack.get(parser_top-0)).left;
                 int aalpright = (parser_stack.get(parser_top-0)).right;
-                Expression aalp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression aalp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = aalp;
               parser_result = new Symbol(23/*AbsoluteLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2163,7 +2163,7 @@
               Expression RESULT = null;
                 int rlpleft = (parser_stack.get(parser_top-0)).left;
                 int rlpright = (parser_stack.get(parser_top-0)).right;
-                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AbsoluteLocationPath(rlp);
               parser_result = new Symbol(23/*AbsoluteLocationPath*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2184,7 +2184,7 @@
               Expression RESULT = null;
                 int arlpleft = (parser_stack.get(parser_top-0)).left;
                 int arlpright = (parser_stack.get(parser_top-0)).right;
-                Expression arlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression arlp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = arlp;
               parser_result = new Symbol(21/*RelativeLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2196,10 +2196,10 @@
               Expression RESULT = null;
                 int rlpleft = (parser_stack.get(parser_top-2)).left;
                 int rlpright = (parser_stack.get(parser_top-2)).right;
-                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-2)).value;
                 int stepleft = (parser_stack.get(parser_top-0)).left;
                 int stepright = (parser_stack.get(parser_top-0)).right;
-                Expression step = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression step = (Expression)(parser_stack.get(parser_top-0)).value;
 
         if (rlp instanceof Step && ((Step) rlp).isAbbreviatedDot()) {
               RESULT = step;       // Remove './' from the middle
@@ -2222,7 +2222,7 @@
               Expression RESULT = null;
                 int stepleft = (parser_stack.get(parser_top-0)).left;
                 int stepright = (parser_stack.get(parser_top-0)).right;
-                Expression step = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression step = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = step;
               parser_result = new Symbol(21/*RelativeLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2234,7 +2234,7 @@
               Expression RESULT = null;
                 int alpleft = (parser_stack.get(parser_top-0)).left;
                 int alpright = (parser_stack.get(parser_top-0)).right;
-                Expression alp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression alp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = alp;
               parser_result = new Symbol(4/*LocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2246,7 +2246,7 @@
               Expression RESULT = null;
                 int rlpleft = (parser_stack.get(parser_top-0)).left;
                 int rlpright = (parser_stack.get(parser_top-0)).right;
-                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = rlp;
               parser_result = new Symbol(4/*LocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2258,10 +2258,10 @@
               Expression RESULT = null;
                 int fexpleft = (parser_stack.get(parser_top-2)).left;
                 int fexpright = (parser_stack.get(parser_top-2)).right;
-                Expression fexp = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression fexp = (Expression)(parser_stack.get(parser_top-2)).value;
                 int rlpleft = (parser_stack.get(parser_top-0)).left;
                 int rlpright = (parser_stack.get(parser_top-0)).right;
-                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
 
            //
            // Expand '//' into '/descendant-or-self::node()/' or
@@ -2291,10 +2291,10 @@
               Expression RESULT = null;
                 int fexpleft = (parser_stack.get(parser_top-2)).left;
                 int fexpright = (parser_stack.get(parser_top-2)).right;
-                Expression fexp = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression fexp = (Expression)(parser_stack.get(parser_top-2)).value;
                 int rlpleft = (parser_stack.get(parser_top-0)).left;
                 int rlpright = (parser_stack.get(parser_top-0)).right;
-                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new FilterParentPath(fexp, rlp);
               parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2306,7 +2306,7 @@
               Expression RESULT = null;
                 int fexpleft = (parser_stack.get(parser_top-0)).left;
                 int fexpright = (parser_stack.get(parser_top-0)).right;
-                Expression fexp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression fexp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = fexp;
               parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2318,7 +2318,7 @@
               Expression RESULT = null;
                 int lpleft = (parser_stack.get(parser_top-0)).left;
                 int lpright = (parser_stack.get(parser_top-0)).right;
-                Expression lp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression lp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = lp;
               parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2330,10 +2330,10 @@
               Expression RESULT = null;
                 int peleft = (parser_stack.get(parser_top-2)).left;
                 int peright = (parser_stack.get(parser_top-2)).right;
-                Expression pe = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression pe = (Expression)(parser_stack.get(parser_top-2)).value;
                 int restleft = (parser_stack.get(parser_top-0)).left;
                 int restright = (parser_stack.get(parser_top-0)).right;
-                Expression rest = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression rest = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new UnionPathExpr(pe, rest);
               parser_result = new Symbol(18/*UnionExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2345,7 +2345,7 @@
               Expression RESULT = null;
                 int peleft = (parser_stack.get(parser_top-0)).left;
                 int peright = (parser_stack.get(parser_top-0)).right;
-                Expression pe = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression pe = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = pe;
               parser_result = new Symbol(18/*UnionExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2357,7 +2357,7 @@
               Expression RESULT = null;
                 int ueleft = (parser_stack.get(parser_top-0)).left;
                 int ueright = (parser_stack.get(parser_top-0)).right;
-                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new UnaryOpExpr(ue);
               parser_result = new Symbol(14/*UnaryExpr*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2369,7 +2369,7 @@
               Expression RESULT = null;
                 int ueleft = (parser_stack.get(parser_top-0)).left;
                 int ueright = (parser_stack.get(parser_top-0)).right;
-                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ue;
               parser_result = new Symbol(14/*UnaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2381,10 +2381,10 @@
               Expression RESULT = null;
                 int meleft = (parser_stack.get(parser_top-2)).left;
                 int meright = (parser_stack.get(parser_top-2)).right;
-                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression me = (Expression)(parser_stack.get(parser_top-2)).value;
                 int ueleft = (parser_stack.get(parser_top-0)).left;
                 int ueright = (parser_stack.get(parser_top-0)).right;
-                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.MOD, me, ue);
               parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2396,10 +2396,10 @@
               Expression RESULT = null;
                 int meleft = (parser_stack.get(parser_top-2)).left;
                 int meright = (parser_stack.get(parser_top-2)).right;
-                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression me = (Expression)(parser_stack.get(parser_top-2)).value;
                 int ueleft = (parser_stack.get(parser_top-0)).left;
                 int ueright = (parser_stack.get(parser_top-0)).right;
-                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.DIV, me, ue);
               parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2411,10 +2411,10 @@
               Expression RESULT = null;
                 int meleft = (parser_stack.get(parser_top-2)).left;
                 int meright = (parser_stack.get(parser_top-2)).right;
-                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression me = (Expression)(parser_stack.get(parser_top-2)).value;
                 int ueleft = (parser_stack.get(parser_top-0)).left;
                 int ueright = (parser_stack.get(parser_top-0)).right;
-                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.TIMES, me, ue);
               parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2426,7 +2426,7 @@
               Expression RESULT = null;
                 int ueleft = (parser_stack.get(parser_top-0)).left;
                 int ueright = (parser_stack.get(parser_top-0)).right;
-                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ue;
               parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2438,10 +2438,10 @@
               Expression RESULT = null;
                 int aeleft = (parser_stack.get(parser_top-2)).left;
                 int aeright = (parser_stack.get(parser_top-2)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-2)).value;
                 int meleft = (parser_stack.get(parser_top-0)).left;
                 int meright = (parser_stack.get(parser_top-0)).right;
-                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression me = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.MINUS, ae, me);
               parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2453,10 +2453,10 @@
               Expression RESULT = null;
                 int aeleft = (parser_stack.get(parser_top-2)).left;
                 int aeright = (parser_stack.get(parser_top-2)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-2)).value;
                 int meleft = (parser_stack.get(parser_top-0)).left;
                 int meright = (parser_stack.get(parser_top-0)).right;
-                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression me = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.PLUS, ae, me);
               parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2468,7 +2468,7 @@
               Expression RESULT = null;
                 int meleft = (parser_stack.get(parser_top-0)).left;
                 int meright = (parser_stack.get(parser_top-0)).right;
-                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression me = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = me;
               parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2480,10 +2480,10 @@
               Expression RESULT = null;
                 int releft = (parser_stack.get(parser_top-2)).left;
                 int reright = (parser_stack.get(parser_top-2)).right;
-                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression re = (Expression)(parser_stack.get(parser_top-2)).value;
                 int aeleft = (parser_stack.get(parser_top-0)).left;
                 int aeright = (parser_stack.get(parser_top-0)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.GE, re, ae);
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2495,10 +2495,10 @@
               Expression RESULT = null;
                 int releft = (parser_stack.get(parser_top-2)).left;
                 int reright = (parser_stack.get(parser_top-2)).right;
-                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression re = (Expression)(parser_stack.get(parser_top-2)).value;
                 int aeleft = (parser_stack.get(parser_top-0)).left;
                 int aeright = (parser_stack.get(parser_top-0)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.LE, re, ae);
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2510,10 +2510,10 @@
               Expression RESULT = null;
                 int releft = (parser_stack.get(parser_top-2)).left;
                 int reright = (parser_stack.get(parser_top-2)).right;
-                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression re = (Expression)(parser_stack.get(parser_top-2)).value;
                 int aeleft = (parser_stack.get(parser_top-0)).left;
                 int aeright = (parser_stack.get(parser_top-0)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.GT, re, ae);
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2525,10 +2525,10 @@
               Expression RESULT = null;
                 int releft = (parser_stack.get(parser_top-2)).left;
                 int reright = (parser_stack.get(parser_top-2)).right;
-                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression re = (Expression)(parser_stack.get(parser_top-2)).value;
                 int aeleft = (parser_stack.get(parser_top-0)).left;
                 int aeright = (parser_stack.get(parser_top-0)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.LT, re, ae);
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2540,7 +2540,7 @@
               Expression RESULT = null;
                 int aeleft = (parser_stack.get(parser_top-0)).left;
                 int aeright = (parser_stack.get(parser_top-0)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ae;
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2552,10 +2552,10 @@
               Expression RESULT = null;
                 int eeleft = (parser_stack.get(parser_top-2)).left;
                 int eeright = (parser_stack.get(parser_top-2)).right;
-                Expression ee = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression ee = (Expression)(parser_stack.get(parser_top-2)).value;
                 int releft = (parser_stack.get(parser_top-0)).left;
                 int reright = (parser_stack.get(parser_top-0)).right;
-                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression re = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new EqualityExpr(Operators.NE, ee, re);
               parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2567,10 +2567,10 @@
               Expression RESULT = null;
                 int eeleft = (parser_stack.get(parser_top-2)).left;
                 int eeright = (parser_stack.get(parser_top-2)).right;
-                Expression ee = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression ee = (Expression)(parser_stack.get(parser_top-2)).value;
                 int releft = (parser_stack.get(parser_top-0)).left;
                 int reright = (parser_stack.get(parser_top-0)).right;
-                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression re = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new EqualityExpr(Operators.EQ, ee, re);
               parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2582,7 +2582,7 @@
               Expression RESULT = null;
                 int releft = (parser_stack.get(parser_top-0)).left;
                 int reright = (parser_stack.get(parser_top-0)).right;
-                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression re = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = re;
               parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2594,10 +2594,10 @@
               Expression RESULT = null;
                 int aeleft = (parser_stack.get(parser_top-2)).left;
                 int aeright = (parser_stack.get(parser_top-2)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-2)).value;
                 int eeleft = (parser_stack.get(parser_top-0)).left;
                 int eeright = (parser_stack.get(parser_top-0)).right;
-                Expression ee = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ee = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new LogicalExpr(LogicalExpr.AND, ae, ee);
               parser_result = new Symbol(9/*AndExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2609,7 +2609,7 @@
               Expression RESULT = null;
                 int eleft = (parser_stack.get(parser_top-0)).left;
                 int eright = (parser_stack.get(parser_top-0)).right;
-                Expression e = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression e = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = e;
               parser_result = new Symbol(9/*AndExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2621,10 +2621,10 @@
               Expression RESULT = null;
                 int oeleft = (parser_stack.get(parser_top-2)).left;
                 int oeright = (parser_stack.get(parser_top-2)).right;
-                Expression oe = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                Expression oe = (Expression)(parser_stack.get(parser_top-2)).value;
                 int aeleft = (parser_stack.get(parser_top-0)).left;
                 int aeright = (parser_stack.get(parser_top-0)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new LogicalExpr(LogicalExpr.OR, oe, ae);
               parser_result = new Symbol(8/*OrExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2636,7 +2636,7 @@
               Expression RESULT = null;
                 int aeleft = (parser_stack.get(parser_top-0)).left;
                 int aeright = (parser_stack.get(parser_top-0)).right;
-                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ae;
               parser_result = new Symbol(8/*OrExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2648,7 +2648,7 @@
               Expression RESULT = null;
                 int exleft = (parser_stack.get(parser_top-0)).left;
                 int exright = (parser_stack.get(parser_top-0)).right;
-                Expression ex = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression ex = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ex;
               parser_result = new Symbol(2/*Expr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2660,7 +2660,7 @@
               Expression RESULT = null;
                 int eleft = (parser_stack.get(parser_top-1)).left;
                 int eright = (parser_stack.get(parser_top-1)).right;
-                Expression e = (Expression)((Symbol) parser_stack.get(parser_top-1)).value;
+                Expression e = (Expression)(parser_stack.get(parser_top-1)).value;
 
                 RESULT = new Predicate(e);
 
@@ -2674,11 +2674,11 @@
                 List<Expression> RESULT = null;
                 int pleft = (parser_stack.get(parser_top-1)).left;
                 int pright = (parser_stack.get(parser_top-1)).right;
-                Expression p = (Expression)((Symbol) parser_stack.get(parser_top-1)).value;
+                Expression p = (Expression)(parser_stack.get(parser_top-1)).value;
                 int ppleft = (parser_stack.get(parser_top-0)).left;
                 int ppright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-                List<Expression> pp = (ArrayList<Expression>)((Symbol) parser_stack.get(parser_top-0)).value;
+                List<Expression> pp = (ArrayList<Expression>)(parser_stack.get(parser_top-0)).value;
                 pp.add(0, p); RESULT = pp;
               parser_result = new Symbol(35/*Predicates*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2690,7 +2690,7 @@
                 List<Expression> RESULT = null;
                 int pleft = (parser_stack.get(parser_top-0)).left;
                 int pright = (parser_stack.get(parser_top-0)).right;
-                Expression p = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression p = (Expression)(parser_stack.get(parser_top-0)).value;
 
                 List<Expression> temp = new ArrayList<>();
                 temp.add(p);
@@ -2733,7 +2733,7 @@
               Object RESULT = null;
                 int qnleft = (parser_stack.get(parser_top-0)).left;
                 int qnright = (parser_stack.get(parser_top-0)).right;
-                QName qn = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
+                QName qn = (QName)(parser_stack.get(parser_top-0)).value;
                  RESULT = qn;
               parser_result = new Symbol(34/*NameTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2790,7 +2790,7 @@
               Object RESULT = null;
                 int ntleft = (parser_stack.get(parser_top-0)).left;
                 int ntright = (parser_stack.get(parser_top-0)).right;
-                Object nt = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
+                Object nt = parser_stack.get(parser_top-0).value;
                  RESULT = nt;
               parser_result = new Symbol(33/*NodeTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2802,14 +2802,14 @@
               StepPattern RESULT = null;
                 int axisleft = (parser_stack.get(parser_top-2)).left;
                 int axisright = (parser_stack.get(parser_top-2)).right;
-                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-2)).value;
+                Integer axis = (Integer)(parser_stack.get(parser_top-2)).value;
                 int pipleft = (parser_stack.get(parser_top-1)).left;
                 int pipright = (parser_stack.get(parser_top-1)).right;
-                StepPattern pip = (StepPattern)((Symbol) parser_stack.get(parser_top-1)).value;
+                StepPattern pip = (StepPattern)(parser_stack.get(parser_top-1)).value;
                 int ppleft = (parser_stack.get(parser_top-0)).left;
                 int ppright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
 
                // TODO: report error if axis is attribute
                RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
@@ -2824,10 +2824,10 @@
               StepPattern RESULT = null;
                 int axisleft = (parser_stack.get(parser_top-1)).left;
                 int axisright = (parser_stack.get(parser_top-1)).right;
-                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-1)).value;
+                Integer axis = (Integer)(parser_stack.get(parser_top-1)).value;
                 int pipleft = (parser_stack.get(parser_top-0)).left;
                 int pipright = (parser_stack.get(parser_top-0)).right;
-                StepPattern pip = (StepPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                StepPattern pip = (StepPattern)(parser_stack.get(parser_top-0)).value;
 
                RESULT = pip;    // TODO: report error if axis is attribute
 
@@ -2841,14 +2841,14 @@
               StepPattern RESULT = null;
                 int axisleft = (parser_stack.get(parser_top-2)).left;
                 int axisright = (parser_stack.get(parser_top-2)).right;
-                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-2)).value;
+                Integer axis = (Integer)(parser_stack.get(parser_top-2)).value;
                 int ntleft = (parser_stack.get(parser_top-1)).left;
                 int ntright = (parser_stack.get(parser_top-1)).right;
-                Object nt = (Object)((Symbol) parser_stack.get(parser_top-1)).value;
+                Object nt = parser_stack.get(parser_top-1).value;
                 int ppleft = (parser_stack.get(parser_top-0)).left;
                 int ppright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-               List<Predicate>pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
+               List<Predicate>pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
 
                RESULT = parser.createStepPattern(axis.intValue(), nt, pp);
 
@@ -2862,10 +2862,10 @@
               StepPattern RESULT = null;
                 int axisleft = (parser_stack.get(parser_top-1)).left;
                 int axisright = (parser_stack.get(parser_top-1)).right;
-                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-1)).value;
+                Integer axis = (Integer)(parser_stack.get(parser_top-1)).value;
                 int ntleft = (parser_stack.get(parser_top-0)).left;
                 int ntright = (parser_stack.get(parser_top-0)).right;
-                Object nt = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
+                Object nt = parser_stack.get(parser_top-0).value;
 
                RESULT = parser.createStepPattern(axis.intValue(), nt, null);
 
@@ -2879,11 +2879,11 @@
               StepPattern RESULT = null;
                 int pipleft = (parser_stack.get(parser_top-1)).left;
                 int pipright = (parser_stack.get(parser_top-1)).right;
-                StepPattern pip = (StepPattern)((Symbol) parser_stack.get(parser_top-1)).value;
+                StepPattern pip = (StepPattern)(parser_stack.get(parser_top-1)).value;
                 int ppleft = (parser_stack.get(parser_top-0)).left;
                 int ppright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
                  RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
               parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2895,7 +2895,7 @@
               StepPattern RESULT = null;
                 int pipleft = (parser_stack.get(parser_top-0)).left;
                 int pipright = (parser_stack.get(parser_top-0)).right;
-                StepPattern pip = (StepPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                StepPattern pip = (StepPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = pip;
               parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2907,11 +2907,11 @@
               StepPattern RESULT = null;
                 int ntleft = (parser_stack.get(parser_top-1)).left;
                 int ntright = (parser_stack.get(parser_top-1)).right;
-                Object nt = (Object)((Symbol) parser_stack.get(parser_top-1)).value;
+                Object nt = parser_stack.get(parser_top-1).value;
                 int ppleft = (parser_stack.get(parser_top-0)).left;
                 int ppright = (parser_stack.get(parser_top-0)).right;
                 @SuppressWarnings("unchecked")
-                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
 
                 RESULT = parser.createStepPattern(Axis.CHILD, nt, pp);
 
@@ -2925,7 +2925,7 @@
               StepPattern RESULT = null;
                 int ntleft = (parser_stack.get(parser_top-0)).left;
                 int ntright = (parser_stack.get(parser_top-0)).right;
-                Object nt = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
+                Object nt = parser_stack.get(parser_top-0).value;
 
                 RESULT = parser.createStepPattern(Axis.CHILD, nt, null);
 
@@ -2939,10 +2939,10 @@
               RelativePathPattern RESULT = null;
                 int spleft = (parser_stack.get(parser_top-2)).left;
                 int spright = (parser_stack.get(parser_top-2)).right;
-                StepPattern sp = (StepPattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                StepPattern sp = (StepPattern)(parser_stack.get(parser_top-2)).value;
                 int rppleft = (parser_stack.get(parser_top-0)).left;
                 int rppright = (parser_stack.get(parser_top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(sp, rpp);
               parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2954,10 +2954,10 @@
               RelativePathPattern RESULT = null;
                 int spleft = (parser_stack.get(parser_top-2)).left;
                 int spright = (parser_stack.get(parser_top-2)).right;
-                StepPattern sp = (StepPattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                StepPattern sp = (StepPattern)(parser_stack.get(parser_top-2)).value;
                 int rppleft = (parser_stack.get(parser_top-0)).left;
                 int rppright = (parser_stack.get(parser_top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new ParentPattern(sp, rpp);
               parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2969,7 +2969,7 @@
               RelativePathPattern RESULT = null;
                 int spleft = (parser_stack.get(parser_top-0)).left;
                 int spright = (parser_stack.get(parser_top-0)).right;
-                StepPattern sp = (StepPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                StepPattern sp = (StepPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = sp;
               parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2981,7 +2981,7 @@
               StepPattern RESULT = null;
                 int lleft = (parser_stack.get(parser_top-1)).left;
                 int lright = (parser_stack.get(parser_top-1)).right;
-                String l = (String)((Symbol) parser_stack.get(parser_top-1)).value;
+                String l = (String)(parser_stack.get(parser_top-1)).value;
                  RESULT = new ProcessingInstructionPattern(l);
               parser_result = new Symbol(30/*ProcessingInstructionPattern*/, (parser_stack.get(parser_top-3)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2993,10 +2993,10 @@
               IdKeyPattern RESULT = null;
                 int l1left = (parser_stack.get(parser_top-3)).left;
                 int l1right = (parser_stack.get(parser_top-3)).right;
-                String l1 = (String)((Symbol) parser_stack.get(parser_top-3)).value;
+                String l1 = (String)(parser_stack.get(parser_top-3)).value;
                 int l2left = (parser_stack.get(parser_top-1)).left;
                 int l2right = (parser_stack.get(parser_top-1)).right;
-                String l2 = (String)((Symbol) parser_stack.get(parser_top-1)).value;
+                String l2 = (String)(parser_stack.get(parser_top-1)).value;
                  RESULT = new KeyPattern(l1, l2);
               parser_result = new Symbol(27/*IdKeyPattern*/, (parser_stack.get(parser_top-5)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3008,7 +3008,7 @@
               IdKeyPattern RESULT = null;
                 int lleft = (parser_stack.get(parser_top-1)).left;
                 int lright = (parser_stack.get(parser_top-1)).right;
-                String l = (String)((Symbol) parser_stack.get(parser_top-1)).value;
+                String l = (String)(parser_stack.get(parser_top-1)).value;
                  RESULT = new IdPattern(l);
                parser.setHasIdCall(true);
 
@@ -3022,7 +3022,7 @@
               Pattern RESULT = null;
                 int rppleft = (parser_stack.get(parser_top-0)).left;
                 int rppright = (parser_stack.get(parser_top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = rpp;
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3034,7 +3034,7 @@
               Pattern RESULT = null;
                 int rppleft = (parser_stack.get(parser_top-0)).left;
                 int rppright = (parser_stack.get(parser_top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(rpp);
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3046,10 +3046,10 @@
               Pattern RESULT = null;
                 int ikpleft = (parser_stack.get(parser_top-2)).left;
                 int ikpright = (parser_stack.get(parser_top-2)).right;
-                IdKeyPattern ikp = (IdKeyPattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                IdKeyPattern ikp = (IdKeyPattern)(parser_stack.get(parser_top-2)).value;
                 int rppleft = (parser_stack.get(parser_top-0)).left;
                 int rppright = (parser_stack.get(parser_top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(ikp, rpp);
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3061,10 +3061,10 @@
               Pattern RESULT = null;
                 int ikpleft = (parser_stack.get(parser_top-2)).left;
                 int ikpright = (parser_stack.get(parser_top-2)).right;
-                IdKeyPattern ikp = (IdKeyPattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                IdKeyPattern ikp = (IdKeyPattern)(parser_stack.get(parser_top-2)).value;
                 int rppleft = (parser_stack.get(parser_top-0)).left;
                 int rppright = (parser_stack.get(parser_top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new ParentPattern(ikp, rpp);
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3076,7 +3076,7 @@
               Pattern RESULT = null;
                 int ikpleft = (parser_stack.get(parser_top-0)).left;
                 int ikpright = (parser_stack.get(parser_top-0)).right;
-                IdKeyPattern ikp = (IdKeyPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                IdKeyPattern ikp = (IdKeyPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = ikp;
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3088,7 +3088,7 @@
               Pattern RESULT = null;
                 int rppleft = (parser_stack.get(parser_top-0)).left;
                 int rppright = (parser_stack.get(parser_top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AbsolutePathPattern(rpp);
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3109,10 +3109,10 @@
               Pattern RESULT = null;
                 int lppleft = (parser_stack.get(parser_top-2)).left;
                 int lppright = (parser_stack.get(parser_top-2)).right;
-                Pattern lpp = (Pattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                Pattern lpp = (Pattern)(parser_stack.get(parser_top-2)).value;
                 int pleft = (parser_stack.get(parser_top-0)).left;
                 int pright = (parser_stack.get(parser_top-0)).right;
-                Pattern p = (Pattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                Pattern p = (Pattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AlternativePattern(lpp, p);
               parser_result = new Symbol(28/*Pattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3124,7 +3124,7 @@
               Pattern RESULT = null;
                 int lppleft = (parser_stack.get(parser_top-0)).left;
                 int lppright = (parser_stack.get(parser_top-0)).right;
-                Pattern lpp = (Pattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                Pattern lpp = (Pattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = lpp;
               parser_result = new Symbol(28/*Pattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3136,7 +3136,7 @@
               SyntaxTreeNode RESULT = null;
                 int exprleft = (parser_stack.get(parser_top-0)).left;
                 int exprright = (parser_stack.get(parser_top-0)).right;
-                Expression expr = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
+                Expression expr = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = expr;
               parser_result = new Symbol(1/*TopLevel*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3148,7 +3148,7 @@
               SyntaxTreeNode RESULT = null;
                 int patternleft = (parser_stack.get(parser_top-0)).left;
                 int patternright = (parser_stack.get(parser_top-0)).right;
-                Pattern pattern = (Pattern)((Symbol) parser_stack.get(parser_top-0)).value;
+                Pattern pattern = (Pattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = pattern;
               parser_result = new Symbol(1/*TopLevel*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3160,7 +3160,7 @@
               Object RESULT = null;
                 int start_valleft = (parser_stack.get(parser_top-1)).left;
                 int start_valright = (parser_stack.get(parser_top-1)).right;
-                SyntaxTreeNode start_val = (SyntaxTreeNode)((Symbol) parser_stack.get(parser_top-1)).value;
+                SyntaxTreeNode start_val = (SyntaxTreeNode)(parser_stack.get(parser_top-1)).value;
                 RESULT = start_val;
               parser_result = new Symbol(0/*$START*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -864,7 +864,7 @@
             // iteration after it reaches the end of the InstructionList, with
             // currentHandle set to null.
             currentHandle = instructions.hasNext()
-                                    ? (InstructionHandle) instructions.next()
+                                    ? instructions.next()
                                     : null;
             Instruction inst =
                     (currentHandle != null) ? currentHandle.getInstruction()
@@ -904,14 +904,13 @@
                 // are better candidates for outlining than the current chunk.
                 if (!openChunkAtCurrLevel) {
                     nestedSubChunks = currLevelChunks;
-                    currLevelChunks = (List<InstructionHandle>)subChunkStack.pop();
+                    currLevelChunks = subChunkStack.pop();
                 }
 
                 // Get the handle for the start of this chunk (the last entry
                 // in currLevelChunks)
                 InstructionHandle chunkStart =
-                        (InstructionHandle) currLevelChunks.get(
-                                                      currLevelChunks.size()-1);
+                        currLevelChunks.get(currLevelChunks.size()-1);
 
                 int chunkEndPosition =
                         (currentHandle != null) ? currentHandle.getPosition()
@@ -940,12 +939,8 @@
 
                             // Gather all the child chunks of the current chunk
                             for (int i = 0; i < childChunkCount; i++) {
-                                InstructionHandle start =
-                                    (InstructionHandle) nestedSubChunks
-                                                            .get(i*2);
-                                InstructionHandle end =
-                                    (InstructionHandle) nestedSubChunks
-                                                            .get(i*2+1);
+                                InstructionHandle start = nestedSubChunks.get(i*2);
+                                InstructionHandle end = nestedSubChunks.get(i*2+1);
 
                                 childChunks[i] = new Chunk(start, end);
                             }
@@ -1168,7 +1163,7 @@
             for (int i = candidateChunks.size()-1;
                  i >= 0 && currentMethodSize > TARGET_METHOD_SIZE;
                  i--) {
-                Chunk chunkToOutline = (Chunk)candidateChunks.get(i);
+                Chunk chunkToOutline = candidateChunks.get(i);
 
                 methodsOutlined.add(outline(chunkToOutline.getChunkStart(),
                                             chunkToOutline.getChunkEnd(),
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -151,7 +151,7 @@
             needToSetDocumentInfo = false;
         }
 
-        final Element tmp = (Element)_document.createElementNS(namespace, qName);
+        final Element tmp = _document.createElementNS(namespace, qName);
 
         // Add namespace declarations first
         if (_namespaceDecls != null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -337,8 +336,8 @@
         if (namespaces != null) {
             final int nDecls = namespaces.size();
             for (int i = 0; i < nDecls; i++) {
-                final String prefix = (String) namespaces.get(i++);
-                String uri = (String) namespaces.get(i);
+                final String prefix = namespaces.get(i++);
+                String uri = namespaces.get(i);
                 Namespace ns = createNamespace(prefix, uri);
                 if (nsMap == null) {
                     nsMap = new HashMap<>();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -613,7 +613,7 @@
      * Return the thread local copy of the stylesheet DOM.
      */
     public DOM getStylesheetDOM() {
-        return (DOM)_sdom.get();
+        return _sdom.get();
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1518,7 +1518,7 @@
         if ( count > 0) {
             final byte[][] result = new byte[count][1];
             for (int i = 0; i < count; i++) {
-                result[i] = (byte[])bytecodes.get(i);
+                result[i] = bytecodes.get(i);
             }
 
             return result;
@@ -1612,7 +1612,7 @@
         if (count > 0) {
             final byte[][] result = new byte[count][1];
             for (int i = 0; i < count; i++) {
-                result[i] = (byte[])bytecodes.get(i);
+                result[i] = bytecodes.get(i);
             }
 
             return result;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -407,7 +407,7 @@
         _method = (String) _properties.get(OutputKeys.METHOD);
 
         // Get encoding using getProperty() to use defaults
-        _encoding = (String) _properties.getProperty(OutputKeys.ENCODING);
+        _encoding = _properties.getProperty(OutputKeys.ENCODING);
 
         _tohFactory = TransletOutputHandlerFactory.newInstance(_useServicesMechanism);
         _tohFactory.setEncoding(_encoding);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -94,7 +94,7 @@
     protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet)
         throws SAXException
     {
-        SAXImpl idom = (SAXImpl)_dom.get();
+        SAXImpl idom = _dom.get();
 
         if (idom != null) {
             if (dtmManager != null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1476,7 +1476,7 @@
             num = --nodeCounter;
             nodeTable.put(node, num);
         } else {
-            Integer n = (Integer) nodeTable.get(node);
+            Integer n = nodeTable.get(node);
             if (n == null) {
                 num = --nodeCounter;
                 nodeTable.put(node, num);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1647,7 +1647,7 @@
         }
 
         public Augmentations getAugmentations (int attributeIndex){
-            return(Augmentations)fAugmentations.elementAt(attributeIndex);
+            return fAugmentations.elementAt(attributeIndex);
         }
 
         public Augmentations getAugmentations (String uri, String localPart){
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -59,7 +59,7 @@
     public String item(int index) {
         final int length = getLength();
         if (index >= 0 && index < length) {
-            return (String) fStrings.get(index);
+            return fStrings.get(index);
         }
         return null;
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -773,7 +773,7 @@
                 // call listeners in the order in which they got registered
                 int nlsize = nl.size();
                 for (int i = 0; i < nlsize; i++) {
-                    LEntry le = (LEntry) nl.get(i);
+                    LEntry le = nl.get(i);
                     if (!le.useCapture && le.type.equals(evt.type) &&
                         nodeListeners.contains(le)) {
                         try {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -333,7 +333,7 @@
         //xxx:stax getText() is supposed to return only DTD internal subset
         //shouldn't we record position here before we go ahead ??
 
-        fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner();
+        fEntityScanner = fEntityManager.getEntityScanner();
         fEntityManager.setEntityHandler(this);
         fStandalone = standalone;
         //System.out.println("state"+fScannerState);
@@ -443,7 +443,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -452,7 +452,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -442,7 +443,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -514,7 +515,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -216,7 +216,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -244,7 +244,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -389,7 +389,7 @@
 
         fEntityManager = (XMLEntityManager)propertyManager.getProperty(ENTITY_MANAGER);
         fEntityStore = fEntityManager.getEntityStore() ;
-        fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner() ;
+        fEntityScanner = fEntityManager.getEntityScanner() ;
         fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER);
 
         //fEntityManager.reset();
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -195,7 +195,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(LOADER_RECOGNIZED_FEATURES.clone());
+        return LOADER_RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -244,7 +244,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(LOADER_RECOGNIZED_PROPERTIES.clone());
+        return LOADER_RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -365,7 +365,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -393,7 +393,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -480,7 +480,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -508,7 +508,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -80,8 +80,8 @@
 
         for (int i = 52,  j = 0; i<=61; i++, j++)
             lookUpBase64Alphabet[i] = (char)('0' + j);
-        lookUpBase64Alphabet[62] = (char)'+';
-        lookUpBase64Alphabet[63] = (char)'/';
+        lookUpBase64Alphabet[62] = '+';
+        lookUpBase64Alphabet[63] = '/';
 
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -69,7 +69,7 @@
      * @return      a hashtable which contains all built-in simple types
      */
     public SymbolHash getBuiltInTypes() {
-        return (SymbolHash)fBaseTypes.makeClone();
+        return fBaseTypes.makeClone();
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -80,6 +80,6 @@
      * @return      a hashtable which contains all built-in simple types
      */
     public SymbolHash getBuiltInTypes() {
-        return (SymbolHash)fBuiltInTypes.makeClone();
+        return fBuiltInTypes.makeClone();
     }
 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -67,7 +67,7 @@
      * @return      a hashtable which contains all built-in simple types
      */
     public SymbolHash getBuiltInTypes() {
-        return (SymbolHash)fFullTypes.makeClone();
+        return fFullTypes.makeClone();
     }
 
     // create all built-in types
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -71,7 +71,7 @@
      * @return      a hashtable which contains all built-in simple types
      */
     public SymbolHash getBuiltInTypes() {
-        return (SymbolHash)fBuiltInTypes.makeClone();
+        return fBuiltInTypes.makeClone();
     }
 
 }//SchemaDVFactoryImpl
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -235,7 +235,7 @@
     };
 
     protected static TypeValidator[] getGDVs() {
-        return (TypeValidator[])gDVs.clone();
+        return gDVs.clone();
     }
     private TypeValidator[] fDVs = gDVs;
     protected void setDVs(TypeValidator[] dvs) {
@@ -434,7 +434,7 @@
         fAnnotations = annotations;
 
         fVariety = VARIETY_LIST;
-        fItemType = (XSSimpleTypeDecl)itemType;
+        fItemType = itemType;
         fValidationDV = DV_LIST;
         fFacetsDefined = FACET_WHITESPACE;
         fFixedFacet = FACET_WHITESPACE;
@@ -544,7 +544,7 @@
         fAnnotations = annotations;
 
         fVariety = VARIETY_LIST;
-        fItemType = (XSSimpleTypeDecl)itemType;
+        fItemType = itemType;
         fValidationDV = DV_LIST;
         fFacetsDefined = FACET_WHITESPACE;
         fFixedFacet = FACET_WHITESPACE;
@@ -883,9 +883,9 @@
                 fEnumerationSize = 0;
                 for (int i = 0; i < size; i++) {
                     if (enumNSDecls != null)
-                        ctx.setNSContext((NamespaceContext)enumNSDecls.get(i));
+                        ctx.setNSContext(enumNSDecls.get(i));
                     try {
-                        ValidatedInfo info = getActualEnumValue((String)enumVals.get(i), ctx, null);
+                        ValidatedInfo info = getActualEnumValue(enumVals.get(i), ctx, null);
                         // check 4.3.5.c0 must: enumeration values from the value space of base
                         fEnumeration[fEnumerationSize++] = info;
                     } catch (InvalidDatatypeValueException ide) {
@@ -2604,7 +2604,7 @@
                 ((ancestorNS == null && type.getNamespace() == null) ||
                         (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) &&   // compare with ancestor
                         type != fAnySimpleType) {  // reached anySimpleType
-            type = (XSTypeDefinition)type.getBaseType();
+            type = type.getBaseType();
         }
 
         return type != fAnySimpleType;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -81,8 +82,7 @@
         fValidity = attrPSVI.getValidity();
         if (attrPSVI instanceof AttributePSVImpl) {
             final AttributePSVImpl attrPSVIImpl = (AttributePSVImpl) attrPSVI;
-            fErrors = (attrPSVIImpl.fErrors != null) ?
-                    (String[]) attrPSVIImpl.fErrors.clone() : null;
+            fErrors = (attrPSVIImpl.fErrors != null) ? attrPSVIImpl.fErrors.clone() : null;
         }
         else {
             final StringList errorCodes = attrPSVI.getErrorCodes();
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -105,8 +106,7 @@
         fValidationContext = elementPSVI.getValidationContext();
         if (elementPSVI instanceof ElementPSVImpl) {
             final ElementPSVImpl elementPSVIImpl = (ElementPSVImpl) elementPSVI;
-            fErrors = (elementPSVIImpl.fErrors != null) ?
-                    (String[]) elementPSVIImpl.fErrors.clone() : null;
+            fErrors = (elementPSVIImpl.fErrors != null) ? elementPSVIImpl.fErrors.clone() : null;
             elementPSVIImpl.copySchemaInformationTo(this);
         }
         else {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -284,7 +284,7 @@
         short dMethod, bMethod, dSubMethod, bSubMethod;
         for (int i = group.size()-1, j; i >= 0; i--) {
             // Check whether this element is blocked. If so, ignore it.
-            XSElementDecl sub = (XSElementDecl)group.get(i);
+            XSElementDecl sub = group.get(i);
             if (!getDBMethods(sub.fType, element.fType, methods))
                 continue;
             // Remember derivation methods and blocks from the types
@@ -307,7 +307,7 @@
         // Convert to an array
         OneSubGroup[] ret = new OneSubGroup[newGroup.size()];
         for (int i = newGroup.size()-1; i >= 0; i--) {
-            ret[i] = (OneSubGroup)newGroup.get(i);
+            ret[i] = newGroup.get(i);
         }
         // Store the potential sub group
         fSubGroupsB.put(element, ret);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -572,7 +572,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[]) (RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -599,7 +599,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[]) (RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
@@ -3037,7 +3037,7 @@
                     // 5 Let [Definition:]  the wild IDs be the set of all attribute information item to which clause 3.2 applied and whose validation resulted in a context-determined declaration of mustFind or no context-determined declaration at all, and whose [local name] and [namespace name] resolve (as defined by QName resolution (Instance) (3.15.4)) to an attribute declaration whose {type definition} is or is derived from ID. Then all of the following must be true:
                     // 5.1 There must be no more than one item in wild IDs.
                     if (currDecl.fType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE
-                        && ((XSSimpleType) currDecl.fType).isIDType()) {
+                        && (currDecl.fType).isIDType()) {
                         if (wildcardIDName != null) {
                             reportSchemaError(
                                 "cvc-complex-type.5.1",
@@ -4120,7 +4120,7 @@
 
         private ShortList getItemValueTypeAt(int index) {
             if (fUseItemValueTypeVector) {
-                return (ShortList) fItemValueTypes.get(index);
+                return fItemValueTypes.get(index);
             }
             return fItemValueType;
         }
@@ -4245,8 +4245,7 @@
 
             // verify references
             // get the key store corresponding (if it exists):
-            fKeyValueStore =
-                (ValueStoreBase) fValueStoreCache.fGlobalIDConstraintMap.get(
+            fKeyValueStore = fValueStoreCache.fGlobalIDConstraintMap.get(
                     ((KeyRef) fIdentityConstraint).getKey());
 
             if (fKeyValueStore == null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -260,7 +260,7 @@
                   (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) &&   // compare with ancestor
                type != SchemaGrammar.fAnySimpleType &&  // reached anySimpleType
                type != SchemaGrammar.fAnyType) {        // reached anyType
-            type = (XSTypeDefinition)type.getBaseType();
+            type = type.getBaseType();
         }
 
         return type != SchemaGrammar.fAnySimpleType &&
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -165,8 +165,7 @@
             else
                 return false;
         }
-        return checkSimpleDerivation((XSSimpleType)derived,
-                (XSSimpleType)base, block);
+        return checkSimpleDerivation(derived, (XSSimpleType)base, block);
     }
 
     /**
@@ -177,7 +176,7 @@
         // if derived is anyType, then it's valid only if base is anyType too
         if (derived == SchemaGrammar.fAnyType)
             return derived == base;
-        return checkComplexDerivation((XSComplexTypeDecl)derived, base, block);
+        return checkComplexDerivation(derived, base, block);
     }
 
     /**
@@ -1237,7 +1236,7 @@
         int count = children.size();
         try {
             for (int i = 0; i < count; i++) {
-                XSParticleDecl particle1 = (XSParticleDecl)children.get(i);
+                XSParticleDecl particle1 = children.get(i);
                 particleValidRestriction(particle1, dSGHandler, wildcard, null, false);
 
             }
@@ -1271,9 +1270,9 @@
         int current = 0;
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+            XSParticleDecl particle1 = dChildren.get(i);
             for (int j = current; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+                XSParticleDecl particle2 = bChildren.get(j);
                 current +=1;
                 try {
                     particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
@@ -1289,7 +1288,7 @@
 
         // Now, see if there are some elements in the base we didn't match up
         for (int j=current; j < count2; j++) {
-            XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+            XSParticleDecl particle2 = bChildren.get(j);
             if (!particle2.emptiable()) {
                 throw new XMLSchemaException("rcase-Recurse.2", null);
             }
@@ -1319,10 +1318,10 @@
         boolean foundIt[] = new boolean[count2];
 
         label: for (int i = 0; i<count1; i++) {
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+            XSParticleDecl particle1 = dChildren.get(i);
 
             for (int j = 0; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+                XSParticleDecl particle2 = bChildren.get(j);
                 try {
                     particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
                     if (foundIt[j])
@@ -1341,7 +1340,7 @@
 
         // Now, see if there are some elements in the base we didn't match up
         for (int j=0; j < count2; j++) {
-            XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+            XSParticleDecl particle2 = bChildren.get(j);
             if (!foundIt[j] && !particle2.emptiable()) {
                 throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
             }
@@ -1370,9 +1369,9 @@
         int current = 0;
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+            XSParticleDecl particle1 = dChildren.get(i);
             for (int j = current; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+                XSParticleDecl particle2 = bChildren.get(j);
                 current +=1;
                 try {
                     // IHR: go back one element on b list because the next element may match
@@ -1425,9 +1424,9 @@
 
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+            XSParticleDecl particle1 = dChildren.get(i);
             for (int j = 0; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+                XSParticleDecl particle2 = bChildren.get(j);
                 try {
                     particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
                     continue label;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -52,7 +52,7 @@
     public SchemaGrammar getGrammar(String namespace) {
         if (namespace == null)
             return fNoNSGrammar;
-        return (SchemaGrammar)fGrammarRegistry.get(namespace);
+        return fGrammarRegistry.get(namespace);
     }
 
     /**
@@ -191,7 +191,7 @@
                 // we add them to the vector
                 if(gs == null) continue;
                 for (int j = gs.size() - 1; j >= 0; j--) {
-                    sg2 = (SchemaGrammar)gs.get(j);
+                    sg2 = gs.get(j);
                     if (!grammars.contains(sg2))
                         grammars.add(sg2);
                 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -457,7 +458,7 @@
             XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
             if (minOccurs != 1 || maxOccurs != 1) {
                 if (group.fParticleCount == 1) {
-                    XSParticleDecl particle2 = (XSParticleDecl) group.fParticles[0];
+                    XSParticleDecl particle2 = group.fParticles[0];
                     short type2 = particle2.fType;
                     return ((type2 == XSParticleDecl.PARTICLE_ELEMENT ||
                             type2 == XSParticleDecl.PARTICLE_WILDCARD) &&
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1607,7 +1607,7 @@
             // for each of the values
             int count = values.size();
             for (int i = 1; i < count; i += 2) {
-                elName = (String)values.get(i);
+                elName = values.get(i);
                 try {
                     // and validate it using the XSSimpleType
                     // REVISIT: what would be the proper validation context?
@@ -1824,7 +1824,7 @@
         values[pos++] = value;
     }
     OneAttr get(String key) {
-        OneAttr ret = (OneAttr)items.get(key);
+        OneAttr ret = items.get(key);
         return ret;
     }
 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -2581,7 +2581,7 @@
         List<SchemaGrammar> gs;
         for (int i = 0; i < currGrammars.size(); i++) {
             // get the grammar
-            sg1 = (SchemaGrammar)currGrammars.get(i);
+            sg1 = currGrammars.get(i);
             // we need to add grammars imported by sg1 too
             gs = sg1.getImportedGrammars();
             // for all grammars imported by sg2, but not in the vector
@@ -2591,7 +2591,7 @@
             }
 
             for (int j = gs.size() - 1; j >= 0; j--) {
-                sg2 = (SchemaGrammar)gs.get(j);
+                sg2 = gs.get(j);
                 if (!currGrammars.contains(sg2)) {
                     currGrammars.add(sg2);
                 }
@@ -2606,7 +2606,7 @@
         final XSDDescription desc = new XSDDescription();
 
         for (int i=0; i < length; i++) {
-            final SchemaGrammar sg1 = (SchemaGrammar)grammars.get(i);
+            final SchemaGrammar sg1 = grammars.get(i);
             desc.setNamespace(sg1.getTargetNamespace());
 
             final SchemaGrammar sg2 = findGrammar(desc, false);
@@ -2622,7 +2622,7 @@
         final int size = components.size();
         final XSDDescription desc = new XSDDescription();
         for (int i=0; i<size; i++) {
-            XSObject component = (XSObject) components.get(i);
+            XSObject component = components.get(i);
             if (!canAddComponent(component, desc)) {
                 return false;
             }
@@ -2763,7 +2763,7 @@
         final int size = importedSrc.size();
 
         for (int i=0; i<size; i++) {
-            final SchemaGrammar sg = (SchemaGrammar) importedSrc.get(i);
+            final SchemaGrammar sg =  importedSrc.get(i);
             if (!containedImportedGrammar(importedDst, sg)) {
                 importedDst.add(sg);
             }
@@ -3361,7 +3361,7 @@
         SchemaGrammar sg;
 
         for (int i=0; i<size; i++) {
-            sg = (SchemaGrammar) importedGrammar.get(i);
+            sg =  importedGrammar.get(i);
             if (null2EmptyString(sg.getTargetNamespace()).equals(null2EmptyString(grammar.getTargetNamespace()))) {
                 return true;
             }
@@ -3766,7 +3766,7 @@
         }
         else {
             Element collidingElem = (Element)objElem;
-            XSDocumentInfo collidingElemSchema = (XSDocumentInfo)registry_sub.get(qName);
+            XSDocumentInfo collidingElemSchema = registry_sub.get(qName);
             if (collidingElem == currComp) return;
             Element elemParent = null;
             XSDocumentInfo redefinedSchema = null;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -296,7 +296,7 @@
             // for each qname in the list
             for (int i = 0; i < size; i++) {
                 // get the type decl
-                dv = findDTValidator(child, name, (QName)memberTypes.get(i),
+                dv = findDTValidator(child, name, memberTypes.get(i),
                         XSConstants.DERIVATION_UNION, schemaDoc);
                 if (dv != null) {
                     // if it's a union, expand it
@@ -389,7 +389,7 @@
                     annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
         }
         else if (union) {
-            XSSimpleType[] memberDecls = (XSSimpleType[]) dTValidators.toArray(new XSSimpleType[dTValidators.size()]);
+            XSSimpleType[] memberDecls = dTValidators.toArray(new XSSimpleType[dTValidators.size()]);
             newDecl = fSchemaHandler.fDVFactory.createTypeUnion(name, schemaDoc.fTargetNamespace, (short)finalProperty, memberDecls,
                     annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -61,7 +61,7 @@
             return;
         }
 
-        UniqueOrKey uniqueOrKey = null;
+        UniqueOrKey uniqueOrKey;
         if(DOMUtil.getLocalName(uElem).equals(SchemaSymbols.ELT_UNIQUE)) {
             uniqueOrKey = new UniqueOrKey(schemaDoc.fTargetNamespace, uName, element.fName, IdentityConstraint.IC_UNIQUE);
         } else {
@@ -89,7 +89,7 @@
             if (fSchemaHandler.fTolerateDuplicates) {
                 if (idc != null) {
                     if (idc instanceof UniqueOrKey) {
-                        uniqueOrKey = (UniqueOrKey) uniqueOrKey;
+                        uniqueOrKey = (UniqueOrKey)idc;
                     }
                 }
                 fSchemaHandler.addIDConstraintDecl(uniqueOrKey);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -64,7 +64,7 @@
         if (size == 0) {
             return toXSModel(new SchemaGrammar[0], schemaVersion);
         }
-        SchemaGrammar[] gs = (SchemaGrammar[])list.toArray(new SchemaGrammar[size]);
+        SchemaGrammar[] gs = list.toArray(new SchemaGrammar[size]);
         return toXSModel(gs, schemaVersion);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SimpleXMLSchema.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SimpleXMLSchema.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -52,7 +52,7 @@
 
     public Grammar[] retrieveInitialGrammarSet(String grammarType) {
         return XMLGrammarDescription.XML_SCHEMA.equals(grammarType) ?
-                (Grammar[]) fGrammars.clone() : ZERO_LENGTH_GRAMMAR_ARRAY;
+                fGrammars.clone() : ZERO_LENGTH_GRAMMAR_ARRAY;
     }
 
     public void cacheGrammars(String grammarType, Grammar[] grammars) {}
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -191,7 +191,7 @@
             int hash = hashCode(desc);
             int index = (hash & 0x7FFFFFFF) % fGrammars.length;
             for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
-                Grammar tempGrammar = (Grammar) entry.grammar.get();
+                Grammar tempGrammar = entry.grammar.get();
                 /** If the soft reference has been cleared, remove this entry from the pool. */
                 if (tempGrammar == null) {
                     removeEntry(entry);
@@ -241,7 +241,7 @@
             int hash = hashCode(desc);
             int index = (hash & 0x7FFFFFFF) % fGrammars.length;
             for (Entry entry = fGrammars[index]; entry != null ; entry = entry.next) {
-                Grammar tempGrammar = (Grammar) entry.grammar.get();
+                Grammar tempGrammar = entry.grammar.get();
                 /** If the soft reference has been cleared, remove this entry from the pool. */
                 if (tempGrammar == null) {
                     removeEntry(entry);
@@ -363,7 +363,7 @@
         }
         --fGrammarCount;
         entry.grammar.entry = null;
-        return (Grammar) entry.grammar.get();
+        return entry.grammar.get();
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1931,7 +1931,7 @@
         if (DEBUG_EVENTS) {
             System.out.println ("==>internalEntityDecl: "+name);
             if (DEBUG_BASEURI) {
-                System.out.println ("   baseURI:"+ (String)fBaseURIStack.peek ());
+                System.out.println ("   baseURI:"+ fBaseURIStack.peek ());
             }
         }
         // internal subset string
@@ -1966,7 +1966,7 @@
             EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
             if (entity == null) {
                 entity = (EntityImpl)fDocumentImpl.createEntity (name);
-                entity.setBaseURI ((String)fBaseURIStack.peek ());
+                entity.setBaseURI (fBaseURIStack.peek ());
                 entities.setNamedItem (entity);
             }
         }
@@ -1988,7 +1988,7 @@
             }
             if (!found) {
                 int entityIndex =
-                fDeferredDocumentImpl.createDeferredEntity (name, null, null, null, (String)fBaseURIStack.peek ());
+                fDeferredDocumentImpl.createDeferredEntity (name, null, null, null, fBaseURIStack.peek ());
                 fDeferredDocumentImpl.appendChild (fDocumentTypeIndex, entityIndex);
             }
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -142,7 +142,7 @@
                     xmlInputSource.setCharacterStream(charStream);
                 }
                 else if (byteStream != null) {
-                    xmlInputSource.setByteStream((InputStream) byteStream);
+                    xmlInputSource.setByteStream(byteStream);
                 }
                 else if (data != null && data.length() != 0) {
                     xmlInputSource.setCharacterStream(new StringReader(data));
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/SymbolHash.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/SymbolHash.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -191,7 +191,7 @@
     public SymbolHash makeClone() {
         SymbolHash newTable = new SymbolHash(fTableSize);
         newTable.fNum = fNum;
-        newTable.fHashMultipliers = fHashMultipliers != null ? (int[]) fHashMultipliers.clone() : null;
+        newTable.fHashMultipliers = fHashMultipliers != null ? fHashMultipliers.clone() : null;
         for (int i = 0; i < fTableSize; i++) {
             if (fBuckets[i] != null) {
                 newTable.fBuckets[i] = fBuckets[i].makeClone();
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,8 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
- * @modifiedBy: Oracle Inc.
- * @modifiedOn: Nov 2015, Sept 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -621,7 +619,7 @@
      */
     @Override
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -658,7 +656,7 @@
      */
     @Override
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
@@ -1772,7 +1770,7 @@
 
                 // Parse the XPointer expression
                 try {
-                    ((XPointerProcessor)fXPtrProcessor).parseXPointer(xpointer);
+                    fXPtrProcessor.parseXPointer(xpointer);
 
                 } catch (XNIException ex) {
                     // report the XPointer error as a resource error
@@ -1803,7 +1801,7 @@
                 // If the xpointer attribute is present
                 if (xpointer != null ) {
                         // and it was not resolved
-                        if (!((XPointerProcessor)fXPtrProcessor).isXPointerResolved()) {
+                        if (!fXPtrProcessor.isXPointerResolved()) {
                         Locale locale = (fErrorReporter != null) ? fErrorReporter.getLocale() : null;
                         String reason = fXIncludeMessageFormatter.formatMessage(locale, "XPointerResolutionUnsuccessful", null);
                         reportResourceError("XMLResourceError", new Object[] {href, reason});
@@ -2841,9 +2839,9 @@
         fLiteralSystemID.pop();
         fExpandedSystemID.pop();
         fBaseURIScope.pop();
-        fCurrentBaseURI.setBaseSystemId((String)fBaseURI.peek());
-        fCurrentBaseURI.setLiteralSystemId((String)fLiteralSystemID.peek());
-        fCurrentBaseURI.setExpandedSystemId((String)fExpandedSystemID.peek());
+        fCurrentBaseURI.setBaseSystemId(fBaseURI.peek());
+        fCurrentBaseURI.setLiteralSystemId(fLiteralSystemID.peek());
+        fCurrentBaseURI.setExpandedSystemId(fExpandedSystemID.peek());
     }
 
     // The following methods are used for language processing
@@ -2864,7 +2862,7 @@
     public String restoreLanguage() {
         fLanguageStack.pop();
         fLanguageScope.pop();
-        return (String) fLanguageStack.peek();
+        return fLanguageStack.peek();
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -571,7 +571,7 @@
                                 handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName());
       }
       else
-                                handle = ((DOM2DTM)dtm).getHandleOfNode(node);
+                                handle = dtm.getHandleOfNode(node);
 
       if(DTM.NULL == handle)
         throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!");
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -74,7 +74,7 @@
         if (dtmIterator != null) {
             int pos = dtmIterator.getCurrentPos();
             try {
-                m_iter=(DTMIterator)dtmIterator.cloneWithReset();
+                m_iter = dtmIterator.cloneWithReset();
             } catch(CloneNotSupportedException cnse) {
                 m_iter = dtmIterator;
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -335,7 +335,7 @@
   @Override
   public final short getNodeType()
   {
-    return (short) dtm.getNodeType(node);
+    return dtm.getNodeType(node);
   }
 
   /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1902,7 +1902,7 @@
         }
         for ( int i = _elementStateCount ; i > 0 ; --i ) {
             if ( _elementStates[ i ].prefixes != null ) {
-                prefix = (String) _elementStates[ i ].prefixes.get( namespaceURI );
+                prefix = _elementStates[ i ].prefixes.get( namespaceURI );
                 if ( prefix != null )
                     return prefix;
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -250,7 +250,7 @@
         {
             if (m_nodeStack.isEmpty())
                 return;
-            MappingRecord map = (MappingRecord)(m_nodeStack.peek());
+            MappingRecord map = m_nodeStack.peek();
             int depth = map.m_declarationDepth;
             if (depth < elemDepth)
                 return;
@@ -258,7 +258,7 @@
              * so get rid of it
              */
 
-            map = (MappingRecord) m_nodeStack.pop();
+            map = m_nodeStack.pop();
             final String prefix = map.m_prefix;
             popNamespace(prefix);
             if (saxHandler != null)
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1667,7 +1667,7 @@
             startClean =
                 accumDefaultEscape(
                     m_writer,
-                    (char)ch,
+                    ch,
                     i,
                     chars,
                     end,
@@ -2739,9 +2739,8 @@
                     // whitspace separated "{uri1}local1 {uri2}local2 ..."
                     if (i != 0)
                         sb.append(' ');
-                    final String uri = (String) URI_and_localNames.get(i);
-                    final String localName =
-                        (String) URI_and_localNames.get(i + 1);
+                    final String uri = URI_and_localNames.get(i);
+                    final String localName = URI_and_localNames.get(i + 1);
                     if (uri != null) {
                         // If there is no URI don't put this in, just the localName then.
                         sb.append('{');
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -350,7 +350,7 @@
 
     runTo(index);
 
-    return (Node) this.elementAt(index);
+    return this.elementAt(index);
   }
 
   /**
@@ -582,7 +582,7 @@
 
     for (i = end; i >= start; i--)
     {
-      Node child = (Node) elementAt(i);
+      Node child = elementAt(i);
 
       if (child == node)
       {
@@ -648,7 +648,7 @@
 
       for (i = size - 1; i >= 0; i--)
       {
-        Node child = (Node) elementAt(i);
+        Node child = elementAt(i);
 
         if (child == node)
         {
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/VariableStack.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/VariableStack.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -63,8 +63,8 @@
     VariableStack vs = (VariableStack) super.clone();
 
     // I *think* I can get away with a shallow clone here?
-    vs._stackFrames = (XObject[]) _stackFrames.clone();
-    vs._links = (int[]) _links.clone();
+    vs._stackFrames = _stackFrames.clone();
+    vs._links = _links.clone();
 
     return vs;
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -294,7 +294,7 @@
   public int asNode(XPathContext xctxt)
     throws javax.xml.transform.TransformerException
   {
-    DTMIterator iter = (DTMIterator)m_clones.getInstance();
+    DTMIterator iter = m_clones.getInstance();
 
     int current = xctxt.getCurrentNode();
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -470,7 +470,7 @@
 
     try
     {
-      Integer itok = (Integer) Keywords.getKeyWord(key);
+      Integer itok = Keywords.getKeyWord(key);
 
       tok = (null != itok) ? itok.intValue() : 0;
     }
@@ -587,8 +587,7 @@
       try
       {
         if (prefix.length() > 0)
-          uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
-            prefix);
+          uName = m_namespaceContext.getNamespaceForPrefix(prefix);
         else
         {
 
@@ -608,9 +607,7 @@
           }
           else
           {
-            uName =
-              ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
-                prefix);
+            uName = m_namespaceContext.getNamespaceForPrefix(prefix);
           }
         }
       }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMap.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMap.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -446,7 +446,7 @@
     // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
     //                                  : ((argLenOfStep == 1) ? -3 : -2);
     if (index >= 0)
-      return (String) m_tokenQueue.elementAt(index).toString();
+      return m_tokenQueue.elementAt(index).toString();
     else if (OpCodes.ELEMWILDCARD == index)
       return NodeTest.WILD;
     else
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -137,7 +137,7 @@
                 if ( argument instanceof XNodeSet ) {
                     argList.add ( i, ((XNodeSet)argument).nodelist() );
                 } else if ( argument instanceof XObject ) {
-                    Object passedArgument = ((XObject)argument).object();
+                    Object passedArgument = argument.object();
                     argList.add ( i, passedArgument );
                 } else {
                     argList.add ( i, argument );
@@ -188,7 +188,7 @@
                 if ( argument instanceof XNodeSet ) {
                     argList.add ( i, ((XNodeSet)argument).nodelist() );
                 } else if ( argument instanceof XObject ) {
-                    Object passedArgument = ((XObject)argument).object();
+                    Object passedArgument = argument.object();
                     argList.add ( i, passedArgument );
                 } else {
                     argList.add ( i, argument );
--- a/src/java.xml/share/classes/javax/xml/xpath/XPathException.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/javax/xml/xpath/XPathException.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -110,7 +110,7 @@
             throws IOException
     {
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("cause", (Throwable) super.getCause());
+        fields.put("cause", super.getCause());
         out.writeFields();
     }
 
--- a/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java	Fri Nov 10 18:50:32 2017 +0100
@@ -213,8 +213,7 @@
         int size = sources.size();
         String name = null;
         for (int i = 0; i < size; i++) {
-            DOMImplementationSource source =
-                (DOMImplementationSource) sources.get(i);
+            DOMImplementationSource source = sources.get(i);
             DOMImplementation impl = source.getDOMImplementation(features);
             if (impl != null) {
                 return impl;
@@ -238,8 +237,7 @@
         final List<DOMImplementation> implementations = new ArrayList<>();
         int size = sources.size();
         for (int i = 0; i < size; i++) {
-            DOMImplementationSource source =
-                (DOMImplementationSource) sources.get(i);
+            DOMImplementationSource source = sources.get(i);
             DOMImplementationList impls =
                 source.getDOMImplementationList(features);
             for (int j = 0; j < impls.getLength(); j++) {
@@ -251,8 +249,7 @@
                 public DOMImplementation item(final int index) {
                     if (index >= 0 && index < implementations.size()) {
                         try {
-                            return (DOMImplementation)
-                                implementations.get(index);
+                            return implementations.get(index);
                         } catch (IndexOutOfBoundsException e) {
                             return null;
                         }
--- a/src/java.xml/share/classes/org/xml/sax/helpers/NamespaceSupport.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/java.xml/share/classes/org/xml/sax/helpers/NamespaceSupport.java	Fri Nov 10 18:50:32 2017 +0100
@@ -666,7 +666,7 @@
             // Start by looking in the cache, and
             // return immediately if the name
             // is already known in this content
-            name = (String[])table.get(qName);
+            name = table.get(qName);
             if (name != null) {
                 return name;
             }
@@ -703,7 +703,7 @@
                 if ("".equals(prefix)) {
                     uri = defaultNS;
                 } else {
-                    uri = (String)prefixTable.get(prefix);
+                    uri = prefixTable.get(prefix);
                 }
                 if (uri == null
                         || (!isAttribute && "xmlns".equals (prefix))) {
@@ -735,7 +735,7 @@
             } else if (prefixTable == null) {
                 return null;
             } else {
-                return (String)prefixTable.get(prefix);
+                return prefixTable.get(prefix);
             }
         }
 
@@ -755,7 +755,7 @@
             if (uriTable == null) {
                 return null;
             } else {
-                return (String)uriTable.get(uri);
+                return uriTable.get(uri);
             }
         }
 
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -778,7 +778,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -350,7 +350,7 @@
             {"Africa/Johannesburg", SAST},
             {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
-            {"Africa/Khartoum", EAT},
+            {"Africa/Khartoum", CAT},
             {"Africa/Kigali", CAT},
             {"Africa/Kinshasa", WAT},
             {"Africa/Lagos", WAT},
@@ -375,7 +375,7 @@
             {"Africa/Timbuktu", GMT},
             {"Africa/Tripoli", EET},
             {"Africa/Tunis", CET},
-            {"Africa/Windhoek", WAT},
+            {"Africa/Windhoek", CAT},
             {"America/Adak", HST},
             {"America/Anguilla", AST},
             {"America/Antigua", AST},
@@ -780,7 +780,6 @@
             {"Brazil/West", AMT},
             {"Canada/Atlantic", AST},
             {"Canada/Central", CST},
-            {"Canada/East-Saskatchewan", CST},
             {"Canada/Eastern", EST},
             {"Canada/Mountain", MST},
             {"Canada/Newfoundland", NST},
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDebug.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDebug.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, 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
@@ -36,7 +36,7 @@
 import jdk.nashorn.internal.objects.annotations.Where;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.JSType;
-import jdk.nashorn.internal.runtime.PropertyListeners;
+import jdk.nashorn.internal.runtime.PropertySwitchPoints;
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.Scope;
 import jdk.nashorn.internal.runtime.ScriptFunction;
@@ -244,7 +244,7 @@
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
     public static int getListenerCount(final Object self, final Object obj) {
-        return (obj instanceof ScriptObject) ? PropertyListeners.getListenerCount((ScriptObject) obj) : 0;
+        return (obj instanceof ScriptObject) ? PropertySwitchPoints.getSwitchPointCount((ScriptObject) obj) : 0;
     }
 
     /**
@@ -260,8 +260,8 @@
 
         out.println("ScriptObject count " + ScriptObject.getCount());
         out.println("Scope count " + Scope.getScopeCount());
-        out.println("ScriptObject listeners added " + PropertyListeners.getListenersAdded());
-        out.println("ScriptObject listeners removed " + PropertyListeners.getListenersRemoved());
+        out.println("Property SwitchPoints added " + PropertySwitchPoints.getSwitchPointsAdded());
+        out.println("Property SwitchPoints invalidated " + PropertySwitchPoints.getSwitchPointsInvalidated());
         out.println("ScriptFunction constructor calls " + ScriptFunction.getConstructorCount());
         out.println("ScriptFunction invokes " + ScriptFunction.getInvokes());
         out.println("ScriptFunction allocations " + ScriptFunction.getAllocations());
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFunction.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFunction.java	Fri Nov 10 18:50:32 2017 +0100
@@ -35,6 +35,7 @@
 import java.util.List;
 import jdk.dynalink.linker.support.Lookup;
 import jdk.nashorn.api.scripting.JSObject;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Constructor;
 import jdk.nashorn.internal.objects.annotations.Function;
@@ -101,8 +102,13 @@
 
         if (self instanceof ScriptFunction) {
             return ScriptRuntime.apply((ScriptFunction)self, thiz, args);
+        } else if (self instanceof ScriptObjectMirror) {
+            return ((JSObject)self).call(thiz, args);
         } else if (self instanceof JSObject) {
-            return ((JSObject)self).call(thiz, args);
+            final Global global = Global.instance();
+            final Object result = ((JSObject) self).call(ScriptObjectMirror.wrap(thiz, global),
+                    ScriptObjectMirror.wrapArray(args, global));
+            return ScriptObjectMirror.unwrap(result, global);
         }
         throw new AssertionError("Should not reach here");
     }
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyListeners.java	Mon Nov 06 20:03:58 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-/*
- * 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
- * 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 jdk.nashorn.internal.runtime;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.WeakHashMap;
-import java.util.concurrent.atomic.LongAdder;
-
-/**
- * Helper class to manage property listeners and notification.
- */
-public class PropertyListeners {
-
-    private Map<Object, WeakPropertyMapSet> listeners;
-
-    // These counters are updated in debug mode
-    private static LongAdder listenersAdded;
-    private static LongAdder listenersRemoved;
-
-    static {
-        if (Context.DEBUG) {
-            listenersAdded = new LongAdder();
-            listenersRemoved = new LongAdder();
-        }
-    }
-
-    /**
-     * Copy constructor
-     * @param listener listener to copy
-     */
-    PropertyListeners(final PropertyListeners listener) {
-        if (listener != null && listener.listeners != null) {
-            this.listeners = new WeakHashMap<>();
-            // We need to copy the nested weak sets in order to avoid concurrent modification issues, see JDK-8146274
-            synchronized (listener) {
-                for (final Map.Entry<Object, WeakPropertyMapSet> entry : listener.listeners.entrySet()) {
-                    this.listeners.put(entry.getKey(), new WeakPropertyMapSet(entry.getValue()));
-                }
-            }
-        }
-    }
-
-    /**
-     * Return aggregate listeners added to all PropertyListenerManagers
-     * @return the listenersAdded
-     */
-    public static long getListenersAdded() {
-        return listenersAdded.longValue();
-    }
-
-    /**
-     * Return aggregate listeners removed from all PropertyListenerManagers
-     * @return the listenersRemoved
-     */
-    public static long getListenersRemoved() {
-        return listenersRemoved.longValue();
-    }
-
-    /**
-     * Return number of listeners added to a ScriptObject.
-     * @param obj the object
-     * @return the listener count
-     */
-    public static int getListenerCount(final ScriptObject obj) {
-        return obj.getMap().getListenerCount();
-    }
-
-    /**
-     * Return the number of listeners added to this PropertyListeners instance.
-     * @return the listener count;
-     */
-    public int getListenerCount() {
-        return listeners == null ? 0 : listeners.size();
-    }
-
-    // Property listener management methods
-
-    /**
-     * Add {@code propertyMap} as property listener to {@code listeners} using key {@code key} by
-     * creating and returning a new {@code PropertyListeners} instance.
-     *
-     * @param listeners the original property listeners instance, may be null
-     * @param key the property key
-     * @param propertyMap the property map
-     * @return the new property map
-     */
-    public static PropertyListeners addListener(final PropertyListeners listeners, final String key, final PropertyMap propertyMap) {
-        final PropertyListeners newListeners;
-        if (listeners == null || !listeners.containsListener(key, propertyMap)) {
-            newListeners = new PropertyListeners(listeners);
-            newListeners.addListener(key, propertyMap);
-            return newListeners;
-        }
-        return listeners;
-    }
-
-    /**
-     * Checks whether {@code propertyMap} is registered as listener with {@code key}.
-     *
-     * @param key the property key
-     * @param propertyMap the property map
-     * @return true if property map is registered with property key
-     */
-    synchronized boolean containsListener(final String key, final PropertyMap propertyMap) {
-        if (listeners == null) {
-            return false;
-        }
-        final WeakPropertyMapSet set = listeners.get(key);
-        return set != null && set.contains(propertyMap);
-    }
-
-    /**
-     * Add a property listener to this object.
-     *
-     * @param propertyMap The property listener that is added.
-     */
-    synchronized final void addListener(final String key, final PropertyMap propertyMap) {
-        if (Context.DEBUG) {
-            listenersAdded.increment();
-        }
-        if (listeners == null) {
-            listeners = new WeakHashMap<>();
-        }
-
-        WeakPropertyMapSet set = listeners.get(key);
-        if (set == null) {
-            set = new WeakPropertyMapSet();
-            listeners.put(key, set);
-        }
-        if (!set.contains(propertyMap)) {
-            set.add(propertyMap);
-        }
-    }
-
-    /**
-     * A new property is being added.
-     *
-     * @param prop The new Property added.
-     */
-    public synchronized void propertyAdded(final Property prop) {
-        if (listeners != null) {
-            final WeakPropertyMapSet set = listeners.get(prop.getKey());
-            if (set != null) {
-                for (final PropertyMap propertyMap : set.elements()) {
-                    propertyMap.propertyAdded(prop, false);
-                }
-                listeners.remove(prop.getKey());
-                if (Context.DEBUG) {
-                    listenersRemoved.increment();
-                }
-            }
-        }
-    }
-
-    /**
-     * An existing property is being deleted.
-     *
-     * @param prop The property being deleted.
-     */
-    public synchronized void propertyDeleted(final Property prop) {
-        if (listeners != null) {
-            final WeakPropertyMapSet set = listeners.get(prop.getKey());
-            if (set != null) {
-                for (final PropertyMap propertyMap : set.elements()) {
-                    propertyMap.propertyDeleted(prop, false);
-                }
-                listeners.remove(prop.getKey());
-                if (Context.DEBUG) {
-                    listenersRemoved.increment();
-                }
-            }
-        }
-    }
-
-    /**
-     * An existing Property is being replaced with a new Property.
-     *
-     * @param oldProp The old property that is being replaced.
-     * @param newProp The new property that replaces the old property.
-     *
-     */
-    public synchronized void propertyModified(final Property oldProp, final Property newProp) {
-        if (listeners != null) {
-            final WeakPropertyMapSet set = listeners.get(oldProp.getKey());
-            if (set != null) {
-                for (final PropertyMap propertyMap : set.elements()) {
-                    propertyMap.propertyModified(oldProp, newProp, false);
-                }
-                listeners.remove(oldProp.getKey());
-                if (Context.DEBUG) {
-                    listenersRemoved.increment();
-                }
-            }
-        }
-    }
-
-    /**
-     * Callback for when a proto is changed
-     */
-    public synchronized void protoChanged() {
-        if (listeners != null) {
-            for (final WeakPropertyMapSet set : listeners.values()) {
-                for (final PropertyMap propertyMap : set.elements()) {
-                    propertyMap.protoChanged(false);
-                }
-            }
-            listeners.clear();
-        }
-    }
-
-    private static class WeakPropertyMapSet {
-
-        private final WeakHashMap<PropertyMap, Boolean> map;
-
-        WeakPropertyMapSet() {
-            this.map = new WeakHashMap<>();
-        }
-
-        WeakPropertyMapSet(final WeakPropertyMapSet set) {
-            this.map = new WeakHashMap<>(set.map);
-        }
-
-        void add(final PropertyMap propertyMap) {
-            map.put(propertyMap, Boolean.TRUE);
-        }
-
-        boolean contains(final PropertyMap propertyMap) {
-            return map.containsKey(propertyMap);
-        }
-
-        Set<PropertyMap> elements() {
-            return map.keySet();
-        }
-
-    }
-}
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,9 +40,9 @@
 import java.util.Arrays;
 import java.util.BitSet;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
+import java.util.Set;
 import java.util.WeakHashMap;
 import java.util.concurrent.atomic.LongAdder;
 import jdk.nashorn.internal.runtime.options.Options;
@@ -95,17 +95,14 @@
      * property map should only be used if it the same as the actual prototype map. */
     private transient SharedPropertyMap sharedProtoMap;
 
-    /** {@link SwitchPoint}s for gets on inherited properties. */
-    private transient HashMap<Object, SwitchPoint> protoSwitches;
-
     /** History of maps, used to limit map duplication. */
     private transient WeakHashMap<Property, Reference<PropertyMap>> history;
 
     /** History of prototypes, used to limit map duplication. */
     private transient WeakHashMap<ScriptObject, SoftReference<PropertyMap>> protoHistory;
 
-    /** property listeners */
-    private transient PropertyListeners listeners;
+    /** SwitchPoints for properties inherited form this map */
+    private transient PropertySwitchPoints propertySwitchPoints;
 
     private transient BitSet freeSlots;
 
@@ -147,8 +144,8 @@
         this.fieldCount   = fieldCount;
         this.fieldMaximum = propertyMap.fieldMaximum;
         this.className    = propertyMap.className;
-        // We inherit the parent property listeners instance. It will be cloned when a new listener is added.
-        this.listeners    = propertyMap.listeners;
+        // We inherit the parent property propertySwitchPoints instance. It will be cloned when a new listener is added.
+        this.propertySwitchPoints = propertyMap.propertySwitchPoints;
         this.freeSlots    = propertyMap.freeSlots;
         this.sharedProtoMap = propertyMap.sharedProtoMap;
         this.softReferenceDerivationLimit = softReferenceDerivationLimit;
@@ -245,142 +242,70 @@
     }
 
     /**
-     * Get the number of listeners of this map
+     * Get the number of property SwitchPoints of this map
      *
-     * @return the number of listeners
+     * @return the number of property SwitchPoints
      */
-    public int getListenerCount() {
-        return listeners == null ? 0 : listeners.getListenerCount();
+    public int getSwitchPointCount() {
+        return propertySwitchPoints == null ? 0 : propertySwitchPoints.getSwitchPointCount();
     }
 
     /**
-     * Add {@code listenerMap} as a listener to this property map for the given {@code key}.
+     * Add a property switchpoint to this property map for the given {@code key}.
      *
      * @param key the property name
-     * @param listenerMap the listener map
+     * @param switchPoint the switchpoint
      */
-    public void addListener(final String key, final PropertyMap listenerMap) {
-        if (listenerMap != this) {
-            // We need to clone listener instance when adding a new listener since we share
-            // the listeners instance with our parent maps that don't need to see the new listener.
-            listeners = PropertyListeners.addListener(listeners, key, listenerMap);
+    public void addSwitchPoint(final String key, final SwitchPoint switchPoint) {
+        // We need to clone listener instance when adding a new listener since we share
+        // the propertySwitchPoints instance with our parent maps that don't need to see the new listener.
+        propertySwitchPoints = PropertySwitchPoints.addSwitchPoint(propertySwitchPoints, key, switchPoint);
+    }
+
+    /**
+     * Method called when a property of an object using this property map is being created,
+     * modified, or deleted. If a switchpoint for the property exists it will be invalidated.
+     *
+     * @param property The changed property.
+     */
+    public void propertyChanged(final Property property) {
+        if (propertySwitchPoints != null) {
+            propertySwitchPoints.invalidateProperty(property);
         }
     }
 
     /**
-     * A new property is being added.
-     *
-     * @param property The new Property added.
-     * @param isSelf was the property added to this map?
+     * Method called when the prototype of an object using this property map is changed.
      */
-    public void propertyAdded(final Property property, final boolean isSelf) {
-        if (!isSelf) {
-            invalidateProtoSwitchPoint(property.getKey());
+    void protoChanged() {
+        if (sharedProtoMap != null) {
+            sharedProtoMap.invalidateSwitchPoint();
         }
-        if (listeners != null) {
-            listeners.propertyAdded(property);
+        if (propertySwitchPoints != null) {
+            propertySwitchPoints.invalidateInheritedProperties(this);
         }
     }
 
     /**
-     * An existing property is being deleted.
-     *
-     * @param property The property being deleted.
-     * @param isSelf was the property deleted from this map?
-     */
-    public void propertyDeleted(final Property property, final boolean isSelf) {
-        if (!isSelf) {
-            invalidateProtoSwitchPoint(property.getKey());
-        }
-        if (listeners != null) {
-            listeners.propertyDeleted(property);
-        }
-    }
-
-    /**
-     * An existing property is being redefined.
-     *
-     * @param oldProperty The old property
-     * @param newProperty The new property
-     * @param isSelf was the property modified on this map?
-     */
-    public void propertyModified(final Property oldProperty, final Property newProperty, final boolean isSelf) {
-        if (!isSelf) {
-            invalidateProtoSwitchPoint(oldProperty.getKey());
-        }
-        if (listeners != null) {
-            listeners.propertyModified(oldProperty, newProperty);
-        }
-    }
-
-    /**
-     * The prototype of an object associated with this {@link PropertyMap} is changed.
-     *
-     * @param isSelf was the prototype changed on the object using this map?
-     */
-    public void protoChanged(final boolean isSelf) {
-        if (!isSelf) {
-            invalidateAllProtoSwitchPoints();
-        } else if (sharedProtoMap != null) {
-            sharedProtoMap.invalidateSwitchPoint();
-        }
-        if (listeners != null) {
-            listeners.protoChanged();
-        }
-    }
-
-    /**
-     * Return a SwitchPoint used to track changes of a property in a prototype.
+     * Returns a SwitchPoint for use with a property inherited from this or a parent map.
+     * If such a switchpoint exists, it will be invalidated when the property is modified
+     * in an object using this map. This method returns {@code null} if no swichpoint exists
+     * for the property.
      *
      * @param key Property key.
-     * @return A shared {@link SwitchPoint} for the property.
+     * @return A {@link SwitchPoint} for the property, or null.
      */
     public synchronized SwitchPoint getSwitchPoint(final String key) {
-        if (protoSwitches == null) {
-            protoSwitches = new HashMap<>();
+        if (propertySwitchPoints != null) {
+            final Set<SwitchPoint> existingSwitchPoints = propertySwitchPoints.getSwitchPoints(key);
+            for (final SwitchPoint switchPoint : existingSwitchPoints) {
+                if (switchPoint != null && !switchPoint.hasBeenInvalidated()) {
+                    return switchPoint;
+                }
+            }
         }
 
-        SwitchPoint switchPoint = protoSwitches.get(key);
-        if (switchPoint == null) {
-            switchPoint = new SwitchPoint();
-            protoSwitches.put(key, switchPoint);
-        }
-
-        return switchPoint;
-    }
-
-    /**
-     * Indicate that a prototype property has changed.
-     *
-     * @param key {@link Property} key to invalidate.
-     */
-    synchronized void invalidateProtoSwitchPoint(final Object key) {
-        if (protoSwitches != null) {
-            final SwitchPoint sp = protoSwitches.get(key);
-            if (sp != null) {
-                protoSwitches.remove(key);
-                if (Context.DEBUG) {
-                    protoInvalidations.increment();
-                }
-                SwitchPoint.invalidateAll(new SwitchPoint[]{sp});
-            }
-        }
-    }
-
-    /**
-     * Indicate that proto itself has changed in hierarchy somewhere.
-     */
-    synchronized void invalidateAllProtoSwitchPoints() {
-        if (protoSwitches != null) {
-            final int size = protoSwitches.size();
-            if (size > 0) {
-                if (Context.DEBUG) {
-                    protoInvalidations.add(size);
-                }
-                SwitchPoint.invalidateAll(protoSwitches.values().toArray(new SwitchPoint[0]));
-                protoSwitches.clear();
-            }
-        }
+        return null;
     }
 
     /**
@@ -452,7 +377,7 @@
      * @return New {@link PropertyMap} with {@link Property} added.
      */
     public final PropertyMap addPropertyNoHistory(final Property property) {
-        propertyAdded(property, true);
+        propertyChanged(property);
         return addPropertyInternal(property);
     }
 
@@ -464,7 +389,7 @@
      * @return New {@link PropertyMap} with {@link Property} added.
      */
     public final synchronized PropertyMap addProperty(final Property property) {
-        propertyAdded(property, true);
+        propertyChanged(property);
         PropertyMap newMap = checkHistory(property);
 
         if (newMap == null) {
@@ -494,7 +419,7 @@
      * @return New {@link PropertyMap} with {@link Property} removed or {@code null} if not found.
      */
     public final synchronized PropertyMap deleteProperty(final Property property) {
-        propertyDeleted(property, true);
+        propertyChanged(property);
         PropertyMap newMap = checkHistory(property);
         final Object key = property.getKey();
 
@@ -529,7 +454,7 @@
      * @return New {@link PropertyMap} with {@link Property} replaced.
      */
     public final PropertyMap replaceProperty(final Property oldProperty, final Property newProperty) {
-        propertyModified(oldProperty, newProperty, true);
+        propertyChanged(oldProperty);
         /*
          * See ScriptObject.modifyProperty and ScriptObject.setUserAccessors methods.
          *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertySwitchPoints.java	Fri Nov 10 18:50:32 2017 +0100
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2010, 2017, 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 jdk.nashorn.internal.runtime;
+
+import java.lang.invoke.SwitchPoint;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.WeakHashMap;
+import java.util.concurrent.atomic.LongAdder;
+
+/**
+ * Helper class for tracking and invalidation of switchpoints for inherited properties.
+ */
+public class PropertySwitchPoints {
+
+    private final Map<Object, WeakSwitchPointSet> switchPointMap = new HashMap<>();
+
+    private final static SwitchPoint[] EMPTY_SWITCHPOINT_ARRAY = new SwitchPoint[0];
+
+    // These counters are updated in debug mode
+    private static LongAdder switchPointsAdded;
+    private static LongAdder switchPointsInvalidated;
+
+    static {
+        if (Context.DEBUG) {
+            switchPointsAdded = new LongAdder();
+            switchPointsInvalidated = new LongAdder();
+        }
+    }
+
+    /**
+     * Copy constructor
+     *
+     * @param switchPoints Proto switchpoints to copy
+     */
+    private PropertySwitchPoints(final PropertySwitchPoints switchPoints) {
+        if (switchPoints != null) {
+            // We need to copy the nested weak sets in order to avoid concurrent modification issues, see JDK-8146274
+            synchronized (switchPoints) {
+                for (final Map.Entry<Object, WeakSwitchPointSet> entry : switchPoints.switchPointMap.entrySet()) {
+                    this.switchPointMap.put(entry.getKey(), new WeakSwitchPointSet(entry.getValue()));
+                }
+            }
+        }
+    }
+
+    /**
+     * Return aggregate switchpoints added to all ProtoSwitchPoints
+     * @return the number of switchpoints added
+     */
+    public static long getSwitchPointsAdded() {
+        return switchPointsAdded.longValue();
+    }
+
+    /**
+     * Return aggregate switchPointMap invalidated in all ProtoSwitchPoints
+     * @return the number of switchpoints invalidated
+     */
+    public static long getSwitchPointsInvalidated() {
+        return switchPointsInvalidated.longValue();
+    }
+
+    /**
+     * Return number of property switchPoints added to a ScriptObject.
+     * @param obj the object
+     * @return the switchpoint count
+     */
+    public static int getSwitchPointCount(final ScriptObject obj) {
+        return obj.getMap().getSwitchPointCount();
+    }
+
+    /**
+     * Return the number of switchpoints added to this ProtoSwitchPoints instance.
+     * @return the switchpoint count;
+     */
+    int getSwitchPointCount() {
+        return switchPointMap.size();
+    }
+
+    /**
+     * Add {@code switchPoint} to the switchpoints for for property {@code key}, creating
+     * and returning a new {@code ProtoSwitchPoints} instance if the switchpoint was not already contained
+     *
+     * @param oldSwitchPoints the original PropertySwitchPoints instance. May be null
+     * @param key the property key
+     * @param switchPoint the switchpoint to be added
+     * @return the new PropertySwitchPoints instance, or this instance if switchpoint was already contained
+     */
+    static PropertySwitchPoints addSwitchPoint(final PropertySwitchPoints oldSwitchPoints, final String key, final SwitchPoint switchPoint) {
+        if (oldSwitchPoints == null || !oldSwitchPoints.contains(key, switchPoint)) {
+            final PropertySwitchPoints newSwitchPoints = new PropertySwitchPoints(oldSwitchPoints);
+            newSwitchPoints.add(key, switchPoint);
+            return newSwitchPoints;
+        }
+        return oldSwitchPoints;
+    }
+
+    /**
+     * Checks whether {@code switchPoint} is contained in {@code key}'s set.
+     *
+     * @param key the property key
+     * @param switchPoint the switchPoint
+     * @return true if switchpoint is already contained for key
+     */
+    private synchronized boolean contains(final String key, final SwitchPoint switchPoint) {
+        final WeakSwitchPointSet set = this.switchPointMap.get(key);
+        return set != null && set.contains(switchPoint);
+    }
+
+    private synchronized void add(final String key, final SwitchPoint switchPoint) {
+        if (Context.DEBUG) {
+            switchPointsAdded.increment();
+        }
+
+        WeakSwitchPointSet set = this.switchPointMap.get(key);
+        if (set == null) {
+            set = new WeakSwitchPointSet();
+            this.switchPointMap.put(key, set);
+        }
+
+        set.add(switchPoint);
+    }
+
+    Set<SwitchPoint> getSwitchPoints(final Object key) {
+        WeakSwitchPointSet switchPointSet = switchPointMap.get(key);
+        if (switchPointSet != null) {
+            return switchPointSet.elements();
+        }
+
+        return Collections.emptySet();
+    }
+
+    /**
+     * Invalidate all switchpoints for the given property. This is called when that
+     * property is created, deleted, or modified in a script object.
+     *
+     * @param prop The property to invalidate.
+     */
+    synchronized void invalidateProperty(final Property prop) {
+        final WeakSwitchPointSet set = switchPointMap.get(prop.getKey());
+        if (set != null) {
+            if (Context.DEBUG) {
+                switchPointsInvalidated.add(set.size());
+            }
+            final SwitchPoint[] switchPoints = set.elements().toArray(EMPTY_SWITCHPOINT_ARRAY);
+            SwitchPoint.invalidateAll(switchPoints);
+            this.switchPointMap.remove(prop.getKey());
+        }
+    }
+
+
+    /**
+     * Invalidate all switchpoints except those defined in {@code map}. This is called
+     * when the prototype of a script object is changed.
+     *
+     * @param map map of properties to exclude from invalidation
+     */
+    synchronized void invalidateInheritedProperties(final PropertyMap map) {
+        for (final Map.Entry<Object, WeakSwitchPointSet> entry : switchPointMap.entrySet()) {
+            if (map.findProperty(entry.getKey()) != null) {
+                continue;
+            }
+            if (Context.DEBUG) {
+                switchPointsInvalidated.add(entry.getValue().size());
+            }
+            final SwitchPoint[] switchPoints = entry.getValue().elements().toArray(EMPTY_SWITCHPOINT_ARRAY);
+            SwitchPoint.invalidateAll(switchPoints);
+        }
+        switchPointMap.clear();
+    }
+
+    private static class WeakSwitchPointSet {
+
+        private final WeakHashMap<SwitchPoint, Void> map;
+
+        WeakSwitchPointSet() {
+            map = new WeakHashMap<>();
+        }
+
+        WeakSwitchPointSet(final WeakSwitchPointSet set) {
+            map = new WeakHashMap<>(set.map);
+        }
+
+        void add(final SwitchPoint switchPoint) {
+            map.put(switchPoint, null);
+        }
+
+        boolean contains(final SwitchPoint switchPoint) {
+            return map.containsKey(switchPoint);
+        }
+
+        Set<SwitchPoint> elements() {
+            return map.keySet();
+        }
+
+        int size() {
+            return map.size();
+        }
+
+    }
+}
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, 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
@@ -1248,7 +1248,7 @@
             proto = newProto;
 
             // Let current listeners know that the prototype has changed
-            getMap().protoChanged(true);
+            getMap().protoChanged();
             // Replace our current allocator map with one that is associated with the new prototype.
             setMap(getMap().changeProto(newProto));
         }
@@ -2107,30 +2107,38 @@
     }
 
     /**
-     * Get a switch point for a property with the given {@code name} that will be invalidated when
-     * the property definition is changed in this object's prototype chain. Returns {@code null} if
-     * the property is defined in this object itself.
+     * Get an array of switch points for a property with the given {@code name} that will be
+     * invalidated when the property definition is changed in this object's prototype chain.
+     * Returns {@code null} if the property is defined in this object itself.
      *
      * @param name the property name
      * @param owner the property owner, null if property is not defined
-     * @return a SwitchPoint or null
+     * @return an array of SwitchPoints or null
      */
     public final SwitchPoint[] getProtoSwitchPoints(final String name, final ScriptObject owner) {
         if (owner == this || getProto() == null) {
             return null;
         }
 
-        final List<SwitchPoint> switchPoints = new ArrayList<>();
-        for (ScriptObject obj = this; obj != owner && obj.getProto() != null; obj = obj.getProto()) {
-            final ScriptObject parent = obj.getProto();
-            parent.getMap().addListener(name, obj.getMap());
-            final SwitchPoint sp = parent.getMap().getSharedProtoSwitchPoint();
-            if (sp != null && !sp.hasBeenInvalidated()) {
-                switchPoints.add(sp);
+        final Set<SwitchPoint> switchPoints = new HashSet<>();
+        SwitchPoint switchPoint = getProto().getMap().getSwitchPoint(name);
+
+        if (switchPoint == null) {
+            switchPoint = new SwitchPoint();
+            for (ScriptObject obj = this; obj != owner && obj.getProto() != null; obj = obj.getProto()) {
+                obj.getProto().getMap().addSwitchPoint(name, switchPoint);
             }
         }
 
-        switchPoints.add(getMap().getSwitchPoint(name));
+        switchPoints.add(switchPoint);
+
+        for (ScriptObject obj = this; obj != owner && obj.getProto() != null; obj = obj.getProto()) {
+            final SwitchPoint sharedProtoSwitchPoint = obj.getProto().getMap().getSharedProtoSwitchPoint();
+            if (sharedProtoSwitchPoint != null && !sharedProtoSwitchPoint.hasBeenInvalidated()) {
+                switchPoints.add(sharedProtoSwitchPoint);
+            }
+        }
+
         return switchPoints.toArray(new SwitchPoint[0]);
     }
 
@@ -2141,12 +2149,16 @@
             return null;
         }
 
-        for (ScriptObject obj = this; obj.getProto() != null; obj = obj.getProto()) {
-            final ScriptObject parent = obj.getProto();
-            parent.getMap().addListener(name, obj.getMap());
+        SwitchPoint switchPoint = getProto().getMap().getSwitchPoint(name);
+
+        if (switchPoint == null) {
+            switchPoint = new SwitchPoint();
+            for (ScriptObject obj = this; obj.getProto() != null; obj = obj.getProto()) {
+                obj.getProto().getMap().addSwitchPoint(name, switchPoint);
+            }
         }
 
-        return getMap().getSwitchPoint(name);
+        return switchPoint;
     }
 
     private void checkSharedProtoMap() {
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SetMethodCreator.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SetMethodCreator.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, 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
@@ -185,7 +185,7 @@
 
     private SetMethod createNewPropertySetter(final SwitchPoint builtinSwitchPoint) {
         final SetMethod sm = map.getFreeFieldSlot() > -1 ? createNewFieldSetter(builtinSwitchPoint) : createNewSpillPropertySetter(builtinSwitchPoint);
-        map.propertyAdded(sm.property, true);
+        map.propertyChanged(sm.property);
         return sm;
     }
 
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SharedPropertyMap.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SharedPropertyMap.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -48,33 +48,15 @@
      * Create a new shared property map from the given {@code map}.
      * @param map property map to copy
      */
-    public SharedPropertyMap(final PropertyMap map) {
+    SharedPropertyMap(final PropertyMap map) {
         super(map);
         this.switchPoint = new SwitchPoint();
     }
 
     @Override
-    public void propertyAdded(final Property property, final boolean isSelf) {
-        if (isSelf) {
-            invalidateSwitchPoint();
-        }
-        super.propertyAdded(property, isSelf);
-    }
-
-    @Override
-    public void propertyDeleted(final Property property, final boolean isSelf) {
-        if (isSelf) {
-            invalidateSwitchPoint();
-        }
-        super.propertyDeleted(property, isSelf);
-    }
-
-    @Override
-    public void propertyModified(final Property oldProperty, final Property newProperty, final boolean isSelf) {
-        if (isSelf) {
-            invalidateSwitchPoint();
-        }
-        super.propertyModified(oldProperty, newProperty, isSelf);
+    public void propertyChanged(final Property property) {
+        invalidateSwitchPoint();
+        super.propertyChanged(property);
     }
 
     @Override
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/BasicStroke/DashScaleMinWidth.java	Fri Nov 10 18:50:32 2017 +0100
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2003, 2017, 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.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.geom.Line2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
+
+/**
+ * @test
+ * @bug 4917097 8019816
+ * @summary 1.4.1 REGRESSION: BasicStroke Dashes don't show when scale * line width = 1.0
+ * @run main/othervm -Dsun.java2d.uiScale=1 DashScaleMinWidth
+ */
+public final class DashScaleMinWidth  {
+
+    public static void main(final String[] args) {
+        BufferedImage img = new BufferedImage(200, 40, TYPE_INT_ARGB);
+        draw(img);
+        validate(img);
+
+        if (GraphicsEnvironment.isHeadless()) {
+            return;
+        }
+
+        GraphicsConfiguration gc =
+                GraphicsEnvironment.getLocalGraphicsEnvironment()
+                        .getDefaultScreenDevice().getDefaultConfiguration();
+
+        VolatileImage vi = gc.createCompatibleVolatileImage(200, 40);
+        BufferedImage snapshot;
+        int attempt = 0;
+        while (true) {
+            if (++attempt > 10) {
+                throw new RuntimeException("Too many attempts: " + attempt);
+            }
+            vi.validate(gc);
+            draw(vi);
+            snapshot = vi.getSnapshot();
+            if (!vi.contentsLost()) {
+                break;
+            }
+        }
+        validate(snapshot);
+    }
+
+    private static void draw(final Image img) {
+        float[] dashes = {200.0f, 200.0f};
+        BasicStroke bs = new BasicStroke(20.0f,
+                                         BasicStroke.CAP_BUTT,
+                                         BasicStroke.JOIN_MITER,
+                                         1.0f,
+                                         dashes,
+                                         0.0f);
+        Graphics2D g = (Graphics2D) img.getGraphics();
+        g.setColor(Color.WHITE);
+        g.fillRect(0, 0, 200, 40);
+        Line2D line = new Line2D.Double(400, 400, 3600, 400);
+        g.setColor(Color.BLACK);
+        g.scale(0.05, 0.05);
+        g.setStroke(bs);
+        g.draw(line);
+        g.dispose();
+    }
+
+    private static void validate(final BufferedImage img) {
+        int white = Color.white.getRGB();
+        int point = img.getRGB(35, 20);   // point in the gap
+        if (point != white) {
+            throw new RuntimeException("Line should be dashed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/BasicStroke/DashZeroWidth.java	Fri Nov 10 18:50:32 2017 +0100
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2003, 2017, 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.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.geom.Line2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
+
+/**
+ * @test
+ * @bug 4779211 8019816
+ * @summary REGRESSION: 1.4 Dashed lines disappear if BasicStroke width=0.0
+ * @run main/othervm -Dsun.java2d.uiScale=1 DashZeroWidth
+ */
+public final class DashZeroWidth {
+
+    public static void main(final String[] args) {
+        BufferedImage img = new BufferedImage(200, 40, TYPE_INT_ARGB);
+        draw(img);
+        validate(img);
+
+        if (GraphicsEnvironment.isHeadless()) {
+            return;
+        }
+
+        GraphicsConfiguration gc =
+                GraphicsEnvironment.getLocalGraphicsEnvironment()
+                        .getDefaultScreenDevice().getDefaultConfiguration();
+
+        VolatileImage vi = gc.createCompatibleVolatileImage(200, 40);
+        BufferedImage snapshot;
+        int attempt = 0;
+        while (true) {
+            if (++attempt > 10) {
+                throw new RuntimeException("Too many attempts: " + attempt);
+            }
+            vi.validate(gc);
+            draw(vi);
+            snapshot = vi.getSnapshot();
+            if (!vi.contentsLost()) {
+                break;
+            }
+        }
+        validate(snapshot);
+    }
+
+    private static void draw(final Image img) {
+        float[] dashes = {10.0f, 10.0f};
+        BasicStroke bs = new BasicStroke(0.0f, BasicStroke.CAP_BUTT,
+                                         BasicStroke.JOIN_BEVEL, 10.0f, dashes,
+                                         0.0f);
+        Graphics2D g = (Graphics2D) img.getGraphics();
+        g.setColor(Color.WHITE);
+        g.fillRect(0, 0, 200, 40);
+        Line2D line = new Line2D.Double(20, 20, 180, 20);
+        g.setColor(Color.BLACK);
+        g.setStroke(bs);
+        g.draw(line);
+        g.dispose();
+    }
+
+    private static void validate(final BufferedImage img) {
+        int black = Color.black.getRGB();
+        int white = Color.white.getRGB();
+        int pointB = img.getRGB(25, 20);   // point on the dash
+        int pointW = img.getRGB(35, 20);   // point in the gap
+        if (pointB != black || pointW != white) {
+            throw new RuntimeException("Line should be visible and dashed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java	Fri Nov 10 18:50:32 2017 +0100
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2017, 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 8164512
+ * @summary verify if the native library is unloaded when the class loader is GC'ed
+ * @build p.Test
+ * @run main/othervm/native -Xcheck:jni NativeLibraryTest
+ */
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class NativeLibraryTest {
+    static final Path CLASSES = Paths.get("classes");
+    static int unloadedCount = 0;
+
+    /*
+     * Called by JNI_OnUnload when the native library is unloaded
+     */
+    static void nativeLibraryUnloaded() {
+        unloadedCount++;
+    }
+
+    public static void main(String... args) throws Exception {
+        setup();
+
+        for (int count=1; count <= 5; count++) {
+            // create a class loader and load a native library
+            runTest();
+            // unloading the class loader and native library
+            System.gc();
+            // give Cleaner thread a chance to unload the native library
+            Thread.sleep(100);
+
+            // unloadedCount is incremented when the native library is unloaded
+            if (count != unloadedCount) {
+                throw new RuntimeException("Expected unloaded=" + count +
+                    " but got=" + unloadedCount);
+            }
+        }
+    }
+
+    /*
+     * Loads p.Test class with a new class loader and its static initializer
+     * will load a native library.
+     *
+     * The class loader becomes unreachable when this method returns and
+     * the native library should be unloaded at some point after the class
+     * loader is garbage collected.
+     */
+    static void runTest() throws Exception {
+        // invoke p.Test.run() that loads the native library
+        Runnable r = newTestRunnable();
+        r.run();
+
+        // reload the native library by the same class loader
+        r.run();
+
+        // load the native library by another class loader
+        Runnable r1 = newTestRunnable();
+        try {
+            r1.run();
+            throw new RuntimeException("should fail to load the native library" +
+                    " by another class loader");
+        } catch (UnsatisfiedLinkError e) {}
+    }
+
+    /*
+     * Loads p.Test class with a new class loader and returns
+     * a Runnable instance.
+     */
+    static Runnable newTestRunnable() throws Exception {
+        TestLoader loader = new TestLoader();
+        Class<?> c = Class.forName("p.Test", true, loader);
+        return (Runnable) c.newInstance();
+    }
+
+    static class TestLoader extends URLClassLoader {
+        static URL[] toURLs() {
+            try {
+                return new URL[] { CLASSES.toUri().toURL() };
+            } catch (MalformedURLException e) {
+                throw new Error(e);
+            }
+        }
+
+        TestLoader() {
+            super("testloader", toURLs(), ClassLoader.getSystemClassLoader());
+        }
+    }
+
+    /*
+     * move p/Test.class out from classpath to the scratch directory
+     */
+    static void setup() throws IOException {
+        String dir = System.getProperty("test.classes", ".");
+        Path file = Paths.get("p", "Test.class");
+        Files.createDirectories(CLASSES.resolve("p"));
+        Files.move(Paths.get(dir).resolve(file),
+                   CLASSES.resolve("p").resolve("Test.class"));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/ClassLoader/nativeLibrary/libnativeLibraryTest.c	Fri Nov 10 18:50:32 2017 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "jni.h"
+#include "jni_util.h"
+
+static jint count = 0;
+static jclass test_class;
+static jint current_jni_version = JNI_VERSION_10;
+
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved) {
+    JNIEnv *env;
+    jclass cl;
+
+    (*vm)->GetEnv(vm, (void **) &env, current_jni_version);
+
+    cl = (*env)->FindClass(env, "NativeLibraryTest");
+    test_class = (*env)->NewGlobalRef(env, cl);
+
+    // increment the count when JNI_OnLoad is called
+    count++;
+
+    return current_jni_version;
+}
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved) {
+    JNIEnv *env;
+    jmethodID mid;
+    jclass cl;
+
+    (*vm)->GetEnv(vm, (void **) &env, current_jni_version);
+    mid = (*env)->GetStaticMethodID(env, test_class, "nativeLibraryUnloaded", "()V");
+    (*env)->CallStaticVoidMethod(env, test_class, mid);
+    if ((*env)->ExceptionCheck(env)) {
+        (*env)->ExceptionDescribe(env);
+        (*env)->FatalError(env, "Exception thrown");
+    }
+
+    cl = (*env)->FindClass(env, "p/Test");
+    if (cl != NULL) {
+        (*env)->FatalError(env, "p/Test class should not be found");
+    }
+}
+
+JNIEXPORT jint JNICALL
+Java_p_Test_count
+(JNIEnv *env, jclass cls) {
+    return count;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/ClassLoader/nativeLibrary/p/Test.java	Fri Nov 10 18:50:32 2017 +0100
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2017, 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 p;
+
+public class Test implements Runnable {
+    public static native int count();
+
+    /**
+     * Tests if the native library is loaded.
+     */
+    public void run() {
+        System.loadLibrary("nativeLibraryTest");
+        if (count() != 1) {
+            throw new RuntimeException("Expected count = 1 but got " + count());
+        }
+    }
+}
--- a/test/jdk/java/lang/ProcessHandle/OnExitTest.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/lang/ProcessHandle/OnExitTest.java	Fri Nov 10 18:50:32 2017 +0100
@@ -40,7 +40,6 @@
 
 /*
  * @test
- * @key intermittent
  * @library /test/lib
  * @build jdk.test.lib.Utils
  * @run testng OnExitTest
--- a/test/jdk/java/lang/Runtime/exec/LotsOfOutput.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/lang/Runtime/exec/LotsOfOutput.java	Fri Nov 10 18:50:32 2017 +0100
@@ -23,7 +23,8 @@
 
 /**
  * @test
- * @bug 4369826 8078582
+ * @bug 4369826 8078582 8190884
+ * @run main/othervm LotsOfOutput
  * @summary Process with lots of output should not crash VM
  * @author kladko
  */
--- a/test/jdk/java/nio/channels/SocketChannel/VectorIO.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/nio/channels/SocketChannel/VectorIO.java	Fri Nov 10 18:50:32 2017 +0100
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @bug 8191025
  * @summary Test socketchannel vector IO (use -Dseed=X to set PRNG seed)
  * @library .. /test/lib
  * @build jdk.test.lib.RandomFactory
@@ -42,11 +43,16 @@
 
     static int testSize;
 
+    // whether to use the write/read variant with a length parameter
+    static boolean setLength;
+
     public static void main(String[] args) throws Exception {
         testSize = 1;
+        setLength = false;
         runTest();
         for(int i=15; i<18; i++) {
             testSize = i;
+            setLength = !setLength;
             runTest();
         }
     }
@@ -75,6 +81,9 @@
             total += bufs[i].remaining();
         }
 
+        ByteBuffer[] bufsPlus1 = new ByteBuffer[bufs.length + 1];
+        System.arraycopy(bufs, 0, bufsPlus1, 0, bufs.length);
+
         // Get a connection to the server
         InetAddress lh = InetAddress.getLocalHost();
         InetSocketAddress isa = new InetSocketAddress(lh, port);
@@ -85,7 +94,12 @@
         // Write the data out
         long rem = total;
         while (rem > 0L) {
-            long bytesWritten = sc.write(bufs);
+            long bytesWritten;
+            if (setLength) {
+                bytesWritten = sc.write(bufsPlus1, 0, bufs.length);
+            } else {
+                bytesWritten = sc.write(bufs);
+            }
             if (bytesWritten == 0) {
                 if (sc.isBlocking()) {
                     throw new RuntimeException("write did not block");
@@ -134,6 +148,9 @@
                 total += bufs[i].capacity();
             }
 
+            ByteBuffer[] bufsPlus1 = new ByteBuffer[bufs.length + 1];
+            System.arraycopy(bufs, 0, bufsPlus1, 0, bufs.length);
+
             // Get a connection from client
             SocketChannel sc = null;
 
@@ -155,7 +172,12 @@
                 // Read data into multiple buffers
                 long avail = total;
                 while (avail > 0) {
-                    long bytesRead = sc.read(bufs);
+                    long bytesRead;
+                    if (setLength) {
+                        bytesRead = sc.read(bufsPlus1, 0, bufs.length);
+                    } else {
+                        bytesRead = sc.read(bufs);
+                    }
                     if (bytesRead < 0)
                         break;
                     if (bytesRead == 0) {
--- a/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, 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
@@ -941,21 +941,21 @@
     }
 
     public void test_Apia_jumpForwardOverInternationalDateLine_P12_to_M12() {
-        // transition occurred at 1879-07-04T00:00+12:33:04
+        // transition occurred at 1892-07-04T00:00+12:33:04
         ZoneRules test = pacificApia();
-        Instant instantBefore = LocalDate.of(1879, 7, 2).atStartOfDay(ZoneOffset.UTC).toInstant();
+        Instant instantBefore = LocalDate.of(1892, 7, 2).atStartOfDay(ZoneOffset.UTC).toInstant();
         ZoneOffsetTransition trans = test.nextTransition(instantBefore);
-        assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(1879, 7, 5, 0, 0));
-        assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(1879, 7, 4, 0, 0));
+        assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(1892, 7, 5, 0, 0));
+        assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(1892, 7, 4, 0, 0));
         assertEquals(trans.isGap(), false);
         assertEquals(trans.isOverlap(), true);
         assertEquals(trans.isValidOffset(ZoneOffset.ofHoursMinutesSeconds(+12, 33, 4)), true);
         assertEquals(trans.isValidOffset(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56)), true);
         assertEquals(trans.getDuration(), Duration.ofHours(-24));
-        assertEquals(trans.getInstant(), LocalDateTime.of(1879, 7, 4, 0, 0).toInstant(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56)));
+        assertEquals(trans.getInstant(), LocalDateTime.of(1892, 7, 4, 0, 0).toInstant(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56)));
 
-        ZonedDateTime zdt = ZonedDateTime.of(1879, 7, 4, 23, 0, 0, 0, ZoneId.of("Pacific/Apia"));
-        assertEquals(zdt.plusHours(2).toLocalDateTime(), LocalDateTime.of(1879, 7, 4, 1, 0, 0));
+        ZonedDateTime zdt = ZonedDateTime.of(1892, 7, 4, 23, 0, 0, 0, ZoneId.of("Pacific/Apia"));
+        assertEquals(zdt.plusHours(2).toLocalDateTime(), LocalDateTime.of(1892, 7, 4, 1, 0, 0));
     }
 
     //-------------------------------------------------------------------------
--- a/test/jdk/java/time/test/java/time/format/ZoneName.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/time/test/java/time/format/ZoneName.java	Fri Nov 10 18:50:32 2017 +0100
@@ -104,7 +104,7 @@
         "Pacific/Chuuk", "Truk", "Pacific/Truk",
         "Africa/Gaborone", "Africa_Central", "Africa/Maputo",
         "Africa/Tunis", "Europe_Central", "Europe/Paris",
-        "Africa/Khartoum", "Africa_Eastern", "Africa/Nairobi",
+        "Africa/Khartoum", "Africa_Central", "Africa/Maputo",
         "Europe/Isle_of_Man", "GMT", "Atlantic/Reykjavik",
         "Europe/Skopje", "Europe_Central", "Europe/Paris",
         "America/Merida", "America_Central", "America/Chicago",
@@ -221,7 +221,7 @@
         "Africa/Algiers", "Europe_Central", "Europe/Paris",
         "America/Miquelon", "Pierre_Miquelon", "America/Miquelon",
         "Asia/Tokyo", "Japan", "Asia/Tokyo",
-        "Africa/Windhoek", "Africa_Western", "Africa/Lagos",
+        "Africa/Windhoek", "Africa_Central", "Africa/Maputo",
         "Africa/Bujumbura", "Africa_Central", "Africa/Maputo",
         "America/Guatemala", "America_Central", "America/Chicago",
         "Africa/Dakar", "GMT", "Atlantic/Reykjavik",
@@ -662,7 +662,6 @@
         "America/Rosario", "America/Argentina/Cordoba",
         "Jamaica", "America/Jamaica",
         "Asia/Katmandu", "Asia/Kathmandu",
-        "Canada/East-Saskatchewan", "America/Regina",
         "ROK", "Asia/Seoul",
         "Asia/Macao", "Asia/Macau",
         "Australia/South", "Australia/Adelaide",
--- a/test/jdk/java/util/AbstractList/FailFastIterator.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/AbstractList/FailFastIterator.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4189896
  * @summary AbstractList iterators previously checked for co-modification
--- a/test/jdk/java/util/AbstractSequentialList/AddAll.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/AbstractSequentialList/AddAll.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4295163
  * @summary AddAll(int, Collection) intersperses the Collection with this List.
--- a/test/jdk/java/util/Collection/IteratorMicroBenchmark.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collection/IteratorMicroBenchmark.java	Fri Nov 10 18:50:32 2017 +0100
@@ -233,7 +233,7 @@
     }
 
     // Checks for correctness *and* prevents loop optimizations
-    class Check {
+    static class Check {
         private int sum;
         public void sum(int sum) {
             if (this.sum == 0)
--- a/test/jdk/java/util/Collection/MOAT.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collection/MOAT.java	Fri Nov 10 18:50:32 2017 +0100
@@ -1584,11 +1584,11 @@
     }
     interface Fun {void f() throws Throwable;}
     private static void THROWS(Class<? extends Throwable> k, Fun... fs) {
-          for (Fun f : fs)
-              try { f.f(); fail("Expected " + k.getName() + " not thrown"); }
-              catch (Throwable t) {
-                  if (k.isAssignableFrom(t.getClass())) pass();
-                  else unexpected(t);}}
+        for (Fun f : fs)
+            try { f.f(); fail("Expected " + k.getName() + " not thrown"); }
+            catch (Throwable t) {
+                if (k.isAssignableFrom(t.getClass())) pass();
+                else unexpected(t);}}
     static byte[] serializedForm(Object obj) {
         try {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
--- a/test/jdk/java/util/Collection/RemoveMicroBenchmark.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collection/RemoveMicroBenchmark.java	Fri Nov 10 18:50:32 2017 +0100
@@ -230,7 +230,7 @@
     }
 
     // Checks for correctness *and* prevents loop optimizations
-    class Check {
+    static class Check {
         private int sum;
         public void sum(int sum) {
             if (this.sum == 0)
--- a/test/jdk/java/util/Collections/AddAll.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/AddAll.java	Fri Nov 10 18:50:32 2017 +0100
@@ -33,7 +33,7 @@
 
 public class AddAll {
     static final int N = 100;
-    public static void main(String args[]) {
+    public static void main(String[] args) {
         test(new ArrayList<Integer>());
         test(new LinkedList<Integer>());
         test(new HashSet<Integer>());
--- a/test/jdk/java/util/Collections/BinarySearchNullComparator.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/BinarySearchNullComparator.java	Fri Nov 10 18:50:32 2017 +0100
@@ -30,7 +30,7 @@
 import java.util.*;
 
 public class BinarySearchNullComparator {
-    public static void main(String args[]) throws Exception {
+    public static void main(String[] args) throws Exception {
         List list = Arrays.asList(new String[] {"I", "Love", "You"});
 
         int result = Collections.binarySearch(list, "You", null);
--- a/test/jdk/java/util/Collections/CheckedListBash.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/CheckedListBash.java	Fri Nov 10 18:50:32 2017 +0100
@@ -209,15 +209,14 @@
     }
 
     static void AddRandoms(List s, int n) {
-        for (int i=0; i<n; i++) {
-            int r = rnd.nextInt() % n;
-            Integer e = new Integer(r < 0 ? -r : r);
+        for (int i = 0; i < n; i++) {
+            Integer e = rnd.nextInt(n);
 
             int preSize = s.size();
             if (!s.add(e))
                 fail("Add failed.");
             int postSize = s.size();
-            if (postSize-preSize != 1)
+            if (postSize - preSize != 1)
                 fail("Add didn't increase size by 1.");
         }
     }
--- a/test/jdk/java/util/Collections/CheckedMapBash.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/CheckedMapBash.java	Fri Nov 10 18:50:32 2017 +0100
@@ -36,7 +36,6 @@
 import org.testng.annotations.DataProvider;
 
 import static org.testng.Assert.fail;
-import static org.testng.Assert.assertTrue;
 
 public class CheckedMapBash {
     static final Random rnd = new Random();
--- a/test/jdk/java/util/Collections/CheckedSetBash.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/CheckedSetBash.java	Fri Nov 10 18:50:32 2017 +0100
@@ -122,9 +122,8 @@
     }
 
     static void AddRandoms(Set s, int n) {
-        for (int i=0; i<n; i++) {
-            int r = rnd.nextInt() % n;
-            Integer e = new Integer(r < 0 ? -r : r);
+        for (int i = 0; i < n; i++) {
+            Integer e = rnd.nextInt(n);
 
             int preSize = s.size();
             boolean prePresent = s.contains(e);
--- a/test/jdk/java/util/Collections/Disjoint.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/Disjoint.java	Fri Nov 10 18:50:32 2017 +0100
@@ -34,7 +34,7 @@
 public class Disjoint {
     static final int N = 20;
 
-    public static void main(String args[]) {
+    public static void main(String[] args) {
         // Make an array of lists each of which shares a single element
         // with its "neighbors," and no elements with other lists in the array
         Random rnd = new Random();
--- a/test/jdk/java/util/Collections/EmptyNavigableMap.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/EmptyNavigableMap.java	Fri Nov 10 18:50:32 2017 +0100
@@ -48,7 +48,7 @@
 public class EmptyNavigableMap {
 
     public static <T> void assertInstance(T actual, Class<? extends T> expected) {
-        assertInstance(expected.isInstance(actual), null);
+        assertInstance(actual, expected, null);
     }
 
     public static <T> void assertInstance(T actual, Class<? extends T> expected, String message) {
--- a/test/jdk/java/util/Collections/EmptyNavigableSet.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/EmptyNavigableSet.java	Fri Nov 10 18:50:32 2017 +0100
@@ -50,7 +50,7 @@
 public class EmptyNavigableSet {
 
     public static <T> void assertInstance(T actual, Class<? extends T> expected) {
-        assertInstance(expected.isInstance(actual), null);
+        assertInstance(actual, expected, null);
     }
 
     public static <T> void assertInstance(T actual, Class<? extends T> expected, String message) {
--- a/test/jdk/java/util/Collections/Enum.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/Enum.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4323074
  * @summary Basic test for new Enumeration -> List converter
--- a/test/jdk/java/util/Collections/FindSubList.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/FindSubList.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4323074
  * @summary Basic test for Collections.indexOfSubList/lastIndexOfSubList
@@ -33,8 +33,8 @@
     public static void main(String[] args) throws Exception {
         int N = 500;
         List source = new ArrayList(3 * N);
-        List target[]= new List[N+1];
-        int  index[] = new  int[N+1];
+        List[] target = new List[N+1];
+        int[] index = new int[N+1];
         for (int i=0; i<=N; i++) {
             List t = new ArrayList();
             String s = Integer.toString(i, 2);
@@ -50,8 +50,12 @@
             }
         }
 
-        List src[] = {source, new LinkedList(source), new Vector(source),
-                      Arrays.asList(source.toArray())};
+        List[] src = {
+            source,
+            new LinkedList(source),
+            new Vector(source),
+            Arrays.asList(source.toArray())
+        };
         for (int j=0; j<src.length; j++) {
             List s = src[j];
 
@@ -75,8 +79,12 @@
             if (i != N)
                 index[i] = srcSize - index[i] - target[i].size();
         }
-        List src2[] = {source, new LinkedList(source), new Vector(source),
-                       Arrays.asList(source.toArray())};
+        List[] src2 = {
+            source,
+            new LinkedList(source),
+            new Vector(source),
+            Arrays.asList(source.toArray())
+        };
         for (int j=0; j<src2.length; j++) {
             List s = src2[j];
 
--- a/test/jdk/java/util/Collections/Frequency.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/Frequency.java	Fri Nov 10 18:50:32 2017 +0100
@@ -32,7 +32,7 @@
 
 public class Frequency {
     static final int N = 100;
-    public static void main(String args[]) {
+    public static void main(String[] args) {
         test(new ArrayList<Integer>());
         test(new LinkedList<Integer>());
     }
--- a/test/jdk/java/util/Collections/NullComparator.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/NullComparator.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4224271
  * @summary A null Comparator is now specified to indicate natural ordering.
@@ -37,7 +37,7 @@
         List sorted = new ArrayList(list);
         Collections.shuffle(list);
 
-        Object a[] = list.toArray();
+        Object[] a = list.toArray();
         Arrays.sort(a, null);
         if (!Arrays.asList(a).equals(sorted))
             throw new Exception("Arrays.sort");
--- a/test/jdk/java/util/Collections/ReplaceAll.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/ReplaceAll.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4323074
  * @summary Basic test for new replaceAll algorithm
@@ -33,7 +33,7 @@
     static final int SIZE = 20;
 
     public static void main(String[] args) throws Exception {
-        List a[] = {new ArrayList(), new LinkedList(), new Vector()};
+        List[] a = {new ArrayList(), new LinkedList(), new Vector()};
 
         for (int i=0; i<a.length; i++) {
             List lst = a[i];
--- a/test/jdk/java/util/Collections/Rotate.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/Rotate.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4323074
  * @summary Basic test for new rotate algorithm
@@ -37,7 +37,7 @@
     static Random rnd = new Random();
 
     public static void main(String[] args) throws Exception {
-        List a[] = {new ArrayList(), new LinkedList(), new Vector()};
+        List[] a = {new ArrayList(), new LinkedList(), new Vector()};
 
         for (int i=0; i<a.length; i++) {
             List lst = a[i];
--- a/test/jdk/java/util/Collections/RotateEmpty.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/RotateEmpty.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4389747
  * @summary Collections.rotate(...) returns ArithmeticException
--- a/test/jdk/java/util/Collections/Ser.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/Ser.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4190323
  * @summary EMPTY_SET, EMPTY_LIST, and the collections returned by
--- a/test/jdk/java/util/Collections/Swap.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/Swap.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug     4323074
  * @summary Basic test for newly public swap algorithm
--- a/test/jdk/java/util/Collections/ViewSynch.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/ViewSynch.java	Fri Nov 10 18:50:32 2017 +0100
@@ -21,7 +21,7 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4268780
  * @summary Collection-views of submap-views of synchronized-views of
--- a/test/jdk/java/util/Collections/WrappedNull.java	Mon Nov 06 20:03:58 2017 +0100
+++ b/test/jdk/java/util/Collections/WrappedNull.java	Fri Nov 10 18:50:32 2017 +0100
@@ -31,152 +31,152 @@
 import java.util.*;
 
 public class WrappedNull {
-      public static void main(String argv[]) throws Exception {
-          boolean testSucceeded = false;
-          try {
-              List l = Arrays.asList(null);
-          }
-          catch (NullPointerException e) {
-              testSucceeded = true;
-          }
-          if (!testSucceeded)
-              throw new Exception("Arrays.asList");
+    public static void main(String[] args) throws Exception {
+        boolean testSucceeded = false;
+        try {
+            List l = Arrays.asList(null);
+        }
+        catch (NullPointerException e) {
+            testSucceeded = true;
+        }
+        if (!testSucceeded)
+            throw new Exception("Arrays.asList");
 
-          testSucceeded = false;
-          try {
-              Collection c = Collections.unmodifiableCollection(null);