提交 dea63d31 编写于 作者: V valeriep

Merge

...@@ -139,7 +139,7 @@ ifndef OPENJDK ...@@ -139,7 +139,7 @@ ifndef OPENJDK
# #
CLASSDESTDIR = $(TEMPDIR)/classes CLASSDESTDIR = $(TEMPDIR)/classes
JAVAHFLAGS = -bootclasspath \ JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)" "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
include $(BUILDDIR)/common/Mapfile-vers.gmk include $(BUILDDIR)/common/Mapfile-vers.gmk
include $(BUILDDIR)/common/Library.gmk include $(BUILDDIR)/common/Library.gmk
......
# #
# 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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -139,7 +139,7 @@ JAVACFLAGS += $(JAVAC_LINT_OPTIONS) ...@@ -139,7 +139,7 @@ JAVACFLAGS += $(JAVAC_LINT_OPTIONS)
# built implicitly/explicitly. # built implicitly/explicitly.
# #
ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),) ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),)
JCEFLAGS = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar JCE_PATH = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
endif endif
# Add the source level # Add the source level
...@@ -152,11 +152,11 @@ TARGET_CLASS_VERSION = 7 ...@@ -152,11 +152,11 @@ TARGET_CLASS_VERSION = 7
CLASS_VERSION = -target $(TARGET_CLASS_VERSION) CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
JAVACFLAGS += $(CLASS_VERSION) JAVACFLAGS += $(CLASS_VERSION)
JAVACFLAGS += -encoding ascii JAVACFLAGS += -encoding ascii
JAVACFLAGS += "-Xbootclasspath:$(CLASSBINDIR)$(JCEFLAGS)" JAVACFLAGS += "-Xbootclasspath:$(CLASSBINDIR)$(JCE_PATH)"
JAVACFLAGS += $(OTHER_JAVACFLAGS) JAVACFLAGS += $(OTHER_JAVACFLAGS)
# Needed for javah # Needed for javah
JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCEFLAGS)" JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCE_PATH)"
# Needed for javadoc to ensure it builds documentation # Needed for javadoc to ensure it builds documentation
# against the newly built classes # against the newly built classes
......
# #
# 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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -160,7 +160,7 @@ ifeq ($(NATIVE_ECC_AVAILABLE), true) ...@@ -160,7 +160,7 @@ ifeq ($(NATIVE_ECC_AVAILABLE), true)
$(PKGDIR)/ECKeyPairGenerator.java $(PKGDIR)/ECKeyPairGenerator.java
JAVAHFLAGS = -bootclasspath \ JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)" "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
# #
......
...@@ -150,7 +150,7 @@ OTHER_INCLUDES += \ ...@@ -150,7 +150,7 @@ OTHER_INCLUDES += \
# #
CLASSDESTDIR = $(TEMPDIR)/classes CLASSDESTDIR = $(TEMPDIR)/classes
JAVAHFLAGS = -bootclasspath \ JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)" "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
include $(BUILDDIR)/common/Mapfile-vers.gmk include $(BUILDDIR)/common/Mapfile-vers.gmk
......
...@@ -151,7 +151,7 @@ OTHER_INCLUDES += \ ...@@ -151,7 +151,7 @@ OTHER_INCLUDES += \
# #
CLASSDESTDIR = $(TEMPDIR)/classes CLASSDESTDIR = $(TEMPDIR)/classes
JAVAHFLAGS = -bootclasspath \ JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)" "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
include $(BUILDDIR)/common/Mapfile-vers.gmk include $(BUILDDIR)/common/Mapfile-vers.gmk
......
...@@ -139,7 +139,7 @@ ifndef OPENJDK ...@@ -139,7 +139,7 @@ ifndef OPENJDK
# #
CLASSDESTDIR = $(TEMPDIR)/classes CLASSDESTDIR = $(TEMPDIR)/classes
JAVAHFLAGS = -bootclasspath \ JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)" "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
include $(BUILDDIR)/common/Mapfile-vers.gmk include $(BUILDDIR)/common/Mapfile-vers.gmk
include $(BUILDDIR)/common/Library.gmk include $(BUILDDIR)/common/Library.gmk
......
# #
# 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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -141,7 +141,7 @@ JAVACFLAGS += $(JAVAC_LINT_OPTIONS) ...@@ -141,7 +141,7 @@ JAVACFLAGS += $(JAVAC_LINT_OPTIONS)
# built implicitly/explicitly. # built implicitly/explicitly.
# #
ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),) ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),)
JCEFLAGS = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar JCE_PATH = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
endif endif
# Add the source level # Add the source level
...@@ -154,11 +154,11 @@ TARGET_CLASS_VERSION = 7 ...@@ -154,11 +154,11 @@ TARGET_CLASS_VERSION = 7
CLASS_VERSION = -target $(TARGET_CLASS_VERSION) CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
JAVACFLAGS += $(CLASS_VERSION) JAVACFLAGS += $(CLASS_VERSION)
JAVACFLAGS += -encoding ascii JAVACFLAGS += -encoding ascii
JAVACFLAGS += "-Xbootclasspath:$(CLASSBINDIR)$(JCEFLAGS)" JAVACFLAGS += "-Xbootclasspath:$(CLASSBINDIR)$(JCE_PATH)"
JAVACFLAGS += $(OTHER_JAVACFLAGS) JAVACFLAGS += $(OTHER_JAVACFLAGS)
# Needed for javah # Needed for javah
JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCEFLAGS)" JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCE_PATH)"
# Needed for javadoc to ensure it builds documentation # Needed for javadoc to ensure it builds documentation
# against the newly built classes # against the newly built classes
......
# #
# 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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -159,7 +159,8 @@ ifeq ($(NATIVE_ECC_AVAILABLE), true) ...@@ -159,7 +159,8 @@ ifeq ($(NATIVE_ECC_AVAILABLE), true)
$(PKGDIR)/ECDSASignature.java \ $(PKGDIR)/ECDSASignature.java \
$(PKGDIR)/ECKeyPairGenerator.java $(PKGDIR)/ECKeyPairGenerator.java
JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR) JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
# #
# C and C++ files # C and C++ files
......
# #
# 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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -149,7 +149,8 @@ OTHER_INCLUDES += \ ...@@ -149,7 +149,8 @@ OTHER_INCLUDES += \
# Rules # Rules
# #
CLASSDESTDIR = $(TEMPDIR)/classes CLASSDESTDIR = $(TEMPDIR)/classes
JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR) JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
include $(BUILDDIR)/common/Mapfile-vers.gmk include $(BUILDDIR)/common/Mapfile-vers.gmk
......
...@@ -150,7 +150,8 @@ OTHER_INCLUDES += \ ...@@ -150,7 +150,8 @@ OTHER_INCLUDES += \
# Rules # Rules
# #
CLASSDESTDIR = $(TEMPDIR)/classes CLASSDESTDIR = $(TEMPDIR)/classes
JAVAHFLAGS = -bootclasspath "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)" JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
include $(BUILDDIR)/common/Mapfile-vers.gmk include $(BUILDDIR)/common/Mapfile-vers.gmk
......
...@@ -305,8 +305,10 @@ public abstract class AbstractPreferences extends Preferences { ...@@ -305,8 +305,10 @@ public abstract class AbstractPreferences extends Preferences {
* @param key key whose mapping is to be removed from the preference node. * @param key key whose mapping is to be removed from the preference node.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException {@inheritDoc}.
*/ */
public void remove(String key) { public void remove(String key) {
Objects.requireNonNull(key, "Specified key cannot be null");
synchronized(lock) { synchronized(lock) {
if (removed) if (removed)
throw new IllegalStateException("Node has been removed."); throw new IllegalStateException("Node has been removed.");
......
...@@ -629,17 +629,6 @@ class SocketChannelImpl ...@@ -629,17 +629,6 @@ class SocketChannelImpl
break; 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 { } finally {
readerCleanup(); readerCleanup();
end((n > 0) || (n == IOStatus.UNAVAILABLE)); end((n > 0) || (n == IOStatus.UNAVAILABLE));
...@@ -659,6 +648,8 @@ class SocketChannelImpl ...@@ -659,6 +648,8 @@ class SocketChannelImpl
// Connection succeeded; disallow further // Connection succeeded; disallow further
// invocation // invocation
state = ST_CONNECTED; state = ST_CONNECTED;
if (isOpen())
localAddress = Net.localAddress(fd);
return true; return true;
} }
// If nonblocking and no exception then connection // If nonblocking and no exception then connection
...@@ -747,6 +738,8 @@ class SocketChannelImpl ...@@ -747,6 +738,8 @@ class SocketChannelImpl
if (n > 0) { if (n > 0) {
synchronized (stateLock) { synchronized (stateLock) {
state = ST_CONNECTED; state = ST_CONNECTED;
if (isOpen())
localAddress = Net.localAddress(fd);
} }
return true; return true;
} }
......
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -102,7 +102,7 @@ implements java.io.Serializable { ...@@ -102,7 +102,7 @@ implements java.io.Serializable {
try { try {
digest = MessageDigest.getInstance ("SHA"); digest = MessageDigest.getInstance ("SHA");
} catch (NoSuchAlgorithmException e) { } 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) { if (seed != null) {
......
...@@ -38,7 +38,7 @@ and plots the memory usage history graph. ...@@ -38,7 +38,7 @@ and plots the memory usage history graph.
To run the MemoryMonitor demo 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 These instructions assume that this installation's version of the java
command is in your path. If it isn't, then you should either command is in your path. If it isn't, then you should either
......
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -82,7 +82,11 @@ static unpacker* get_unpacker(JNIEnv *env, jobject pObj, bool noCreate=false) { ...@@ -82,7 +82,11 @@ static unpacker* get_unpacker(JNIEnv *env, jobject pObj, bool noCreate=false) {
static unpacker* get_unpacker() { static unpacker* get_unpacker() {
//fprintf(stderr, "get_unpacker()\n"); //fprintf(stderr, "get_unpacker()\n");
JavaVM* vm = null; 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; void* envRaw = null;
vm->GetEnv(&envRaw, JNI_VERSION_1_1); vm->GetEnv(&envRaw, JNI_VERSION_1_1);
JNIEnv* env = (JNIEnv*) envRaw; JNIEnv* env = (JNIEnv*) envRaw;
......
...@@ -22,23 +22,77 @@ ...@@ -22,23 +22,77 @@
*/ */
/* @test /* @test
* @bug 7160242 * @bug 7160242 7165118
* @summary Check if NullPointerException is thrown if the key passed * @summary Check if NullPointerException is thrown if the key passed
* to remove() is null. * to remove() is null.
*/ */
import java.util.prefs.Preferences; import java.util.prefs.Preferences;
import java.util.prefs.AbstractPreferences;
import java.util.prefs.BackingStoreException;
public class RemoveNullKeyCheck { public class RemoveNullKeyCheck {
private static boolean failed = false;
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
try { checkPreferencesRemove();
Preferences node = Preferences.userRoot().node("N1"); checkAbstractPreferencesRemove();
node.remove(null); if (failed) {
throw new RuntimeException("Expected NullPointerException " + throw new RuntimeException("Expected NullPointerException " +
"not thrown"); "not thrown");
} catch (NullPointerException npe) { }
System.out.println("NullPointerException 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) {
}
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册