Skip to content

Commit 19154f7

Browse files
author
Roger Riggs
committedMar 17, 2025
8351970: Retire JavaLangAccess::exit
Reviewed-by: rgiulietti, liach, djelinski
1 parent 3aa6d62 commit 19154f7

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed
 

‎src/java.base/share/classes/java/lang/System.java

-5
Original file line numberDiff line numberDiff line change
@@ -2196,11 +2196,6 @@ public NativeLibraries nativeLibrariesFor(ClassLoader loader) {
21962196
return ClassLoader.nativeLibrariesFor(loader);
21972197
}
21982198

2199-
@Override
2200-
public void exit(int statusCode) {
2201-
Shutdown.exit(statusCode);
2202-
}
2203-
22042199
public Thread[] getAllThreads() {
22052200
return Thread.getAllThreads();
22062201
}

‎src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java

-6
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,6 @@ public interface JavaLangAccess {
477477
*/
478478
NativeLibraries nativeLibrariesFor(ClassLoader loader);
479479

480-
/**
481-
* Direct access to Shutdown.exit to avoid security manager checks
482-
* @param statusCode the status code
483-
*/
484-
void exit(int statusCode);
485-
486480
/**
487481
* Returns an array of all platform threads.
488482
*/

‎src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public final class SharedUtils {
7272
private SharedUtils() {
7373
}
7474

75-
private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
7675
private static final JavaLangInvokeAccess JLIA = SharedSecrets.getJavaLangInvokeAccess();
7776

7877
private static final MethodHandle MH_ALLOC_BUFFER;
@@ -310,7 +309,7 @@ public static void handleUncaughtException(Throwable t) {
310309
t.printStackTrace();
311310
System.err.println("Unrecoverable uncaught exception encountered. The VM will now exit");
312311
} finally {
313-
JLA.exit(1);
312+
System.exit(1);
314313
}
315314
}
316315
}

0 commit comments

Comments
 (0)
Please sign in to comment.