Merge
This commit is contained in:
commit
4dfbf0acd1
@ -139,7 +139,7 @@ ifndef OPENJDK
|
||||
#
|
||||
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
|
||||
|
@ -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 @@ JAVACFLAGS += $(JAVAC_LINT_OPTIONS)
|
||||
# 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 @@ TARGET_CLASS_VERSION = 7
|
||||
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
|
||||
|
@ -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 @@ ifeq ($(NATIVE_ECC_AVAILABLE), true)
|
||||
$(PKGDIR)/ECKeyPairGenerator.java
|
||||
|
||||
JAVAHFLAGS = -bootclasspath \
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
|
||||
|
||||
|
||||
#
|
||||
|
@ -150,7 +150,7 @@ OTHER_INCLUDES += \
|
||||
#
|
||||
CLASSDESTDIR = $(TEMPDIR)/classes
|
||||
JAVAHFLAGS = -bootclasspath \
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
|
||||
|
||||
include $(BUILDDIR)/common/Mapfile-vers.gmk
|
||||
|
||||
|
@ -151,7 +151,7 @@ OTHER_INCLUDES += \
|
||||
#
|
||||
CLASSDESTDIR = $(TEMPDIR)/classes
|
||||
JAVAHFLAGS = -bootclasspath \
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
|
||||
|
||||
include $(BUILDDIR)/common/Mapfile-vers.gmk
|
||||
|
||||
|
@ -139,7 +139,7 @@ ifndef OPENJDK
|
||||
#
|
||||
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
|
||||
|
@ -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 @@ JAVACFLAGS += $(JAVAC_LINT_OPTIONS)
|
||||
# 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 @@ TARGET_CLASS_VERSION = 7
|
||||
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
|
||||
|
@ -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 @@ ifeq ($(NATIVE_ECC_AVAILABLE), true)
|
||||
$(PKGDIR)/ECDSASignature.java \
|
||||
$(PKGDIR)/ECKeyPairGenerator.java
|
||||
|
||||
JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
|
||||
JAVAHFLAGS = -bootclasspath \
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
|
||||
|
||||
#
|
||||
# C and C++ files
|
||||
|
@ -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 @@ OTHER_INCLUDES += \
|
||||
# Rules
|
||||
#
|
||||
CLASSDESTDIR = $(TEMPDIR)/classes
|
||||
JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
|
||||
JAVAHFLAGS = -bootclasspath \
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
|
||||
|
||||
include $(BUILDDIR)/common/Mapfile-vers.gmk
|
||||
|
||||
|
@ -150,7 +150,8 @@ OTHER_INCLUDES += \
|
||||
# Rules
|
||||
#
|
||||
CLASSDESTDIR = $(TEMPDIR)/classes
|
||||
JAVAHFLAGS = -bootclasspath "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
|
||||
JAVAHFLAGS = -bootclasspath \
|
||||
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
|
||||
|
||||
include $(BUILDDIR)/common/Mapfile-vers.gmk
|
||||
|
||||
|
@ -305,8 +305,10 @@ public abstract class AbstractPreferences extends Preferences {
|
||||
* @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.");
|
||||
|
@ -629,17 +629,6 @@ class SocketChannelImpl
|
||||
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 @@ class SocketChannelImpl
|
||||
// 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 @@ class SocketChannelImpl
|
||||
if (n > 0) {
|
||||
synchronized (stateLock) {
|
||||
state = ST_CONNECTED;
|
||||
if (isOpen())
|
||||
localAddress = Net.localAddress(fd);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -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 @@ implements java.io.Serializable {
|
||||
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) {
|
||||
|
@ -38,7 +38,7 @@ and plots the memory usage history graph.
|
||||
|
||||
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
|
||||
|
@ -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(JNIEnv *env, jobject pObj, bool noCreate=false) {
|
||||
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;
|
||||
|
@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user