|
32 | 32 | package java.lang;
|
33 | 33 |
|
34 | 34 | import java.lang.reflect.Method;
|
35 |
| -import java.io.FileDescriptor; |
36 |
| -import java.nio.charset.Charset; |
37 | 35 | import java.security.AccessController;
|
38 | 36 | import java.security.AccessControlContext;
|
39 | 37 | import java.security.PrivilegedAction;
|
@@ -1556,6 +1554,10 @@ public void setContextClassLoader(ClassLoader cl) {
|
1556 | 1554 | contextClassLoader = cl;
|
1557 | 1555 | }
|
1558 | 1556 |
|
| 1557 | + void internalSetContextClassLoader(ClassLoader cl) { |
| 1558 | + contextClassLoader = cl; |
| 1559 | + } |
| 1560 | + |
1559 | 1561 | /**
|
1560 | 1562 | * Returns {@code true} if and only if the current thread holds the
|
1561 | 1563 | * monitor lock on the specified object.
|
@@ -2068,41 +2070,6 @@ private void dispatchUncaughtException(Throwable e) {
|
2068 | 2070 | // Used internally to compute Thread names that comply with the Java specification
|
2069 | 2071 | private static int createCount = -1;
|
2070 | 2072 |
|
2071 |
| - /* |
2072 |
| - * Called after everything else is initialized. |
2073 |
| - */ |
2074 |
| - void completeInitialization() { |
2075 |
| - // Get the java.system.class.loader |
2076 |
| - contextClassLoader = ClassLoader.getSystemClassLoader(); |
2077 |
| - jdk.internal.misc.VM.initLevel(4); |
2078 |
| - System.startSNMPAgent(); |
2079 |
| - |
2080 |
| - /* Although file.encoding is used to set the default Charset, some Charset's are not available |
2081 |
| - * in the java.base module and so are not used at startup. There are additional Charset's in the |
2082 |
| - * jdk.charsets module, which is only loaded later. This means the default Charset may not be the |
2083 |
| - * same as file.encoding. Now that all modules and Charset's are available, check if the desired |
2084 |
| - * encodings can be used for System.err and System.out. |
2085 |
| - */ |
2086 |
| - Properties props = System.internalGetProperties(); |
2087 |
| - // If the sun.stderr.encoding was already set in System, don't change the encoding |
2088 |
| - if (!System.hasSetErrEncoding()) { |
2089 |
| - Charset stderrCharset = System.getCharset(props.getProperty("sun.stderr.encoding"), true); |
2090 |
| - if (stderrCharset != null) { |
2091 |
| - System.err.flush(); |
2092 |
| - System.setErr(System.createConsole(FileDescriptor.err, stderrCharset)); |
2093 |
| - } |
2094 |
| - } |
2095 |
| - |
2096 |
| - // If the sun.stdout.encoding was already set in System, don't change the encoding |
2097 |
| - if (!System.hasSetOutEncoding()) { |
2098 |
| - Charset stdoutCharset = System.getCharset(props.getProperty("sun.stdout.encoding"), true); |
2099 |
| - if (stdoutCharset != null) { |
2100 |
| - System.out.flush(); |
2101 |
| - System.setOut(System.createConsole(FileDescriptor.out, stdoutCharset)); |
2102 |
| - } |
2103 |
| - } |
2104 |
| - } |
2105 |
| - |
2106 | 2073 | void uncaughtException(Throwable e) {
|
2107 | 2074 | UncaughtExceptionHandler handler = getUncaughtExceptionHandler();
|
2108 | 2075 | if (handler != null) {
|
|
0 commit comments