mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8344565: SM cleanup in jdk/internal and java/lang package private classes
Reviewed-by: alanb, mchung
This commit is contained in:
parent
d8a23373c6
commit
f1b5a6e66e
4 changed files with 18 additions and 43 deletions
|
@ -28,12 +28,9 @@ package java.lang;
|
|||
import jdk.internal.util.ArraysSupport;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.Arrays;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
|
||||
class CharacterName {
|
||||
|
||||
|
@ -49,12 +46,9 @@ class CharacterName {
|
|||
private final int[] hsIndices; // chain heads, hash indices into "cps"
|
||||
|
||||
private CharacterName() {
|
||||
try (@SuppressWarnings("removal") DataInputStream dis = new DataInputStream(new InflaterInputStream(
|
||||
AccessController.doPrivileged(new PrivilegedAction<>() {
|
||||
public InputStream run() {
|
||||
return getClass().getResourceAsStream("uniName.dat");
|
||||
}
|
||||
})))) {
|
||||
try (DataInputStream dis = new DataInputStream(
|
||||
new InflaterInputStream(CharacterName.class
|
||||
.getResourceAsStream("uniName.dat")))) {
|
||||
|
||||
int total = dis.readInt();
|
||||
int bkNum = dis.readInt();
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
package java.lang.ref;
|
||||
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.AccessController;
|
||||
import jdk.internal.access.JavaLangAccess;
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
import jdk.internal.misc.VM;
|
||||
|
@ -116,24 +114,18 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
|
|||
* The advantage of creating a fresh thread, however, is that it insulates
|
||||
* invokers of that method from a stalled or deadlocked finalizer thread.
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
private static void forkSecondaryFinalizer(final Runnable proc) {
|
||||
AccessController.doPrivileged(
|
||||
new PrivilegedAction<>() {
|
||||
public Void run() {
|
||||
ThreadGroup tg = Thread.currentThread().getThreadGroup();
|
||||
for (ThreadGroup tgn = tg;
|
||||
tgn != null;
|
||||
tg = tgn, tgn = tg.getParent());
|
||||
Thread sft = new Thread(tg, proc, "Secondary finalizer", 0, false);
|
||||
sft.start();
|
||||
try {
|
||||
sft.join();
|
||||
} catch (InterruptedException x) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
return null;
|
||||
}});
|
||||
ThreadGroup tg = Thread.currentThread().getThreadGroup();
|
||||
for (ThreadGroup tgn = tg;
|
||||
tgn != null;
|
||||
tg = tgn, tgn = tg.getParent());
|
||||
Thread sft = new Thread(tg, proc, "Secondary finalizer", 0, false);
|
||||
sft.start();
|
||||
try {
|
||||
sft.join();
|
||||
} catch (InterruptedException x) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
/* Called by Runtime.runFinalization() */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue