From 2ae66a0f292cab0cbebe6b8f891dad2e53693731 Mon Sep 17 00:00:00 2001
From: Yumin Qi
Date: Wed, 26 Nov 2014 15:33:43 -0800
Subject: [PATCH 01/20] 8038468:
java/lang/instrument/ParallelTransformerLoader.sh fails with
ClassCircularityError
Add check null for loader in transform to avoid when loading a class in callback handler for boot loader, CFLH set early enough to catch classes needed during class loading, i.e. sun.misc.URLClassPath$JarLoader$2 seen in the failure.
Reviewed-by: acorn, sspitsyn
---
.../ParallelTransformerLoaderAgent.java | 25 ++++++-------------
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/jdk/test/java/lang/instrument/ParallelTransformerLoaderAgent.java b/jdk/test/java/lang/instrument/ParallelTransformerLoaderAgent.java
index 96f4900b6d7..26a5801a908 100644
--- a/jdk/test/java/lang/instrument/ParallelTransformerLoaderAgent.java
+++ b/jdk/test/java/lang/instrument/ParallelTransformerLoaderAgent.java
@@ -79,24 +79,15 @@ public class ParallelTransformerLoaderAgent
throws IllegalClassFormatException
{
String tName = Thread.currentThread().getName();
- // In 160_03 and older, transform() is called
- // with the "system_loader_lock" held and that
- // prevents the bootstrap class loaded from
- // running in parallel. If we add a slight sleep
- // delay here when the transform() call is not
- // main or TestThread, then the deadlock in
- // 160_03 and older is much more reproducible.
- if (!tName.equals("main") && !tName.equals("TestThread")) {
- System.out.println("Thread '" + tName +
- "' has called transform()");
- try {
- Thread.sleep(500);
- } catch (InterruptedException ie) {
- }
- }
- // load additional classes when called from other threads
- if (!tName.equals("main"))
+ // Load additional classes when called from thread 'TestThread'
+ // When a class is loaded during a callback handling the boot loader, we can
+ // run into ClassCircularityError if the ClassFileLoadHook is set early enough
+ // to catch classes needed during class loading, e.g.
+ // sun.misc.URLClassPath$JarLoader$2.
+ // The goal of the test is to stress class loading on the test class loaders.
+
+ if (tName.equals("TestThread") && loader != null)
{
loadClasses(3);
}
From f12ce83a250bd80a93f66a4b1e63378b85a7bf9d Mon Sep 17 00:00:00 2001
From: Erik Gahlin
Date: Fri, 28 Nov 2014 16:56:45 +0100
Subject: [PATCH 02/20] 6618335: ThreadReference.stop(null) throws NPE instead
of InvalidTypeException
Reviewed-by: sla
---
.../share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java
index 903477118a9..34abb5f5137 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -238,7 +238,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl
}
public void stop(ObjectReference throwable) throws InvalidTypeException {
- validateMirror(throwable);
+ validateMirrorOrNull(throwable);
// Verify that the given object is a Throwable instance
List list = vm.classesByName("java.lang.Throwable");
ClassTypeImpl throwableClass = (ClassTypeImpl)list.get(0);
From e325ce88cbf869875377e19780ee28f59a6e321b Mon Sep 17 00:00:00 2001
From: Katja Kantserova
Date: Mon, 1 Dec 2014 09:49:44 +0100
Subject: [PATCH 03/20] 8066106: sun/tools/jps/TestJpsClass.java failed to
remove stale attach pid file
Reviewed-by: jbachorik
---
.../lib/testlibrary/OutputAnalyzerTest.java | 15 +++++++
.../jdk/testlibrary/OutputAnalyzer.java | 43 ++++++++++++++++---
jdk/test/sun/tools/jps/JpsHelper.java | 10 ++---
3 files changed, 57 insertions(+), 11 deletions(-)
diff --git a/jdk/test/lib/testlibrary/OutputAnalyzerTest.java b/jdk/test/lib/testlibrary/OutputAnalyzerTest.java
index af2b8f6b14a..cb251b37964 100644
--- a/jdk/test/lib/testlibrary/OutputAnalyzerTest.java
+++ b/jdk/test/lib/testlibrary/OutputAnalyzerTest.java
@@ -112,8 +112,10 @@ public class OutputAnalyzerTest {
}
String stdoutPattern = "[a]";
+ String stdoutByLinePattern = "a*";
String stderrPattern = "[b]";
String nonExistingPattern = "[c]";
+ String byLinePattern = "[ab]*";
// Should match
try {
@@ -148,6 +150,19 @@ public class OutputAnalyzerTest {
// expected
}
+ if (output.shouldMatchByLine(byLinePattern) != 1) {
+ throw new Exception("shouldMatchByLine() should find one line");
+ }
+ try {
+ output.shouldMatchByLine(nonExistingPattern);
+ throw new Exception("shouldMatchByLine() failed to throw exception");
+ } catch (RuntimeException e) {
+ // expected
+ }
+ if (output.stdoutShouldMatchByLine(stdoutByLinePattern) != 1) {
+ throw new Exception("stdoutShouldMatchByLine() should find one line");
+ }
+
// Should not match
try {
output.shouldNotMatch(nonExistingPattern);
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java b/jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java
index ad1d2ab8ea3..88819e4d594 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java
@@ -25,13 +25,9 @@ package jdk.testlibrary;
import static jdk.testlibrary.Asserts.*;
-import java.io.ByteArrayOutputStream;
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -414,8 +410,12 @@ public final class OutputAnalyzer {
* @return Contents of the output buffer as list of strings
*/
public List asLines() {
+ return asLines(getOutput());
+ }
+
+ private List asLines(String buffer) {
List l = new ArrayList<>();
- String[] a = getOutput().split(Utils.NEW_LINE);
+ String[] a = buffer.split(Utils.NEW_LINE);
for (String string : a) {
l.add(string);
}
@@ -444,6 +444,13 @@ public final class OutputAnalyzer {
return shouldMatchByLine(null, null, pattern);
}
+ /**
+ * @see #stdoutShouldMatchByLine(String, String, String)
+ */
+ public int stdoutShouldMatchByLine(String pattern) {
+ return stdoutShouldMatchByLine(null, null, pattern);
+ }
+
/**
* @see #shouldMatchByLine(String, String, String)
*/
@@ -474,7 +481,30 @@ public final class OutputAnalyzer {
* @return Count of lines which match the {@code pattern}
*/
public int shouldMatchByLine(String from, String to, String pattern) {
- List lines = asLines();
+ return shouldMatchByLine(getOutput(), from, to, pattern);
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer matches the
+ * {@code pattern} line by line. The whole stdout could be matched or
+ * just a subset of it.
+ *
+ * @param from
+ * The line from where stdout will be matched.
+ * Set {@code from} to null for matching from the first line.
+ * @param to
+ * The line until where stdout will be matched.
+ * Set {@code to} to null for matching until the last line.
+ * @param pattern
+ * Matching pattern
+ * @return Count of lines which match the {@code pattern}
+ */
+ public int stdoutShouldMatchByLine(String from, String to, String pattern) {
+ return shouldMatchByLine(getStdout(), from, to, pattern);
+ }
+
+ private int shouldMatchByLine(String buffer, String from, String to, String pattern) {
+ List lines = asLines(buffer);
int fromIndex = 0;
if (from != null) {
@@ -500,4 +530,5 @@ public final class OutputAnalyzer {
return matchedCount;
}
+
}
diff --git a/jdk/test/sun/tools/jps/JpsHelper.java b/jdk/test/sun/tools/jps/JpsHelper.java
index 4e00cc95de4..655b5eb465e 100644
--- a/jdk/test/sun/tools/jps/JpsHelper.java
+++ b/jdk/test/sun/tools/jps/JpsHelper.java
@@ -168,10 +168,8 @@ public final class JpsHelper {
}
/**
- * Verify jps output contains pids and programs' name information.
- * The function will discard any lines that come before the first line with pid.
- * This can happen if the JVM outputs a warning message for some reason
- * before running jps.
+ * Verify jps stdout contains only pids and programs' name information.
+ * jps stderr may contain VM warning messages which will be ignored.
*
* The output can look like:
* 35536 Jps
@@ -180,8 +178,10 @@ public final class JpsHelper {
*/
public static void verifyJpsOutput(OutputAnalyzer output, String regex) throws Exception {
output.shouldHaveExitValue(0);
- int matchedCount = output.shouldMatchByLineFrom(regex, regex);
+ int matchedCount = output.stdoutShouldMatchByLine(regex);
assertGreaterThan(matchedCount , 0, "Found no lines matching pattern: " + regex);
+ output.stderrShouldNotMatch("[E|e]xception");
+ output.stderrShouldNotMatch("[E|e]rror");
}
/**
From 07b4a3626e78958abb954bd57731d15bd0e9c413 Mon Sep 17 00:00:00 2001
From: Yuri Gaevsky
Date: Tue, 2 Dec 2014 16:21:33 +0100
Subject: [PATCH 04/20] 6364329: jstat displays "invalid argument count" with
usage
Reviewed-by: jbachorik
---
.../classes/sun/tools/jstat/Arguments.java | 7 ++++---
jdk/test/sun/tools/jstat/jstatHelp.sh | 20 ++++++++++++++-----
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java
index 523bc504de7..a2e9813274c 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -141,8 +141,9 @@ public class Arguments {
public Arguments(String[] args) throws IllegalArgumentException {
int argc = 0;
- if (args.length < 1) {
- throw new IllegalArgumentException("invalid argument count");
+ if (args.length == 0) {
+ help = true;
+ return;
}
if ((args[0].compareTo("-?") == 0)
diff --git a/jdk/test/sun/tools/jstat/jstatHelp.sh b/jdk/test/sun/tools/jstat/jstatHelp.sh
index 3dac1ae407f..37c094f4cf3 100644
--- a/jdk/test/sun/tools/jstat/jstatHelp.sh
+++ b/jdk/test/sun/tools/jstat/jstatHelp.sh
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -22,9 +22,9 @@
#
# @test
-# @bug 4990825
+# @bug 4990825 6364329
# @run shell jstatHelp.sh
-# @summary Test that output of 'jstat -?' matches the usage.out file
+# @summary Test that output of 'jstat -?', 'jstat -help' and 'jstat' matches the usage.out file
. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh
@@ -38,7 +38,7 @@ ${JSTAT} -J-XX:+UsePerfData -? > jstat.out 2>&1
diff -w jstat.out ${TESTSRC}/usage.out
if [ $? != 0 ]
then
- echo "Output of jstat -? differ from expected output. Failed."
+ echo "Output of jstat -? differs from expected output. Failed."
exit 1
fi
@@ -48,7 +48,17 @@ ${JSTAT} -J-XX:+UsePerfData -help > jstat.out 2>&1
diff -w jstat.out ${TESTSRC}/usage.out
if [ $? != 0 ]
then
- echo "Output of jstat -help differ from expected output. Failed."
+ echo "Output of jstat -help differs from expected output. Failed."
+ exit 1
+fi
+
+rm -f jstat.out 2>/dev/null
+${JSTAT} -J-XX:+UsePerfData > jstat.out 2>&1
+
+diff -w jstat.out ${TESTSRC}/usage.out
+if [ $? != 0 ]
+then
+ echo "Output of jstat differs from expected output. Failed."
exit 1
fi
From a5ed93db7ce0828552f2ef967f873019b520e0e4 Mon Sep 17 00:00:00 2001
From: Katja Kantserova
Date: Wed, 3 Dec 2014 11:56:02 +0100
Subject: [PATCH 05/20] 8044591: [TESTBUG]
com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationp[Content]Test.java
fail when -XX:+ExplicitGCInvokesConcurrent
Reviewed-by: sla, fparain
---
jdk/test/ProblemList.txt | 4 ----
.../GarbageCollectionNotificationContentTest.java | 1 +
.../GarbageCollectionNotificationTest.java | 1 +
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index fb0af4e7087..a8d13e5e7f5 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -135,10 +135,6 @@ java/lang/instrument/RetransformBigClass.sh generic-all
# jdk_management
-# 8044591
-com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java generic-all
-com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java generic-all
-
# 8058492
java/lang/management/ThreadMXBean/FindDeadlocks.java generic-all
diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java
index 6d3386b0905..e823f3108b8 100644
--- a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java
+++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java
@@ -26,6 +26,7 @@
* @bug 7036199
* @summary Check that GarbageCollectionNotification contents are reasonable
* @author Frederic Parain
+ * @requires vm.opt.ExplicitGCInvokesConcurrent == null | vm.opt.ExplicitGCInvokesConcurrent == false
* @run main/othervm GarbageCollectionNotificationContentTest
*/
diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java
index bad4e4076b0..da8082ed2ad 100644
--- a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java
+++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java
@@ -26,6 +26,7 @@
* @bug 7036199
* @summary Check that GarbageCollection notification are thrown by every GarbageCollectorMXBean
* @author Frederic Parain
+ * @requires vm.opt.ExplicitGCInvokesConcurrent == null | vm.opt.ExplicitGCInvokesConcurrent == false
* @run main/othervm GarbageCollectionNotificationTest
*/
From 8fd2fa2d03944ba3c6890ca409ce75da74622928 Mon Sep 17 00:00:00 2001
From: Jaroslav Bachorik
Date: Wed, 3 Dec 2014 16:44:35 +0100
Subject: [PATCH 06/20] 8064441: java/lang/management/ThreadMXBean/Locks.java
fails intermittently, blocked on wrong object
Reviewed-by: dholmes, egahlin, sspitsyn
---
.../lang/management/ThreadMXBean/Locks.java | 69 ++++++++++++-------
1 file changed, 43 insertions(+), 26 deletions(-)
diff --git a/jdk/test/java/lang/management/ThreadMXBean/Locks.java b/jdk/test/java/lang/management/ThreadMXBean/Locks.java
index 14273b5fdc5..1c8da469289 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/Locks.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/Locks.java
@@ -29,17 +29,21 @@
* @author Mandy Chung
* @author Jaroslav Bachorik
*
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
* @run main/othervm Locks
*/
import java.lang.management.*;
import java.util.concurrent.Phaser;
+import jdk.testlibrary.LockFreeLogManager;
public class Locks {
private static final Object objA = new Object();
private static final Object objB = new Object();
private static final Object objC = new Object();
private static final ThreadMXBean tm = ManagementFactory.getThreadMXBean();
+ private static final LockFreeLogManager logger = new LockFreeLogManager();
private static boolean testFailed = false;
@@ -126,14 +130,14 @@ public class Locks {
public void run() {
synchronized(objA) {
// stop here for LockBThread to hold objB
- System.out.println("LockAThread about to block on objB");
+ log("LockAThread about to block on objB");
p.arriveAndAwaitAdvance(); // Phase 1 (blocking)
synchronized(objB) {
dummyCounter++;
};
}
p.arriveAndAwaitAdvance(); // Phase 2 (blocking)
- System.out.println("LockAThread about to exit");
+ log("LockAThread about to exit");
// Make sure the current thread is not holding any lock
assertNoLock(this);
}
@@ -147,7 +151,7 @@ public class Locks {
}
public void run() {
synchronized(objB) {
- System.out.println("LockBThread about to block on objC");
+ log("LockBThread about to block on objC");
p.arriveAndAwaitAdvance(); // Phase 1 (blocking)
// Signal main thread about to block on objC
synchronized(objC) {
@@ -155,14 +159,14 @@ public class Locks {
};
}
p.arriveAndAwaitAdvance(); // Phase 2 (blocking)
- System.out.println("LockBThread about to exit");
+ log("LockBThread about to exit");
// Make sure the current thread is not holding any lock
assertNoLock(this);
}
}
private static WaitingThread waiter;
- private static Object ready = new Object();
+ private static final Object ready = new Object();
private static CheckerThread checker;
static class WaitingThread extends Thread {
private final Phaser p;
@@ -173,9 +177,10 @@ public class Locks {
super("WaitingThread");
this.p = p;
}
+ @Override
public void run() {
synchronized(objC) {
- System.out.println("WaitingThread about to wait on objC");
+ log("WaitingThread about to wait on objC");
try {
// Signal checker thread, about to wait on objC.
waiting = false;
@@ -188,13 +193,13 @@ public class Locks {
}
// block until CheckerThread finishes checking
- System.out.println("WaitingThread about to block on ready");
+ log("WaitingThread about to block on ready");
// signal checker thread that it is about acquire
// object ready.
p.arriveAndAwaitAdvance(); // Phase 2 (waiting)
synchronized(ready) {
dummyCounter++;
- };
+ }
}
synchronized(objC) {
try {
@@ -208,7 +213,7 @@ public class Locks {
testFailed = true;
}
}
- System.out.println("WaitingThread about to exit waiting on objC 2");
+ log("WaitingThread about to exit waiting on objC 2");
}
public void waitForWaiting() {
@@ -321,10 +326,10 @@ public class Locks {
private static ThreadInfo findOwnerInfo(ThreadInfo[] infos, String lock)
throws Exception {
ThreadInfo ownerInfo = null;
- for (int i = 0; i < infos.length; i++) {
- String blockedLock = infos[i].getLockName();
+ for (ThreadInfo info : infos) {
+ String blockedLock = info.getLockName();
if (lock.equals(blockedLock)) {
- long threadId = infos[i].getLockOwnerId();
+ long threadId = info.getLockOwnerId();
if (threadId == -1) {
throw new RuntimeException("TEST FAILED: " +
lock + " expected to have owner");
@@ -355,14 +360,17 @@ public class Locks {
throws Exception {
ThreadInfo ownerInfo = null;
// Find the thread who is blocking on lock
- for (int i = 0; i < infos.length; i++) {
- String blockedLock = infos[i].getLockName();
+ for (ThreadInfo info : infos) {
+ String blockedLock = info.getLockName();
if (lock.equals(blockedLock)) {
- System.out.print(infos[i].getThreadName() +
- " blocked on " + blockedLock);
- ownerInfo = infos[i];
+ log("%s blocked on %s", info.getThreadName(), blockedLock);
+ ownerInfo = info;
}
}
+ if (ownerInfo == null) {
+ throw new RuntimeException("TEST FAILED: " +
+ "Can't retrieve ThreadInfo for the blocked thread");
+ }
long[] threads = new long[10];
int count = 0;
@@ -370,14 +378,18 @@ public class Locks {
while (ownerInfo != null && ownerInfo.getThreadState() == Thread.State.BLOCKED) {
ownerInfo = findOwnerInfo(infos, lock);
threads[count++] = ownerInfo.getThreadId();
- System.out.println(" Owner = " + ownerInfo.getThreadName() +
- " id = " + ownerInfo.getThreadId());
+ log(" Owner = %s id = %d",
+ ownerInfo.getThreadName(),
+ ownerInfo.getThreadId()
+ );
lock = ownerInfo.getLockName();
- System.out.print(ownerInfo.getThreadName() + " Id = " +
- ownerInfo.getThreadId() +
- " blocked on " + lock);
+ log("%s Id = %d blocked on %s",
+ ownerInfo.getThreadName(),
+ ownerInfo.getThreadId(),
+ lock
+ );
}
- System.out.println();
+ log("");
if (count != expectedThreads.length) {
throw new RuntimeException("TEST FAILED: " +
@@ -385,10 +397,15 @@ public class Locks {
}
for (int i = 0; i < count; i++) {
if (threads[i] != expectedThreads[i]) {
- System.out.println("TEST FAILED: " +
- "Unexpected thread in the chain " + threads[i] +
- " expected to be " + expectedThreads[i]);
+ log("TEST FAILED: Unexpected thread in the chain %s expected to be %s",
+ threads[i],
+ expectedThreads[i]
+ );
}
}
}
+
+ private static void log(String format, Object ... args) {
+ logger.log(format + "%n", args);
+ }
}
From a47e1013c2f725fcf33bb1316ef70f9f2e7199a3 Mon Sep 17 00:00:00 2001
From: Chris Plummer
Date: Thu, 4 Dec 2014 11:26:46 -0800
Subject: [PATCH 07/20] 6762191: Setting stack size to 16K causes segmentation
fault
Fixed by forcing the stack size to always be at least 32k.
Reviewed-by: dholmes, alanb, ksrini, sspitsyn
---
jdk/src/java.base/share/native/libjli/java.c | 15 ++
.../tools/launcher/TooSmallStackSize.java | 158 ++++++++++++++++++
2 files changed, 173 insertions(+)
create mode 100644 jdk/test/tools/launcher/TooSmallStackSize.java
diff --git a/jdk/src/java.base/share/native/libjli/java.c b/jdk/src/java.base/share/native/libjli/java.c
index c71f4c26fab..03f493e53c2 100644
--- a/jdk/src/java.base/share/native/libjli/java.c
+++ b/jdk/src/java.base/share/native/libjli/java.c
@@ -168,6 +168,13 @@ static jlong threadStackSize = 0; /* stack size of the new thread */
static jlong maxHeapSize = 0; /* max heap size */
static jlong initialHeapSize = 0; /* inital heap size */
+/*
+ * A minimum -Xss stack size suitable for all platforms.
+ */
+#ifndef STACK_SIZE_MINIMUM
+#define STACK_SIZE_MINIMUM (32 * KB)
+#endif
+
/*
* Entry point.
*/
@@ -773,6 +780,14 @@ AddOption(char *str, void *info)
jlong tmp;
if (parse_size(str + 4, &tmp)) {
threadStackSize = tmp;
+ /*
+ * Make sure the thread stack size is big enough that we won't get a stack
+ * overflow before the JVM startup code can check to make sure the stack
+ * is big enough.
+ */
+ if (threadStackSize < STACK_SIZE_MINIMUM) {
+ threadStackSize = STACK_SIZE_MINIMUM;
+ }
}
}
diff --git a/jdk/test/tools/launcher/TooSmallStackSize.java b/jdk/test/tools/launcher/TooSmallStackSize.java
new file mode 100644
index 00000000000..dac1c7f0325
--- /dev/null
+++ b/jdk/test/tools/launcher/TooSmallStackSize.java
@@ -0,0 +1,158 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6762191
+ * @summary Setting stack size to 16K causes segmentation fault
+ * @compile TooSmallStackSize.java
+ * @run main TooSmallStackSize
+ */
+
+/*
+ * The primary purpose of this test is to make sure we can run with a 16k stack
+ * size without crashing. Also this test will determine the minimum allowed
+ * stack size for the platform (as provided by the JVM error message when a very
+ * small stack is used), and then verify that the JVM can be launched with that stack
+ * size without a crash or any error messages.
+ */
+
+public class TooSmallStackSize extends TestHelper {
+ /* for debugging. Normally false. */
+ static final boolean verbose = false;
+
+ static void printTestOutput(TestResult tr) {
+ System.out.println("*** exitValue = " + tr.exitValue);
+ for (String x : tr.testOutput) {
+ System.out.println(x);
+ }
+ }
+
+ /*
+ * Returns the minimum stack size this platform will allowed based on the
+ * contents of the error message the JVM outputs when too small of a
+ * -Xss size was used.
+ *
+ * The TestResult argument must contain the result of having already run
+ * the JVM with too small of a stack size.
+ */
+ static String getMinStackAllowed(TestResult tr) {
+ /*
+ * The JVM output will contain in one of the lines:
+ * "The stack size specified is too small, Specify at least 100k"
+ * Although the actual size will vary. We need to extract this size
+ * string from the output and return it.
+ */
+ String matchStr = "Specify at least ";
+ for (String x : tr.testOutput) {
+ int match_idx = x.indexOf(matchStr);
+ if (match_idx >= 0) {
+ int size_start_idx = match_idx + matchStr.length();
+ int k_start_idx = x.indexOf("k", size_start_idx);
+ return x.substring(size_start_idx, k_start_idx + 1); // include the "k"
+ }
+ }
+
+ System.out.println("FAILED: Could not get the stack size from the output");
+ throw new RuntimeException("test fails");
+ }
+
+ /*
+ * Run the JVM with the specified stack size.
+ *
+ * Returns the minimum allowed stack size gleaned from the error message,
+ * if there is an error message. Otherwise returns the stack size passed in.
+ */
+ static String checkStack(String stackSize) {
+ String min_stack_allowed;
+ TestResult tr;
+
+ if (verbose)
+ System.out.println("*** Testing " + stackSize);
+ tr = doExec(javaCmd, "-Xss" + stackSize, "-version");
+ if (verbose)
+ printTestOutput(tr);
+
+ if (tr.isOK()) {
+ System.out.println("PASSED: got no error message with stack size of " + stackSize);
+ min_stack_allowed = stackSize;
+ } else {
+ if (tr.contains("The stack size specified is too small")) {
+ System.out.println("PASSED: got expected error message with stack size of " + stackSize);
+ min_stack_allowed = getMinStackAllowed(tr);
+ } else {
+ // Likely a crash
+ System.out.println("FAILED: Did not get expected error message with stack size of " + stackSize);
+ throw new RuntimeException("test fails");
+ }
+ }
+
+ return min_stack_allowed;
+ }
+
+ /*
+ * Run the JVM with the minimum allowed stack size. This should always succeed.
+ */
+ static void checkMinStackAllowed(String stackSize) {
+ TestResult tr = null;
+
+ if (verbose)
+ System.out.println("*** Testing " + stackSize);
+ tr = doExec(javaCmd, "-Xss" + stackSize, "-version");
+ if (verbose)
+ printTestOutput(tr);
+
+ if (tr.isOK()) {
+ System.out.println("PASSED: VM launched with minimum allowed stack size of " + stackSize);
+ } else {
+ // Likely a crash
+ System.out.println("FAILED: VM failed to launch with minimum allowed stack size of " + stackSize);
+ throw new RuntimeException("test fails");
+ }
+ }
+
+ public static void main(String... args) {
+ /*
+ * The result of a 16k stack size should be a quick exit with a complaint
+ * that the stack size is too small. However, for some win32 builds, the
+ * stack is always at least 64k, and this also sometimes is the minimum
+ * allowed size, so we won't see an error in this case.
+ *
+ * This test case will also produce a crash on some platforms if the fix
+ * for 6762191 is not yet in place.
+ */
+ checkStack("16k");
+
+ /*
+ * Try with a 32k stack size, which is the size that the launcher will
+ * set to if you try setting to anything smaller. This should produce the same
+ * result as setting to 16k if the fix for 6762191 is in place.
+ */
+ String min_stack_allowed = checkStack("32k");
+
+ /*
+ * Try again with a the minimum stack size that was given in the error message
+ */
+ checkMinStackAllowed(min_stack_allowed);
+ }
+}
From 594e368671a0a863d7e3d2b663b4e1efb6ab8dc8 Mon Sep 17 00:00:00 2001
From: Jaroslav Bachorik
Date: Tue, 9 Dec 2014 08:58:19 +0100
Subject: [PATCH 08/20] 8059949: com/sun/tools/attach/StartManagementAgent.java
interrupted! (timed out?)
Reviewed-by: sla
---
jdk/test/com/sun/tools/attach/StartManagementAgent.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jdk/test/com/sun/tools/attach/StartManagementAgent.java b/jdk/test/com/sun/tools/attach/StartManagementAgent.java
index b2ee68d01b0..9d367c04186 100644
--- a/jdk/test/com/sun/tools/attach/StartManagementAgent.java
+++ b/jdk/test/com/sun/tools/attach/StartManagementAgent.java
@@ -41,7 +41,7 @@ import jdk.testlibrary.Utils;
* @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
* @library /lib/testlibrary
* @run build Application SimpleProvider jdk.testlibrary.*
- * @run main StartManagementAgent
+ * @run main/timeout=300 StartManagementAgent
*/
/*
From 7ffa3cd6690bae9b16b5dd49117290207a6a77f1 Mon Sep 17 00:00:00 2001
From: Amanda Jiang
Date: Fri, 12 Dec 2014 00:19:17 +0000
Subject: [PATCH 09/20] 8048819: Implement reliability test for DH algorithm
Added DH test for up-to-4 parties key exchange
Reviewed-by: valeriep
---
.../KeyAgreement/SameDHKeyStressTest.java | 169 ++++++++++++++++++
1 file changed, 169 insertions(+)
create mode 100644 jdk/test/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java
diff --git a/jdk/test/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java b/jdk/test/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java
new file mode 100644
index 00000000000..f0067da5439
--- /dev/null
+++ b/jdk/test/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 1999, 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.
+ */
+
+/*
+ * @test
+ * @bug 8048819
+ * @summary This test stressful verifies the assertion of "The secret keys generated
+ * by all involved parties should be the same." for javax.crypto.KeyAgreement
+ * @run main SameDHKeyStressTest
+ */
+import java.security.AlgorithmParameterGenerator;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.spec.AlgorithmParameterSpec;
+import java.util.Arrays;
+import javax.crypto.KeyAgreement;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.DHGenParameterSpec;
+import javax.crypto.spec.DHParameterSpec;
+
+public class SameDHKeyStressTest {
+
+ static final String[] ALGORITHMS = {"DH", "DiffieHellman", "dh", "diffieHELLMAN"};
+ static final String[] SECRET_ALOGRITHMS = {"DES", "DESede", "blowfish"};
+ static final int[] NUMBER_OF_PARTIES = {2, 3, 4};
+ static final String[] PA_NAMES = {"Alice", "Bob", "Carol", "David"};
+
+ public static void main(String args[]) {
+ int failedCnt = 0;
+ StringBuilder failedList = new StringBuilder("Failed List:");
+
+ for (String algorithm : ALGORITHMS) {
+ for (int numOfParties : NUMBER_OF_PARTIES) {
+ for (String secretAlgorithm : SECRET_ALOGRITHMS) {
+ if (!runTest(algorithm, numOfParties, secretAlgorithm)) {
+ failedCnt++;
+ failedList.append("\n Altorightm = ").append(algorithm).
+ append(" Number of Parties = ").append(numOfParties).
+ append(" Secret Algorithm = ").append(secretAlgorithm);
+ }
+ }
+ }
+ } //end of for loop
+
+ if (failedCnt > 0) {
+ System.out.println(failedList);
+ throw new RuntimeException("SameDHKeyStressTest Failed");
+ }
+ }
+
+ public static boolean runTest(String algo, int numParties, String secretAlgo) {
+ KAParticipant[] parties = new KAParticipant[numParties];
+ Key[] keyArchives = new Key[numParties];
+ try {
+ // generate AlogirhtmParameterSpec
+ AlgorithmParameterGenerator apg = AlgorithmParameterGenerator.getInstance("DH","SunJCE");
+ AlgorithmParameterSpec aps = new DHGenParameterSpec(512, 64);
+ apg.init(aps);
+ DHParameterSpec spec = apg.generateParameters().
+ getParameterSpec(DHParameterSpec.class);
+
+ //initilize all KeyAgreement participants
+ for (int i = 0; i < numParties; i++) {
+ parties[i] = new KAParticipant(PA_NAMES[i], algo);
+ parties[i].initialize(spec);
+ keyArchives[i] = parties[i].getPublicKey();
+ }
+
+ // Do all phases in the KeyAgreement for all participants
+ Key[] keyBuffer = new Key[numParties];
+ boolean lastPhase = false;
+ for (int j = 0; j < numParties - 1; j++) {
+ if (j == numParties - 2) {
+ lastPhase = true;
+ }
+ for (int k = 0; k < numParties; k++) {
+ if (k == numParties - 1) {
+ keyBuffer[k] = parties[k].doPhase(keyArchives[0], lastPhase);
+ } else {
+ keyBuffer[k] = parties[k].doPhase(keyArchives[k + 1], lastPhase);
+ }
+ }
+ System.arraycopy(keyBuffer, 0, keyArchives, 0, numParties);
+ }
+
+ //Comparison: The secret keys generated by all involved parties should be the same
+ SecretKey[] sKeys = new SecretKey[numParties];
+ for (int n = 0; n < numParties; n++) {
+ sKeys[n] = parties[n].generateSecret(secretAlgo);
+ }
+ for (int q = 0; q < numParties - 1; q++) {
+ if (!Arrays.equals(sKeys[q].getEncoded(), sKeys[q + 1].getEncoded())) {
+ return false;
+ }
+ }
+ return true;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return false;
+ }
+
+ }
+
+}
+
+class KAParticipant {
+
+ private String name = null;
+ private String algorithm = null;
+ private KeyPairGenerator keyGen = null;
+ private KeyPair keys = null;
+ private KeyAgreement ka = null;
+
+ public KAParticipant(String pName, String algo) throws NoSuchAlgorithmException, NoSuchProviderException {
+ name = pName;
+ algorithm = algo;
+ keyGen = KeyPairGenerator.getInstance(algo,"SunJCE");
+ ka = KeyAgreement.getInstance(algo,"SunJCE");
+ }
+
+ public void initialize(AlgorithmParameterSpec spec) throws InvalidAlgorithmParameterException, InvalidKeyException {
+ keyGen.initialize(spec);
+ keys = keyGen.generateKeyPair();
+ ka.init(keys.getPrivate());
+ }
+
+ public Key doPhase(Key key, boolean lastPhase) throws InvalidKeyException {
+ return ka.doPhase(key, lastPhase);
+ }
+
+ public Key getPublicKey() {
+ return keys.getPublic();
+ }
+
+ public byte[] generateSecret() {
+ return ka.generateSecret();
+ }
+
+ public SecretKey generateSecret(String algo) throws java.lang.IllegalStateException,
+ java.security.NoSuchAlgorithmException,
+ java.security.InvalidKeyException {
+ return ka.generateSecret(algo);
+ }
+}
From 86291780cb0199ac4a33861cc5e25957d78b2ae3 Mon Sep 17 00:00:00 2001
From: Valerie Peng
Date: Fri, 12 Dec 2014 00:23:32 +0000
Subject: [PATCH 10/20] 8062170: java.security.ProviderException: Error parsing
configuration with space
Updated to parse library path as a line which can contain quoted strings.
Reviewed-by: vinnie
---
.../classes/sun/security/pkcs11/Config.java | 18 ++++++++++++++----
.../pkcs11/Provider/ConfigShortPath.java | 6 +++---
.../sun/security/pkcs11/Provider/cspSpace.cfg | 5 +++++
3 files changed, 22 insertions(+), 7 deletions(-)
create mode 100644 jdk/test/sun/security/pkcs11/Provider/cspSpace.cfg
diff --git a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/Config.java b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/Config.java
index f4bcc589131..01d3b3752d6 100644
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/Config.java
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/Config.java
@@ -584,16 +584,24 @@ final class Config {
}
private String parseLine() throws IOException {
- String s = parseWord();
+ // allow quoted string as part of line
+ String s = null;
while (true) {
int token = nextToken();
if ((token == TT_EOL) || (token == TT_EOF)) {
break;
}
- if (token != TT_WORD) {
+ if (token != TT_WORD && token != '\"') {
throw excToken("Unexpected value");
}
- s = s + " " + st.sval;
+ if (s == null) {
+ s = st.sval;
+ } else {
+ s = s + " " + st.sval;
+ }
+ }
+ if (s == null) {
+ throw excToken("Unexpected empty line");
}
return s;
}
@@ -653,7 +661,9 @@ final class Config {
//
private String parseLibrary(String keyword) throws IOException {
- String lib = parseStringEntry(keyword);
+ checkDup(keyword);
+ parseEquals();
+ String lib = parseLine();
lib = expand(lib);
int i = lib.indexOf("/$ISA/");
if (i != -1) {
diff --git a/jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java b/jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java
index 030e420890c..a4d29e9a9f4 100644
--- a/jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java
+++ b/jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java
@@ -22,8 +22,8 @@
*/
/**
* @test
- * @bug 6581254 6986789 7196009
- * @summary Allow '~', '+' and quoted paths in config file
+ * @bug 6581254 6986789 7196009 8062170
+ * @summary Allow '~', '+', and quoted paths in config file
* @author Valerie Peng
*/
@@ -34,7 +34,7 @@ import java.lang.reflect.*;
public class ConfigShortPath {
private static final String[] configNames = {
- "csp.cfg", "cspPlus.cfg", "cspQuotedPath.cfg"
+ "csp.cfg", "cspPlus.cfg", "cspSpace.cfg", "cspQuotedPath.cfg"
};
public static void main(String[] args) throws Exception {
diff --git a/jdk/test/sun/security/pkcs11/Provider/cspSpace.cfg b/jdk/test/sun/security/pkcs11/Provider/cspSpace.cfg
new file mode 100644
index 00000000000..da55f9dc5ba
--- /dev/null
+++ b/jdk/test/sun/security/pkcs11/Provider/cspSpace.cfg
@@ -0,0 +1,5 @@
+showInfo = false
+name = test
+library = C:\pki DLL\x64\acpkcs211.dll
+
+
From 41844a4b8ca287d48acca3c927fd10830888c8d4 Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Tue, 16 Dec 2014 11:05:12 -0800
Subject: [PATCH 11/20] 8067091: Fix Windows-specific deprecation warnings in
the jdk.crypto.mscapi module
Reviewed-by: vinnie
---
.../windows/classes/sun/security/mscapi/RSACipher.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSACipher.java b/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSACipher.java
index 023725b6205..f6f91106c94 100644
--- a/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSACipher.java
+++ b/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSACipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -159,6 +159,7 @@ public final class RSACipher extends CipherSpi {
}
// see JCE spec
+ @SuppressWarnings("deprecation")
protected void engineInit(int opmode, Key key,
AlgorithmParameterSpec params, SecureRandom random)
throws InvalidKeyException, InvalidAlgorithmParameterException {
@@ -369,6 +370,7 @@ public final class RSACipher extends CipherSpi {
}
// see JCE spec
+ @SuppressWarnings("deprecation")
protected java.security.Key engineUnwrap(byte[] wrappedKey,
String algorithm,
int type) throws InvalidKeyException, NoSuchAlgorithmException {
From e9e0b591dc5947ae525eb73ad1e2d650bb215fd6 Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Tue, 16 Dec 2014 11:49:37 -0800
Subject: [PATCH 12/20] 8067088: Suppress solaris-specific deprecation warnings
in the jdk.crypto.ucrypto module
Reviewed-by: valeriep
---
.../classes/com/oracle/security/ucrypto/NativeRSACipher.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java
index 813da731c06..a9ff2f02f86 100644
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java
@@ -178,6 +178,7 @@ public class NativeRSACipher extends CipherSpi {
// see JCE spec
@Override
+ @SuppressWarnings("deprecation")
protected synchronized void engineInit(int opmode, Key newKey,
AlgorithmParameterSpec params, SecureRandom random)
throws InvalidKeyException, InvalidAlgorithmParameterException {
@@ -331,6 +332,7 @@ public class NativeRSACipher extends CipherSpi {
// see JCE spec
@Override
+ @SuppressWarnings("deprecation")
protected synchronized Key engineUnwrap(byte[] wrappedKey,
String wrappedKeyAlgorithm, int wrappedKeyType)
throws InvalidKeyException, NoSuchAlgorithmException {
From 9cb99ee08002da3505a62743e6abf3a8b6998f44 Mon Sep 17 00:00:00 2001
From: Naoto Sato
Date: Tue, 16 Dec 2014 12:48:31 -0800
Subject: [PATCH 13/20] 8062588: Support java.util.spi.*, java.text.spi.*,
java.awt.im.spi loaded from classpath
Reviewed-by: alanb
---
.../java/util/spi/LocaleServiceProvider.java | 5 ++--
.../provider/SPILocaleProviderAdapter.java | 3 ++-
.../classes/java/awt/im/spi/package.html | 5 ++--
.../awt/im/ExecutableInputMethodManager.java | 3 ++-
jdk/test/ProblemList.txt | 16 -----------
jdk/test/java/util/Locale/LocaleProviders.sh | 27 ++++++++++++++++---
.../BreakIteratorProviderTest.sh | 4 +--
.../CalendarDataProviderTest.sh | 4 +--
.../CalendarNameProviderTest.sh | 4 +--
.../util/PluggableLocale/ClasspathTest.java | 8 +++---
.../util/PluggableLocale/ClasspathTest.sh | 7 +++--
.../PluggableLocale/CollatorProviderTest.sh | 4 +--
.../CurrencyNameProviderTest.sh | 4 +--
.../PluggableLocale/DateFormatProviderTest.sh | 4 +--
.../DateFormatSymbolsProviderTest.sh | 4 +--
.../DecimalFormatSymbolsProviderTest.sh | 4 +--
.../java/util/PluggableLocale/ExecTest.sh | 15 +----------
.../java/util/PluggableLocale/GenericTest.sh | 4 +--
.../PluggableLocale/LocaleNameProviderTest.sh | 4 +--
.../NumberFormatProviderTest.sh | 4 +--
.../TimeZoneNameProviderTest.sh | 4 +--
.../util/ResourceBundle/Bug6299235Test.sh | 17 ++----------
22 files changed, 65 insertions(+), 89 deletions(-)
diff --git a/jdk/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java b/jdk/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java
index 5e3b5080cf8..3b2cb534bad 100644
--- a/jdk/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java
+++ b/jdk/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java
@@ -43,9 +43,8 @@ import java.util.Locale;
* supported by the Java runtime environment itself.
*
*
Packaging of Locale Sensitive Service Provider Implementations
- * Implementations of these locale sensitive services are packaged using the
- * Java Extension Mechanism
- * as installed extensions. A provider identifies itself with a
+ * Implementations of these locale sensitive services can be made available
+ * by adding them to the application's class path. A provider identifies itself with a
* provider-configuration file in the resource directory META-INF/services,
* using the fully qualified provider interface class name as the file name.
* The file should contain a list of fully-qualified concrete provider class names,
diff --git a/jdk/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java b/jdk/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java
index 59de0e2a629..be87f042e77 100644
--- a/jdk/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java
+++ b/jdk/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java
@@ -77,7 +77,8 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
public P run() {
P delegate = null;
- for (LocaleServiceProvider provider : ServiceLoader.loadInstalled(c)) {
+ for (LocaleServiceProvider provider :
+ ServiceLoader.load(c, ClassLoader.getSystemClassLoader())) {
if (delegate == null) {
try {
delegate =
diff --git a/jdk/src/java.desktop/share/classes/java/awt/im/spi/package.html b/jdk/src/java.desktop/share/classes/java/awt/im/spi/package.html
index 11d28e6686d..2e63c9297cd 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/im/spi/package.html
+++ b/jdk/src/java.desktop/share/classes/java/awt/im/spi/package.html
@@ -55,9 +55,8 @@ recognition.
Packaging Input Methods
-
Input methods are packaged as installed extensions, as specified
-by the Extension
-Mechanism. The main JAR file of an input method must contain the
+
Input methods can be made available by adding them to the application's
+class path. The main JAR file of an input method must contain the
file: