changeset 10821:77ef493d46b1

Merge
author erikj
date Mon, 13 Oct 2014 14:01:45 +0200
parents 1efb40640e0e c9ba1c07a753
children 40e633ee8ff3
files make/lib/Lib-java.management.gmk src/jdk.dev/share/classes/com/sun/jarsigner/package.html
diffstat 26 files changed, 797 insertions(+), 107 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Oct 13 13:44:01 2014 +0200
+++ b/.hgtags	Mon Oct 13 14:01:45 2014 +0200
@@ -276,3 +276,4 @@
 71e99dae28f9791287b88d46e16a266b564f22be jdk9-b31
 8bdf7083b5bd02aa330ba622895e586dd3378d37 jdk9-b32
 60fe681c30bc3821545a2506d4d3c2e04073f67c jdk9-b33
+21568031434d7a9dbb0cc6516cc3183d349c2253 jdk9-b34
--- a/make/lib/Lib-java.management.gmk	Mon Oct 13 13:44:01 2014 +0200
+++ b/make/lib/Lib-java.management.gmk	Mon Oct 13 14:01:45 2014 +0200
@@ -25,9 +25,12 @@
 
 include LibCommon.gmk
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, lib/Lib-java.management.gmk))
+
 ################################################################################
 
-BUILD_LIBMANAGEMENT_SRC := $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
+BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
     $(JDK_TOPDIR)/src/java.management/$(OPENJDK_TARGET_OS_API_DIR)/native/libmanagement
 BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \
     $(addprefix -I,$(BUILD_LIBMANAGEMENT_SRC)) \
@@ -56,6 +59,9 @@
   endif
 endif
 
+# Make it possible to override this variable
+LIBMANAGEMENT_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers
+
 $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
     LIBRARY := management, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@@ -64,7 +70,7 @@
     LANG := C, \
     OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(BUILD_LIBMANAGEMENT_CFLAGS), \
