mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 02:24:40 +02:00
8161138: testlibrary_tests/ctw/* failed with "Failed. Unexpected exit from test [exit code: 0]"
Reviewed-by: kvn
This commit is contained in:
parent
757db81501
commit
a4383337fe
2 changed files with 10 additions and 11 deletions
|
@ -35,8 +35,8 @@ import java.util.concurrent.*;
|
||||||
public class CompileTheWorld {
|
public class CompileTheWorld {
|
||||||
// in case when a static constructor changes System::out and System::err
|
// in case when a static constructor changes System::out and System::err
|
||||||
// we hold these values of output streams
|
// we hold these values of output streams
|
||||||
public static final PrintStream OUT = System.out;
|
static PrintStream OUT = System.out;
|
||||||
public static final PrintStream ERR = System.err;
|
static final PrintStream ERR = System.err;
|
||||||
/**
|
/**
|
||||||
* Entry point. Compiles classes in {@code paths}
|
* Entry point. Compiles classes in {@code paths}
|
||||||
*
|
*
|
||||||
|
@ -56,7 +56,7 @@ public class CompileTheWorld {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (os != null) {
|
if (os != null) {
|
||||||
System.setOut(os);
|
OUT = os;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -89,9 +89,6 @@ public class CompileTheWorld {
|
||||||
os.close();
|
os.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// in case when a static constructor creates and runs a new thread
|
|
||||||
// we force it to exit
|
|
||||||
System.exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ExecutorService createExecutor() {
|
private static ExecutorService createExecutor() {
|
||||||
|
|
|
@ -28,12 +28,11 @@ import jdk.internal.misc.Unsafe;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract handler for path.
|
* Abstract handler for path.
|
||||||
|
@ -152,7 +151,10 @@ public abstract class PathHandler {
|
||||||
if (id >= Utils.COMPILE_THE_WORLD_START_AT) {
|
if (id >= Utils.COMPILE_THE_WORLD_START_AT) {
|
||||||
try {
|
try {
|
||||||
Class<?> aClass = loader.loadClass(name);
|
Class<?> aClass = loader.loadClass(name);
|
||||||
|
if (name != "sun.reflect.misc.Trampoline"
|
||||||
|
&& name != "sun.tools.jconsole.OutputViewer") { // workaround for JDK-8159155
|
||||||
UNSAFE.ensureClassInitialized(aClass);
|
UNSAFE.ensureClassInitialized(aClass);
|
||||||
|
}
|
||||||
CompileTheWorld.OUT.printf("[%d]\t%s%n", id, name);
|
CompileTheWorld.OUT.printf("[%d]\t%s%n", id, name);
|
||||||
Compiler.compileClass(aClass, id, executor);
|
Compiler.compileClass(aClass, id, executor);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue