changeset 12687:3e67c9656fe5

Merge
author valeriep
date Thu, 10 May 2012 11:19:22 -0700
parents 41113adba8d6 f438283ab987
children f15fd32c975e
files
diffstat 16 files changed, 100 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/make/com/oracle/security/ucrypto/Makefile	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/make/com/oracle/security/ucrypto/Makefile	Thu May 10 11:19:22 2012 -0700
@@ -139,7 +139,7 @@
   #
   CLASSDESTDIR = $(TEMPDIR)/classes
   JAVAHFLAGS = -bootclasspath \
-    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
   include $(BUILDDIR)/common/Mapfile-vers.gmk
   include $(BUILDDIR)/common/Library.gmk
--- a/jdk/make/common/shared/Defs-java.gmk	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/make/common/shared/Defs-java.gmk	Thu May 10 11:19:22 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@
 # built implicitly/explicitly.
 #
 ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),)
-  JCEFLAGS = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
+  JCE_PATH = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
 endif
 
 # Add the source level
@@ -152,11 +152,11 @@
 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 JAVACFLAGS  += $(CLASS_VERSION)
 JAVACFLAGS  += -encoding ascii
-JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCEFLAGS)"
+JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCE_PATH)"
 JAVACFLAGS  += $(OTHER_JAVACFLAGS)
 
 # Needed for javah
-JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCEFLAGS)"
+JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCE_PATH)"
 
 # Needed for javadoc to ensure it builds documentation
 # against the newly built classes
--- a/jdk/make/sun/security/ec/Makefile	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/make/sun/security/ec/Makefile	Thu May 10 11:19:22 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, 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
@@ -160,7 +160,7 @@
       $(PKGDIR)/ECKeyPairGenerator.java
 
   JAVAHFLAGS = -bootclasspath \
-      "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+      "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 
   #
--- a/jdk/make/sun/security/mscapi/Makefile	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/make/sun/security/mscapi/Makefile	Thu May 10 11:19:22 2012 -0700
@@ -150,7 +150,7 @@
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
 JAVAHFLAGS = -bootclasspath \
-  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/jdk/make/sun/security/pkcs11/Makefile	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/make/sun/security/pkcs11/Makefile	Thu May 10 11:19:22 2012 -0700
@@ -151,7 +151,7 @@
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
 JAVAHFLAGS = -bootclasspath \
-    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/jdk/makefiles/com/oracle/security/ucrypto/Makefile	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/makefiles/com/oracle/security/ucrypto/Makefile	Thu May 10 11:19:22 2012 -0700
@@ -139,7 +139,7 @@
   #
   CLASSDESTDIR = $(TEMPDIR)/classes
   JAVAHFLAGS = -bootclasspath \
-    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
   include $(BUILDDIR)/common/Mapfile-vers.gmk
   include $(BUILDDIR)/common/Library.gmk
--- a/jdk/makefiles/common/shared/Defs-java.gmk	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/makefiles/common/shared/Defs-java.gmk	Thu May 10 11:19:22 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2012, 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
@@ -141,7 +141,7 @@
 # built implicitly/explicitly.
 #
 ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),)
-  JCEFLAGS = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
+  JCE_PATH = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
 endif
 
 # Add the source level
@@ -154,11 +154,11 @@
 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 JAVACFLAGS  += $(CLASS_VERSION)
 JAVACFLAGS  += -encoding ascii
-JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCEFLAGS)"
+JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCE_PATH)"
 JAVACFLAGS  += $(OTHER_JAVACFLAGS)
 
 # Needed for javah
-JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCEFLAGS)"
+JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCE_PATH)"
 
 # Needed for javadoc to ensure it builds documentation
 # against the newly built classes
--- a/jdk/makefiles/sun/security/ec/Makefile	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/makefiles/sun/security/ec/Makefile	Thu May 10 11:19:22 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, 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
@@ -159,7 +159,8 @@
       $(PKGDIR)/ECDSASignature.java \
       $(PKGDIR)/ECKeyPairGenerator.java
 
-  JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
+  JAVAHFLAGS = -bootclasspath \
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
   #
   # C and C++ files
--- a/jdk/makefiles/sun/security/mscapi/Makefile	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/makefiles/sun/security/mscapi/Makefile	Thu May 10 11:19:22 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -149,7 +149,8 @@
 # Rules
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
-JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
+JAVAHFLAGS = -bootclasspath \
+  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/jdk/makefiles/sun/security/pkcs11/Makefile	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/makefiles/sun/security/pkcs11/Makefile	Thu May 10 11:19:22 2012 -0700
@@ -150,7 +150,8 @@
 # Rules
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
-JAVAHFLAGS = -bootclasspath "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+JAVAHFLAGS = -bootclasspath \
+  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/jdk/src/share/classes/java/util/prefs/AbstractPreferences.java	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/src/share/classes/java/util/prefs/AbstractPreferences.java	Thu May 10 11:19:22 2012 -0700
@@ -305,8 +305,10 @@
      * @param key key whose mapping is to be removed from the preference node.
      * @throws IllegalStateException if this node (or an ancestor) has been
      *         removed with the {@link #removeNode()} method.
+     * @throws NullPointerException {@inheritDoc}.
      */
     public void remove(String key) {
+        Objects.requireNonNull(key, "Specified key cannot be null");
         synchronized(lock) {
             if (removed)
                 throw new IllegalStateException("Node has been removed.");
--- a/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Thu May 10 11:19:22 2012 -0700
@@ -629,17 +629,6 @@
                                 break;
                             }
 
-                            synchronized (stateLock) {
-                                if (isOpen() && (localAddress == null) ||
-                                    ((InetSocketAddress)localAddress)
-                                        .getAddress().isAnyLocalAddress())
-                                {
-                                    // Socket was not bound before connecting or
-                                    // Socket was bound with an "anyLocalAddress"
-                                    localAddress = Net.localAddress(fd);
-                                }
-                            }
-
                         } finally {
                             readerCleanup();
                             end((n > 0) || (n == IOStatus.UNAVAILABLE));
@@ -659,6 +648,8 @@
                             // Connection succeeded; disallow further
                             // invocation
                             state = ST_CONNECTED;
+                            if (isOpen())
+                                localAddress = Net.localAddress(fd);
                             return true;
                         }
                         // If nonblocking and no exception then connection
@@ -747,6 +738,8 @@
                 if (n > 0) {
                     synchronized (stateLock) {
                         state = ST_CONNECTED;
+                        if (isOpen())
+                            localAddress = Net.localAddress(fd);
                     }
                     return true;
                 }
--- a/jdk/src/share/classes/sun/security/provider/SecureRandom.java	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/src/share/classes/sun/security/provider/SecureRandom.java	Thu May 10 11:19:22 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -102,7 +102,7 @@
         try {
             digest = MessageDigest.getInstance ("SHA");
         } catch (NoSuchAlgorithmException e) {
-            throw new InternalError("internal error: SHA-1 not available.");
+            throw new InternalError("internal error: SHA-1 not available.", e);
         }
 
         if (seed != null) {
--- a/jdk/src/share/demo/management/MemoryMonitor/README.txt	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/src/share/demo/management/MemoryMonitor/README.txt	Thu May 10 11:19:22 2012 -0700
@@ -38,7 +38,7 @@
 
 To run the MemoryMonitor demo
 
-   java -jar <JDK_HOME>/demo/management/MemoryMonitor.jar 
+   java -jar <JDK_HOME>/demo/management/MemoryMonitor/MemoryMonitor.jar 
 
 These instructions assume that this installation's version of the java
 command is in your path.  If it isn't, then you should either
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp	Thu May 10 11:19:22 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -82,7 +82,11 @@
 static unpacker* get_unpacker() {
   //fprintf(stderr, "get_unpacker()\n");
   JavaVM* vm = null;
-  JNI_GetCreatedJavaVMs(&vm, 1, null);
+  jsize nVM = 0;
+  jint retval = JNI_GetCreatedJavaVMs(&vm, 1, &nVM);
+  // other VM implements may differ, thus for correctness, we need these checks
+  if (retval != JNI_OK || nVM != 1)
+    return null;
   void* envRaw = null;
   vm->GetEnv(&envRaw, JNI_VERSION_1_1);
   JNIEnv* env = (JNIEnv*) envRaw;
--- a/jdk/test/java/util/prefs/RemoveNullKeyCheck.java	Tue May 08 18:57:45 2012 -0700
+++ b/jdk/test/java/util/prefs/RemoveNullKeyCheck.java	Thu May 10 11:19:22 2012 -0700
@@ -22,23 +22,77 @@
  */
 
 /* @test
- * @bug 7160242
+ * @bug 7160242 7165118
  * @summary Check if NullPointerException is thrown if the key passed
  *          to remove() is null.
  */
 
 import java.util.prefs.Preferences;
+import java.util.prefs.AbstractPreferences;
+import java.util.prefs.BackingStoreException;
 
 public class RemoveNullKeyCheck {
 
+    private static boolean failed = false;
+
     public static void main(String[] args) throws Exception {
-       try {
-           Preferences node = Preferences.userRoot().node("N1");
-           node.remove(null);
-           throw new RuntimeException("Expected NullPointerException " +
-                                      "not thrown");
-       } catch (NullPointerException npe) {
-           System.out.println("NullPointerException thrown");
-       }
+        checkPreferencesRemove();
+        checkAbstractPreferencesRemove();
+        if (failed) {
+            throw new RuntimeException("Expected NullPointerException " +
+                                       "not thrown");
+        }
+    }
+
+    public static void checkPreferencesRemove() {
+        try {
+            Preferences node = Preferences.userRoot().node("N1");
+            node.remove(null);
+            failed = true;
+        } catch (NullPointerException npe) {
+        }
+    }
+
+    public static void checkAbstractPreferencesRemove() {
+
+        Preferences abstrPrefs = new AbstractPreferences(null, "") {
+            @Override
+            protected void putSpi(String key, String value) {
+            }
+            @Override
+            protected String getSpi(String key) {
+                return null;
+            }
+            @Override
+            protected void removeSpi(String key) {
+            }
+            @Override
+            protected void removeNodeSpi() throws BackingStoreException {
+            }
+            @Override
+            protected String[] keysSpi() throws BackingStoreException {
+                return new String[0];
+            }
+            @Override
+            protected String[] childrenNamesSpi() throws BackingStoreException {
+                return new String[0];
+            }
+            @Override
+            protected AbstractPreferences childSpi(String name) {
+                return null;
+            }
+            @Override
+            protected void syncSpi() throws BackingStoreException {
+            }
+            @Override
+            protected void flushSpi() throws BackingStoreException {
+            }
+        };
+
+        try {
+            abstrPrefs.remove(null);
+            failed = true;
+        } catch(NullPointerException npe) {
+        }
     }
 }