-    MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers, \
+    MAPFILE := $(LIBMANAGEMENT_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_solaris := -lkstat, \
--- a/src/java.base/share/classes/java/net/URI.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/java/net/URI.java	Mon Oct 13 14:01:45 2014 +0200
@@ -397,7 +397,7 @@
  * in all cases,
  * <pre>
  *     new URI(<i>u</i>.getScheme(),
- *             <i>u</i>.getUserInfo(), <i>u</i>.getAuthority(),
+ *             <i>u</i>.getAuthority(),
  *             <i>u</i>.getPath(), <i>u</i>.getQuery(),
  *             <i>u</i>.getFragment())
  *     .equals(<i>u</i>)</pre>
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java	Mon Oct 13 14:01:45 2014 +0200
@@ -337,7 +337,7 @@
         {"New.prompt.", "New {0}: "},
         {"Passwords.must.differ", "Passwords must differ"},
         {"Re.enter.new.prompt.", "Re-enter new {0}: "},
-        {"Re.enter.passpword.", "Re-enter password: "},
+        {"Re.enter.password.", "Re-enter password: "},
         {"Re.enter.new.password.", "Re-enter new password: "},
         {"They.don.t.match.Try.again", "They don't match. Try again"},
         {"Enter.prompt.alias.name.", "Enter {0} alias name:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "Neues {0}: "},
         {"Passwords.must.differ", "Kennw\u00F6rter m\u00FCssen sich unterscheiden"},
         {"Re.enter.new.prompt.", "Neues {0} erneut eingeben: "},
-        {"Re.enter.passpword.", "Geben Sie das Kennwort erneut ein: "},
+        {"Re.enter.password.", "Geben Sie das Kennwort erneut ein: "},
         {"Re.enter.new.password.", "Neues Kennwort erneut eingeben: "},
         {"They.don.t.match.Try.again", "Keine \u00DCbereinstimmung. Wiederholen Sie den Vorgang"},
         {"Enter.prompt.alias.name.", "{0}-Aliasnamen eingeben:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_es.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_es.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "Nuevo {0}: "},
         {"Passwords.must.differ", "Las contrase\u00F1as deben ser distintas"},
         {"Re.enter.new.prompt.", "Vuelva a escribir el nuevo {0}: "},
-        {"Re.enter.passpword.", "Vuelva a introducir la contrase\u00F1a: "},
+        {"Re.enter.password.", "Vuelva a introducir la contrase\u00F1a: "},
         {"Re.enter.new.password.", "Volver a escribir la contrase\u00F1a nueva: "},
         {"They.don.t.match.Try.again", "No coinciden. Int\u00E9ntelo de nuevo"},
         {"Enter.prompt.alias.name.", "Escriba el nombre de alias de {0}:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_fr.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_fr.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "Nouveau {0} : "},
         {"Passwords.must.differ", "Les mots de passe doivent diff\u00E9rer"},
         {"Re.enter.new.prompt.", "Indiquez encore le nouveau {0} : "},
-        {"Re.enter.passpword.", "R\u00E9p\u00E9tez le mot de passe : "},
+        {"Re.enter.password.", "R\u00E9p\u00E9tez le mot de passe : "},
         {"Re.enter.new.password.", "Ressaisissez le nouveau mot de passe : "},
         {"They.don.t.match.Try.again", "Ils sont diff\u00E9rents. R\u00E9essayez."},
         {"Enter.prompt.alias.name.", "Indiquez le nom d''alias {0} :  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_it.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_it.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "Nuova {0}: "},
         {"Passwords.must.differ", "Le password non devono coincidere"},
         {"Re.enter.new.prompt.", "Reimmettere un nuovo valore per {0}: "},
-        {"Re.enter.passpword.", "Reimmettere la password: "},
+        {"Re.enter.password.", "Reimmettere la password: "},
         {"Re.enter.new.password.", "Immettere nuovamente la nuova password: "},
         {"They.don.t.match.Try.again", "Non corrispondono. Riprovare."},
         {"Enter.prompt.alias.name.", "Immettere nome alias {0}:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "\u65B0\u898F{0}: "},
         {"Passwords.must.differ", "\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u7570\u306A\u3063\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
         {"Re.enter.new.prompt.", "\u65B0\u898F{0}\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
-        {"Re.enter.passpword.", "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
+        {"Re.enter.password.", "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
         {"Re.enter.new.password.", "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
         {"They.don.t.match.Try.again", "\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u3082\u3046\u4E00\u5EA6\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
         {"Enter.prompt.alias.name.", "{0}\u306E\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_ko.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_ko.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "\uC0C8 {0}: "},
         {"Passwords.must.differ", "\uBE44\uBC00\uBC88\uD638\uB294 \uB2EC\uB77C\uC57C \uD569\uB2C8\uB2E4."},
         {"Re.enter.new.prompt.", "\uC0C8 {0} \uB2E4\uC2DC \uC785\uB825: "},
-        {"Re.enter.passpword.", "\uBE44\uBC00\uBC88\uD638  \uB2E4\uC2DC \uC785\uB825: "},
+        {"Re.enter.password.", "\uBE44\uBC00\uBC88\uD638  \uB2E4\uC2DC \uC785\uB825: "},
         {"Re.enter.new.password.", "\uC0C8 \uBE44\uBC00\uBC88\uD638 \uB2E4\uC2DC \uC785\uB825: "},
         {"They.don.t.match.Try.again", "\uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC2ED\uC2DC\uC624."},
         {"Enter.prompt.alias.name.", "{0} \uBCC4\uCE6D \uC774\uB984 \uC785\uB825:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_pt_BR.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_pt_BR.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "Nova {0}: "},
         {"Passwords.must.differ", "As senhas devem ser diferentes"},
         {"Re.enter.new.prompt.", "Informe novamente a nova {0}: "},
-        {"Re.enter.passpword.", "Redigite a senha: "},
+        {"Re.enter.password.", "Redigite a senha: "},
         {"Re.enter.new.password.", "Informe novamente a nova senha: "},
         {"They.don.t.match.Try.again", "Elas n\u00E3o correspondem. Tente novamente"},
         {"Enter.prompt.alias.name.", "Informe o nome do alias {0}:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_sv.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_sv.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "Nytt {0}: "},
         {"Passwords.must.differ", "L\u00F6senorden m\u00E5ste vara olika"},
         {"Re.enter.new.prompt.", "Ange nytt {0} igen: "},
-        {"Re.enter.passpword.", "Ange l\u00F6senord igen: "},
+        {"Re.enter.password.", "Ange l\u00F6senord igen: "},
         {"Re.enter.new.password.", "Ange det nya l\u00F6senordet igen: "},
         {"They.don.t.match.Try.again", "De matchar inte. F\u00F6rs\u00F6k igen"},
         {"Enter.prompt.alias.name.", "Ange aliasnamn f\u00F6r {0}:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "\u65B0{0}: "},
         {"Passwords.must.differ", "\u53E3\u4EE4\u4E0D\u80FD\u76F8\u540C"},
         {"Re.enter.new.prompt.", "\u91CD\u65B0\u8F93\u5165\u65B0{0}: "},
-        {"Re.enter.passpword.", "\u518D\u6B21\u8F93\u5165\u53E3\u4EE4: "},
+        {"Re.enter.password.", "\u518D\u6B21\u8F93\u5165\u53E3\u4EE4: "},
         {"Re.enter.new.password.", "\u518D\u6B21\u8F93\u5165\u65B0\u53E3\u4EE4: "},
         {"They.don.t.match.Try.again", "\u5B83\u4EEC\u4E0D\u5339\u914D\u3002\u8BF7\u91CD\u8BD5"},
         {"Enter.prompt.alias.name.", "\u8F93\u5165{0}\u522B\u540D:  "},
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_TW.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_TW.java	Mon Oct 13 14:01:45 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         {"New.prompt.", "\u65B0 {0}: "},
         {"Passwords.must.differ", "\u5FC5\u9808\u662F\u4E0D\u540C\u7684\u5BC6\u78BC"},
         {"Re.enter.new.prompt.", "\u91CD\u65B0\u8F38\u5165\u65B0 {0}: "},
-        {"Re.enter.passpword.", "\u91CD\u65B0\u8F38\u5165\u5BC6\u78BC:"},
+        {"Re.enter.password.", "\u91CD\u65B0\u8F38\u5165\u5BC6\u78BC:"},
         {"Re.enter.new.password.", "\u91CD\u65B0\u8F38\u5165\u65B0\u5BC6\u78BC: "},
         {"They.don.t.match.Try.again", "\u5B83\u5011\u4E0D\u76F8\u7B26\u3002\u8ACB\u91CD\u8A66"},
         {"Enter.prompt.alias.name.", "\u8F38\u5165 {0} \u5225\u540D\u540D\u7A31:  "},
--- a/src/java.logging/share/classes/java/util/logging/FileHandler.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.logging/share/classes/java/util/logging/FileHandler.java	Mon Oct 13 14:01:45 2014 +0200
@@ -260,6 +260,11 @@
     public FileHandler() throws IOException, SecurityException {
         checkPermission();
         configure();
+        // pattern will have been set by configure. check that it's not
+        // empty.
+        if (pattern.isEmpty()) {
+            throw new NullPointerException();
+        }
         openFiles();
     }
 
@@ -402,6 +407,14 @@
         openFiles();
     }
 
+    private  boolean isParentWritable(Path path) {
+        Path parent = path.getParent();
+        if (parent == null) {
+            parent = path.toAbsolutePath().getParent();
+        }
+        return parent != null && Files.isWritable(parent);
+    }
+
     /**
      * Open the set of output files, based on the configured
      * instance variables.
@@ -416,6 +429,10 @@
             limit = 0;
         }
 
+        // All constructors check that pattern is neither null nor empty.
+        assert pattern != null : "pattern should not be null";
+        assert !pattern.isEmpty() : "pattern should not be empty";
+
         // We register our own ErrorManager during initialization
         // so we can record exceptions.
         InitializationErrorManager em = new InitializationErrorManager();
@@ -458,7 +475,7 @@
                         // Note that this is a situation that may happen,
                         // but not too frequently.
                         if (Files.isRegularFile(lockFilePath, LinkOption.NOFOLLOW_LINKS)
-                            && Files.isWritable(lockFilePath.getParent())) {
+                            && isParentWritable(lockFilePath)) {
                             try {
                                 channel = FileChannel.open(lockFilePath,
                                     WRITE, APPEND);
--- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java	Mon Oct 13 14:01:45 2014 +0200
@@ -699,15 +699,15 @@
             //create a SignatureAlgorithms from the SignatureMethod inside
             //SignedInfo. This is used to validate the signature.
             SignatureAlgorithm sa = si.getSignatureAlgorithm();
-            if (log.isLoggable(java.util.logging.Level.FINE)) {
-                log.log(java.util.logging.Level.FINE, "signatureMethodURI = " + sa.getAlgorithmURI());
-                log.log(java.util.logging.Level.FINE, "jceSigAlgorithm    = " + sa.getJCEAlgorithmString());
-                log.log(java.util.logging.Level.FINE, "jceSigProvider     = " + sa.getJCEProviderName());
-                log.log(java.util.logging.Level.FINE, "PublicKey = " + pk);
-            }
             byte sigBytes[] = null;
             try {
                 sa.initVerify(pk);
+                if (log.isLoggable(java.util.logging.Level.FINE)) {
+                    log.log(java.util.logging.Level.FINE, "signatureMethodURI = " + sa.getAlgorithmURI());
+                    log.log(java.util.logging.Level.FINE, "jceSigAlgorithm    = " + sa.getJCEAlgorithmString());
+                    log.log(java.util.logging.Level.FINE, "jceSigProvider     = " + sa.getJCEProviderName());
+                    log.log(java.util.logging.Level.FINE, "PublicKey = " + pk);
+                }
 
                 // Get the canonicalized (normalized) SignedInfo
                 SignerOutputStream so = new SignerOutputStream(sa);
--- a/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp	Mon Oct 13 14:01:45 2014 +0200
@@ -211,6 +211,7 @@
     digest_item.len = jDigestLength;
 
     ECPrivateKey privKey;
+    privKey.privateValue.data = NULL;
 
     // Initialize the ECParams struct
     ECParams *ecparams = NULL;
@@ -387,9 +388,14 @@
 {
     jbyteArray jSecret = NULL;
     ECParams *ecparams = NULL;
+    SECItem privateValue_item;
+    privateValue_item.data = NULL;
+    SECItem publicValue_item;
+    publicValue_item.data = NULL;
+    SECKEYECParams params_item;
+    params_item.data = NULL;
 
     // Extract private key value
-    SECItem privateValue_item;
     privateValue_item.len = env->GetArrayLength(privateKey);
     privateValue_item.data =
             (unsigned char *) env->GetByteArrayElements(privateKey, 0);
@@ -398,7 +404,6 @@
     }
 
     // Extract public key value
-    SECItem publicValue_item;
     publicValue_item.len = env->GetArrayLength(publicKey);
     publicValue_item.data =
         (unsigned char *) env->GetByteArrayElements(publicKey, 0);
@@ -407,7 +412,6 @@
     }
 
     // Initialize the ECParams struct
-    SECKEYECParams params_item;
     params_item.len = env->GetArrayLength(encodedParams);
     params_item.data =
         (unsigned char *) env->GetByteArrayElements(encodedParams, 0);
--- a/src/jdk.dev/share/classes/com/sun/jarsigner/ContentSigner.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/src/jdk.dev/share/classes/com/sun/jarsigner/ContentSigner.java	Mon Oct 13 14:01:45 2014 +0200
@@ -37,6 +37,7 @@
  * @author Vincent Ryan
  */
 
+@jdk.Exported
 public abstract class ContentSigner {
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.dev/share/classes/com/sun/jarsigner/package-info.java	Mon Oct 13 14:01:45 2014 +0200
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/**
+ * This package comprises the interfaces and classes used to define the
+ * signing mechanism used by the <tt>jarsigner</tt> tool.
+ * <p>
+ * Clients may override the default signing mechanism of the <tt>jarsigner</tt>
+ * tool by supplying an alternative implementation of
+ * {@link com.sun.jarsigner.ContentSigner}.
+ */
+
+@jdk.Exported
+package com.sun.jarsigner;
--- a/src/jdk.dev/share/classes/com/sun/jarsigner/package.html	Mon Oct 13 13:44:01 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-<html>
-<!--
- 
-Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-  <head>
-    <title>Jarsigner Signing Mechanism Package</title>
-  </head>   
-  <body>
-This package comprises the interfaces and classes used to define the
-signing mechanism used by the <tt>jarsigner</tt> tool.
-<p>
-Clients may override the default signing mechanism of the <tt>jarsigner</tt>
-tool by supplying an alternative implementation of 
-{@link com.sun.jarsigner.ContentSigner}.
-  </body>
-</html>
--- a/test/java/lang/invoke/LFCaching/TestMethods.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/test/java/lang/invoke/LFCaching/TestMethods.java	Mon Oct 13 14:01:45 2014 +0200
@@ -44,7 +44,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -83,7 +83,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -91,7 +91,7 @@
                     int dropArgsPos = Helper.RNG.nextInt(realArity + 1);
                     data.put("dropArgsPos", dropArgsPos);
                     MethodType mtDropArgs = TestMethods.randomMethodTypeGenerator(
-                            Helper.RNG.nextInt(Helper.MAX_ARITY - realArity));
+                            Helper.RNG.nextInt(super.maxArity - realArity));
                     data.put("mtDropArgs", mtDropArgs);
                     return data;
                 }
@@ -106,20 +106,20 @@
                     int mtTgtSlotsCount = TestMethods.argSlotsCount(mtTarget);
                     int mtDASlotsCount = TestMethods.argSlotsCount(mtDropArgs);
                     List<Class<?>> fakeParList;
-                    if (mtTgtSlotsCount + mtDASlotsCount > Helper.MAX_ARITY - 1) {
+                    if (mtTgtSlotsCount + mtDASlotsCount > super.maxArity - 1) {
                         fakeParList = TestMethods.reduceArgListToSlotsCount(mtDropArgs.parameterList(),
-                                Helper.MAX_ARITY - mtTgtSlotsCount - 1);
+                                super.maxArity - mtTgtSlotsCount - 1);
                     } else {
                         fakeParList = mtDropArgs.parameterList();
                     }
                     return MethodHandles.dropArguments(target, dropArgsPos, fakeParList);
                 }
             },
-    EXPLICIT_CAST_ARGUMENTS("explicitCastArguments") {
+    EXPLICIT_CAST_ARGUMENTS("explicitCastArguments", Helper.MAX_ARITY / 2) {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY / 2);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -146,11 +146,11 @@
                     return MethodHandles.explicitCastArguments(target, mtExcplCastArgs);
                 }
             },
-    FILTER_ARGUMENTS("filterArguments") {
+    FILTER_ARGUMENTS("filterArguments", Helper.MAX_ARITY / 2) {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY / 2);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -184,7 +184,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -211,7 +211,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -236,18 +236,18 @@
                     return MethodHandles.insertArguments(target, insertArgsPos, insertList);
                 }
             },
-    PERMUTE_ARGUMENTS("permuteArguments") {
+    PERMUTE_ARGUMENTS("permuteArguments", Helper.MAX_ARITY / 2) {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY / 2);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     // Arity after reducing because of long and double take 2 slots.
                     int realArity = mtTarget.parameterCount();
                     int[] permuteArgsReorderArray = new int[realArity];
-                    int mtParmuteArgsNum = Helper.RNG.nextInt(Helper.MAX_ARITY);
-                    mtParmuteArgsNum = mtParmuteArgsNum == 0 ? 1 : mtParmuteArgsNum;
-                    MethodType mtPermuteArgs = TestMethods.randomMethodTypeGenerator(mtParmuteArgsNum);
+                    int mtPermuteArgsNum = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    mtPermuteArgsNum = mtPermuteArgsNum == 0 ? 1 : mtPermuteArgsNum;
+                    MethodType mtPermuteArgs = TestMethods.randomMethodTypeGenerator(mtPermuteArgsNum);
                     mtTarget = mtTarget.changeReturnType(mtPermuteArgs.returnType());
                     for (int i = 0; i < realArity; i++) {
                         int mtPermuteArgsParNum = Helper.RNG.nextInt(mtPermuteArgs.parameterCount());
@@ -275,7 +275,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
@@ -293,7 +293,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -329,7 +329,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -359,11 +359,11 @@
                     return MethodHandles.catchException(target, Exception.class, handler);
                 }
             },
-    INVOKER("invoker") {
+    INVOKER("invoker", Helper.MAX_ARITY - 1) {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
@@ -375,11 +375,11 @@
                     return MethodHandles.invoker(mtTarget);
                 }
             },
-    EXACT_INVOKER("exactInvoker") {
+    EXACT_INVOKER("exactInvoker", Helper.MAX_ARITY - 1) {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
@@ -391,11 +391,11 @@
                     return MethodHandles.exactInvoker(mtTarget);
                 }
             },
-    SPREAD_INVOKER("spreadInvoker") {
+    SPREAD_INVOKER("spreadInvoker", Helper.MAX_ARITY - 1) {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
@@ -416,7 +416,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
@@ -436,7 +436,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
@@ -456,7 +456,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
@@ -481,7 +481,7 @@
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
-                    int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    int desiredArity = Helper.RNG.nextInt(super.maxArity);
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
@@ -503,8 +503,15 @@
      */
     public final String name;
 
+    private final int maxArity;
+
+    private TestMethods(String name, int maxArity) {
+        this.name = name;
+        this.maxArity = maxArity;
+    }
+
     private TestMethods(String name) {
-        this.name = name;
+        this(name, Helper.MAX_ARITY);
     }
 
     protected MethodHandle getMH(Map<String, Object> data, TestMethods.Kind kind) throws NoSuchMethodException, IllegalAccessException {
--- a/test/java/lang/management/MemoryMXBean/MemoryTest.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/test/java/lang/management/MemoryMXBean/MemoryTest.java	Mon Oct 13 14:01:45 2014 +0200
@@ -59,13 +59,13 @@
     // (or equivalent for other collectors)
     // Number of GC memory managers = 2
 
-    // Hotspot VM 1.8+ after perm gen removal is expected to have two or
-    // three non-heap memory pools:
-    // - Code cache
+    // Hotspot VM 1.8+ after perm gen removal is expected to have between two
+    // or five non-heap memory pools:
+    // - Code cache (between one and three depending on the -XX:SegmentedCodeCache option)
     // - Metaspace
     // - Compressed Class Space (if compressed class pointers are used)
     private static int[] expectedMinNumPools = {3, 2};
-    private static int[] expectedMaxNumPools = {3, 3};
+    private static int[] expectedMaxNumPools = {3, 5};
     private static int expectedNumGCMgrs = 2;
     private static int expectedNumMgrs = expectedNumGCMgrs + 2;
     private static String[] types = { "heap", "non-heap" };
--- a/test/java/net/InetAddress/IPv4Formats.java	Mon Oct 13 13:44:01 2014 +0200
+++ b/test/java/net/InetAddress/IPv4Formats.java	Mon Oct 13 14:01:45 2014 +0200
@@ -36,7 +36,7 @@
             {"126.1", "126.0.0.1"},
             {"128.50.65534", "128.50.255.254"},
             {"192.168.1.2", "192.168.1.2"},
-            {"hello.foo.bar", null},
+            {"invalidhost.invalid", null},
             {"1024.1.2.3", null},
             {"128.14.66000", null }
         };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/logging/FileHandlerPath.java	Mon Oct 13 14:01:45 2014 +0200
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FilePermission;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import static java.nio.file.StandardOpenOption.CREATE_NEW;
+import static java.nio.file.StandardOpenOption.WRITE;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.PropertyPermission;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.FileHandler;
+import java.util.logging.LogManager;
+import java.util.logging.LoggingPermission;
+
+/**
+ * @test
+ * @bug 8059269
+ * @summary tests that using a simple (non composite) pattern does not lead
+ *        to NPE when the lock file already exists.
+ * @run main/othervm FileHandlerPath UNSECURE
+ * @run main/othervm FileHandlerPath SECURE
+ * @author danielfuchs
+ */
+public class FileHandlerPath {
+
+    /**
+     * We will test the simple pattern in two configurations.
+     * UNSECURE: No security manager.
+     * SECURE: With the security manager present - and the required
+     *         permissions granted.
+     */
+    public static enum TestCase {
+        UNSECURE, SECURE;
+        public void run(Properties propertyFile) throws Exception {
+            System.out.println("Running test case: " + name());
+            Configure.setUp(this, propertyFile);
+            test(this.name() + " " + propertyFile.getProperty("test.name"), propertyFile);
+        }
+    }
+
+
+    // Use a random name provided by UUID to avoid collision with other tests
+    final static String logFile = FileHandlerPath.class.getSimpleName() + "_"
+                + UUID.randomUUID().toString() + ".log";
+    final static String tmpLogFile;
+    final static String userDir = System.getProperty("user.dir");
+    final static String tmpDir = System.getProperty("java.io.tmpdir");
+    private static final List<Properties> properties;
+    static {
+        tmpLogFile = new File(tmpDir, logFile).toString();
+        Properties props1 = new Properties();
+        Properties props2 = new Properties();
+        props1.setProperty("test.name", "relative file");
+        props1.setProperty("test.file.name", logFile);
+        props1.setProperty(FileHandler.class.getName() + ".pattern", logFile);
+        props1.setProperty(FileHandler.class.getName() + ".count", "1");
+        props2.setProperty("test.name", "absoluste file");
+        props2.setProperty("test.file.name", tmpLogFile);
+        props2.setProperty(FileHandler.class.getName() + ".pattern", "%t/" + logFile);
+        props2.setProperty(FileHandler.class.getName() + ".count", "1");
+        properties = Collections.unmodifiableList(Arrays.asList(
+                    props1,
+                    props2));
+    }
+
+    public static void main(String... args) throws Exception {
+
+        if (args == null || args.length == 0) {
+            args = new String[] {
+                TestCase.UNSECURE.name(),
+                TestCase.SECURE.name(),
+            };
+        }
+
+        // Sanity checks
+
+        if (!Files.isWritable(Paths.get(userDir))) {
+            throw new RuntimeException(userDir +
+                    ": user.dir is not writable - can't run test.");
+        }
+        if (!Files.isWritable(Paths.get(tmpDir))) {
+            throw new RuntimeException(tmpDir +
+                    ": java.io.tmpdir is not writable - can't run test.");
+        }
+
+        File[] files = {
+            new File(logFile),
+            new File(tmpLogFile),
+            new File(logFile+".1"),
+            new File(tmpLogFile+".1"),
+            new File(logFile+".lck"),
+            new File(tmpLogFile+".lck"),
+            new File(logFile+".1.lck"),
+            new File(tmpLogFile+".1.lck")
+        };
+
+        for (File log : files) {
+            if (log.exists()) {
+                throw new Exception(log +": file already exists - can't run test.");
+            }
+        }
+
+        // Now start the real test
+
+        try {
+            for (String testName : args) {
+                for (Properties propertyFile : properties) {
+                    TestCase test = TestCase.valueOf(testName);
+                    test.run(propertyFile);
+                }
+            }
+        } finally {
+            // Cleanup...
+            Configure.doPrivileged(() -> {
+                for(File log : files) {
+                    try {
+                        final boolean isLockFile = log.getName().endsWith(".lck");
+                        // lock file should already be deleted, except if the
+                        // test failed in exception.
+                        // log file should all be present, except if the test
+                        // failed in exception.
+                        if (log.exists()) {
+                            if (!isLockFile) {
+                                System.out.println("deleting "+log.toString());
+                            } else {
+                                System.err.println("deleting lock file "+log.toString());
+                            }
+                            log.delete();
+                        } else {
+                            if (!isLockFile) {
+                                System.err.println(log.toString() + ": not found.");
+                            }
+                        }
+                    } catch (Throwable t) {
+                        // should not happen
+                        t.printStackTrace();
+                    }
+                }
+            });
+        }
+    }
+
+    static class Configure {
+        static Policy policy = null;
+        static final AtomicBoolean allowAll = new AtomicBoolean(false);
+        static void setUp(TestCase test, Properties propertyFile) {
+            switch (test) {
+                case SECURE:
+                    if (policy == null && System.getSecurityManager() != null) {
+                        throw new IllegalStateException("SecurityManager already set");
+                    } else if (policy == null) {
+                        policy = new SimplePolicy(TestCase.SECURE, allowAll);
+                        Policy.setPolicy(policy);
+                        System.setSecurityManager(new SecurityManager());
+                    }
+                    if (System.getSecurityManager() == null) {
+                        throw new IllegalStateException("No SecurityManager.");
+                    }
+                    if (policy == null) {
+                        throw new IllegalStateException("policy not configured");
+                    }
+                    break;
+                case UNSECURE:
+                    if (System.getSecurityManager() != null) {
+                        throw new IllegalStateException("SecurityManager already set");
+                    }
+                    break;
+                default:
+                    new InternalError("No such testcase: " + test);
+            }
+            doPrivileged(() -> {
+                try {
+                    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+                    propertyFile.store(bytes, propertyFile.getProperty("test.name"));
+                    ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
+                    LogManager.getLogManager().readConfiguration(bais);
+                } catch (IOException ex) {
+                    throw new RuntimeException(ex);
+                }
+            });
+        }
+        static void doPrivileged(Runnable run) {
+            allowAll.set(true);
+            try {
+                run.run();
+            } finally {
+                allowAll.set(false);
+            }
+        }
+    }
+
+    public static void test(String name, Properties props) throws Exception {
+        System.out.println("Testing: " + name);
+        String file = props.getProperty("test.file.name");
+        // create the lock files first - in order to take the path that
+        // used to trigger the NPE
+        Files.createFile(Paths.get(file + ".lck"));
+        Files.createFile(Paths.get(file + ".1.lck"));
+        final FileHandler f1 = new FileHandler();
+        final FileHandler f2 = new FileHandler();
+        f1.close();
+        f2.close();
+        System.out.println("Success for " + name);
+    }
+
+
+    final static class PermissionsBuilder {
+        final Permissions perms;
+        public PermissionsBuilder() {
+            this(new Permissions());
+        }
+        public PermissionsBuilder(Permissions perms) {
+            this.perms = perms;
+        }
+        public PermissionsBuilder add(Permission p) {
+            perms.add(p);
+            return this;
+        }
+        public PermissionsBuilder addAll(PermissionCollection col) {
+            if (col != null) {
+                for (Enumeration<Permission> e = col.elements(); e.hasMoreElements(); ) {
+                    perms.add(e.nextElement());
+                }
+            }
+            return this;
+        }
+        public Permissions toPermissions() {
+            final PermissionsBuilder builder = new PermissionsBuilder();
+            builder.addAll(perms);
+            return builder.perms;
+        }
+    }
+
+    public static class SimplePolicy extends Policy {
+
+        final Permissions permissions;
+        final Permissions allPermissions;
+        final AtomicBoolean allowAll;
+        public SimplePolicy(TestCase test, AtomicBoolean allowAll) {
+            this.allowAll = allowAll;
+            permissions = new Permissions();
+            permissions.add(new LoggingPermission("control", null)); // needed by new FileHandler()
+            permissions.add(new FilePermission("<<ALL FILES>>", "read")); // needed by new FileHandler()
+            permissions.add(new FilePermission(logFile, "write,delete")); // needed by new FileHandler()
+            permissions.add(new FilePermission(logFile+".lck", "write,delete")); // needed by FileHandler.close()
+            permissions.add(new FilePermission(logFile+".1", "write,delete")); // needed by new FileHandler()
+            permissions.add(new FilePermission(logFile+".1.lck", "write,delete")); // needed by FileHandler.close()
+            permissions.add(new FilePermission(tmpLogFile, "write,delete")); // needed by new FileHandler()
+            permissions.add(new FilePermission(tmpLogFile+".lck", "write,delete")); // needed by FileHandler.close()
+            permissions.add(new FilePermission(tmpLogFile+".1", "write,delete")); // needed by new FileHandler()
+            permissions.add(new FilePermission(tmpLogFile+".1.lck", "write,delete")); // needed by FileHandler.close()
+            permissions.add(new FilePermission(userDir, "write")); // needed by new FileHandler()
+            permissions.add(new FilePermission(tmpDir, "write")); // needed by new FileHandler()
+            permissions.add(new PropertyPermission("user.dir", "read"));
+            permissions.add(new PropertyPermission("java.io.tmpdir", "read"));
+            allPermissions = new Permissions();
+            allPermissions.add(new java.security.AllPermission());
+        }
+
+        @Override
+        public boolean implies(ProtectionDomain domain, Permission permission) {
+            if (allowAll.get()) return allPermissions.implies(permission);
+            return permissions.implies(permission);
+        }
+
+        @Override
+        public PermissionCollection getPermissions(CodeSource codesource) {
+            return new PermissionsBuilder().addAll(allowAll.get()
+                    ? allPermissions : permissions).toPermissions();
+        }
+
+        @Override
+        public PermissionCollection getPermissions(ProtectionDomain domain) {
+            return new PermissionsBuilder().addAll(allowAll.get()
+                    ? allPermissions : permissions).toPermissions();
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/logging/FileHandlerPatternExceptions.java	Mon Oct 13 14:01:45 2014 +0200
@@ -0,0 +1,331 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.AccessControlException;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.FileHandler;
+import java.util.logging.LogManager;
+
+/**
+ * @test
+ * @bug 8025690
+ * @summary tests that an empty or null pattern always result in an exception.
+ * @run main/othervm FileHandlerPatternExceptions UNSECURE
+ * @run main/othervm FileHandlerPatternExceptions SECURE
+ * @author danielfuchs
+ */
+public class FileHandlerPatternExceptions {
+
+    /**
+     * We will test null/empty pattern in two configurations.
+     * UNSECURE: No security manager.
+     * SECURE: With the security manager present - and the required
+     *         permissions granted.
+     */
+    public static enum TestCase {
+        UNSECURE, SECURE;
+        public void run(Properties propertyFile) throws Exception {
+            System.out.println("Running test case: " + name());
+            Configure.setUp(this, propertyFile);
+            test(this.name() + " " + propertyFile.getProperty("test.name"));
+        }
+    }
+
+
+    private static final String PREFIX =
+            "FileHandler-" + UUID.randomUUID() + ".log";
+    private static final String userDir = System.getProperty("user.dir", ".");
+    private static final boolean userDirWritable = Files.isWritable(Paths.get(userDir));
+
+    private static final List<Properties> properties;
+    static {
+        Properties props1 = new Properties();
+        Properties props2 = new Properties();
+        props1.setProperty("test.name", "with count=1");
+        props1.setProperty(FileHandler.class.getName() + ".pattern", "");
+        props1.setProperty(FileHandler.class.getName() + ".count", "1");
+        props2.setProperty("test.name", "with count=2");
+        props2.setProperty(FileHandler.class.getName() + ".pattern", "");
+        props2.setProperty(FileHandler.class.getName() + ".count", "2");
+        properties = Collections.unmodifiableList(Arrays.asList(
+                    props1,
+                    props2));
+    }
+
+    public static void main(String... args) throws Exception {
+
+
+        if (args == null || args.length == 0) {
+            args = new String[] {
+                TestCase.UNSECURE.name(),
+                TestCase.SECURE.name(),
+            };
+        }
+
+        try {
+            for (String testName : args) {
+                for (Properties propertyFile : properties) {
+                    TestCase test = TestCase.valueOf(testName);
+                    test.run(propertyFile);
+                }
+            }
+        } finally {
+            if (userDirWritable) {
+                Configure.doPrivileged(() -> {
+                    // cleanup - delete files that have been created
+                    try {
+                        Files.list(Paths.get(userDir))
+                            .filter((f) -> f.toString().contains(PREFIX))
+                            .forEach((f) -> {
+                                try {
+                                    System.out.println("deleting " + f);
+                                    Files.delete(f);
+                                } catch(Throwable t) {
+                                    System.err.println("Failed to delete " + f + ": " + t);
+                                }
+                            });
+                    } catch(Throwable t) {
+                        System.err.println("Cleanup failed to list files: " + t);
+                        t.printStackTrace();
+                    }
+                });
+            }
+        }
+    }
+
+    static class Configure {
+        static Policy policy = null;
+        static final AtomicBoolean allowAll = new AtomicBoolean(false);
+        static void setUp(TestCase test, Properties propertyFile) {
+            switch (test) {
+                case SECURE:
+                    if (policy == null && System.getSecurityManager() != null) {
+                        throw new IllegalStateException("SecurityManager already set");
+                    } else if (policy == null) {
+                        policy = new SimplePolicy(TestCase.SECURE, allowAll);
+                        Policy.setPolicy(policy);
+                        System.setSecurityManager(new SecurityManager());
+                    }
+                    if (System.getSecurityManager() == null) {
+                        throw new IllegalStateException("No SecurityManager.");
+                    }
+                    if (policy == null) {
+                        throw new IllegalStateException("policy not configured");
+                    }
+                    break;
+                case UNSECURE:
+                    if (System.getSecurityManager() != null) {
+                        throw new IllegalStateException("SecurityManager already set");
+                    }
+                    break;
+                default:
+                    new InternalError("No such testcase: " + test);
+            }
+            doPrivileged(() -> {
+                try {
+                    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+                    propertyFile.store(bytes, propertyFile.getProperty("test.name"));
+                    ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
+                    LogManager.getLogManager().readConfiguration(bais);
+                } catch (IOException ex) {
+                    throw new RuntimeException(ex);
+                }
+            });
+        }
+        static void doPrivileged(Runnable run) {
+            allowAll.set(true);
+            try {
+                run.run();
+            } finally {
+                allowAll.set(false);
+            }
+        }
+    }
+
+    @FunctionalInterface
+    public static interface FileHandlerSupplier {
+        public FileHandler test() throws Exception;
+    }
+
+    private static void checkException(Class<? extends Exception> type, FileHandlerSupplier test) {
+        Throwable t = null;
+        FileHandler f = null;
+        try {
+            f = test.test();
+        } catch (Throwable x) {
+            t = x;
+        }
+        try {
+            if (type != null && t == null) {
+                throw new RuntimeException("Expected " + type.getName() + " not thrown");
+            } else if (type != null && t != null) {
+                if (type.isInstance(t)) {
+                    System.out.println("Recieved expected exception: " + t);
+                } else {
+                    throw new RuntimeException("Exception type mismatch: "
+                        + type.getName() + " expected, "
+                        + t.getClass().getName() + " received.", t);
+                }
+            } else if (t != null) {
+                throw new RuntimeException("Unexpected exception received: " + t, t);
+            }
+        } finally {
+            if (f != null) {
+                // f should always be null when an exception is expected,
+                // but in case the test doesn't behave as expected we will
+                // want to close f.
+                try { f.close(); } catch (Throwable x) {};
+            }
+        }
+    }
+
+    public static void test(String name) throws Exception {
+        System.out.println("Testing: " + name);
+        checkException(RuntimeException.class, () -> new FileHandler());
+        checkException(IllegalArgumentException.class, () -> new FileHandler(""));
+        checkException(NullPointerException.class, () -> new FileHandler(null));
+
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", true));
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", false));
+        checkException(NullPointerException.class, () -> new FileHandler(null, true));
+        checkException(NullPointerException.class, () -> new FileHandler(null, false));
+
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", 1, 1));
+        checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, 0, 0));
+        checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, -1, 1));
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", 0, 0));
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", -1, 1));
+
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", 1, 1, true));
+        checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, 0, 0, true));
+        checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, -1, 1, true));
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", 0, 0, true));
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", -1, 1, true));
+
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", 1, 1, false));
+        checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, 0, 0, false));
+        checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, -1, 1, false));
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", 0, 0, false));
+        checkException(IllegalArgumentException.class, () -> new FileHandler("", -1, 1, false));
+
+        final Class<? extends Exception> expectedException =
+                System.getSecurityManager() != null ? AccessControlException.class : null;
+
+        if (userDirWritable || expectedException != null) {
+            // These calls will create files in user.dir in the UNSECURE case.
+            // The file name contain a random UUID (PREFIX) which identifies them
+            // and allow us to remove them cleanly at the end (see finally block
+            // in main()).
+            checkException(expectedException,
+                           () -> new FileHandler(PREFIX, 0, 1, true));
+            checkException(expectedException,
+                           () -> new FileHandler(PREFIX, 1, 2, true));
+            checkException(expectedException,
+                           () -> new FileHandler(PREFIX, 0, 1, false));
+            checkException(expectedException,
+                           () -> new FileHandler(PREFIX, 1, 2, false));
+        }
+    }
+
+
+    final static class PermissionsBuilder {
+        final Permissions perms;
+        public PermissionsBuilder() {
+            this(new Permissions());
+        }
+        public PermissionsBuilder(Permissions perms) {
+            this.perms = perms;
+        }
+        public PermissionsBuilder add(Permission p) {
+            perms.add(p);
+            return this;
+        }
+        public PermissionsBuilder addAll(PermissionCollection col) {
+            if (col != null) {
+                for (Enumeration<Permission> e = col.elements(); e.hasMoreElements(); ) {
+                    perms.add(e.nextElement());
+                }
+            }
+            return this;
+        }
+        public Permissions toPermissions() {
+            final PermissionsBuilder builder = new PermissionsBuilder();
+            builder.addAll(perms);
+            return builder.perms;
+        }
+    }
+
+    public static class SimplePolicy extends Policy {
+
+        final Permissions permissions;
+        final Permissions allPermissions;
+        final AtomicBoolean allowAll;
+        public SimplePolicy(TestCase test, AtomicBoolean allowAll) {
+            this.allowAll = allowAll;
+            // we don't actually need any permission to create our
+            // FileHandlers because we're passing invalid parameters
+            // which will make the creation fail...
+            permissions = new Permissions();
+
+            // these are used for configuring the test itself...
+            allPermissions = new Permissions();
+            allPermissions.add(new java.security.AllPermission());
+
+        }
+
+        @Override
+        public boolean implies(ProtectionDomain domain, Permission permission) {
+            if (allowAll.get()) return allPermissions.implies(permission);
+            return permissions.implies(permission);
+        }
+
+        @Override
+        public PermissionCollection getPermissions(CodeSource codesource) {
+            return new PermissionsBuilder().addAll(allowAll.get()
+                    ? allPermissions : permissions).toPermissions();
+        }
+
+        @Override
+        public PermissionCollection getPermissions(ProtectionDomain domain) {
+            return new PermissionsBuilder().addAll(allowAll.get()
+                    ? allPermissions : permissions).toPermissions();
+        }
+    }
+
+}
--- a/test/sun/security/tools/keytool/autotest.sh	Mon Oct 13 13:44:01 2014 +0200
+++ b/test/sun/security/tools/keytool/autotest.sh	Mon Oct 13 14:01:45 2014 +0200
@@ -84,6 +84,11 @@
             "/usr/lib/nss/libsoftokn3.so"`
     fi
     ;;
+  Darwin )
+    LIBNAME=`find_one \
+            "/Applications/Firefox.app/Contents/MacOS/libsoftokn3.dylib" \
+            "/Applications/Thunderbird.app//Contents/MacOS/libsoftokn3.dylib"`
+    ;;
   * )
     echo "Will not run test on: ${OS}"
     exit 0;
@@ -95,6 +100,12 @@
   exit 0
 fi
 
+echo "Using NSS lib at $LIBNAME"
+
+if [ $OS = Darwin ]; then
+    export DYLD_LIBRARY_PATH=`dirname $LIBNAME`
+fi
+
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . -XDignore.symbol.file \
         ${TESTSRC}${FS}KeyToolTest.java || exit 10