8344419: Use StaticProperty in some JDK classes

Reviewed-by: alanb, rriggs
This commit is contained in:
Per Minborg 2024-11-26 12:07:26 +00:00
parent 3e509c8bd1
commit fc2da15bce
2 changed files with 5 additions and 3 deletions

View File

@ -39,6 +39,7 @@ import java.util.Objects;
import java.util.stream.Stream; import java.util.stream.Stream;
import jdk.internal.access.SharedSecrets; import jdk.internal.access.SharedSecrets;
import jdk.internal.util.StaticProperty;
public class CDS { public class CDS {
// Must be in sync with cdsConfig.hpp // Must be in sync with cdsConfig.hpp
@ -275,7 +276,7 @@ public class CDS {
listFile.delete(); listFile.delete();
} }
dumpClassList(listFileName); dumpClassList(listFileName);
String jdkHome = System.getProperty("java.home"); String jdkHome = StaticProperty.javaHome();
String classPath = System.getProperty("java.class.path"); String classPath = System.getProperty("java.class.path");
List<String> cmds = new ArrayList<String>(); List<String> cmds = new ArrayList<String>();
cmds.add(jdkHome + File.separator + "bin" + File.separator + "java"); // java cmds.add(jdkHome + File.separator + "bin" + File.separator + "java"); // java

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,6 +47,7 @@ import java.util.zip.ZipInputStream;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import jdk.internal.util.StaticProperty;
import sun.security.ssl.SSLLogger; import sun.security.ssl.SSLLogger;
/** /**
@ -209,7 +210,7 @@ class DomainName {
new PrivilegedAction<>() { new PrivilegedAction<>() {
@Override @Override
public InputStream run() { public InputStream run() {
File f = new File(System.getProperty("java.home"), File f = new File(StaticProperty.javaHome(),
"lib/security/public_suffix_list.dat"); "lib/security/public_suffix_list.dat");
try { try {
return new FileInputStream(f); return new FileInputStream(f);