mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K
Reviewed-by: lancea, naoto
This commit is contained in:
parent
d0d26f5c55
commit
e9b2c058a4
21 changed files with 229 additions and 128 deletions
|
@ -33,7 +33,6 @@ import java.util.Enumeration;
|
|||
import java.util.Properties;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
public class MimeTable implements FileNameMap {
|
||||
/** Keyed by content type, returns MimeEntries */
|
||||
private Hashtable<String, MimeEntry> entries
|
||||
|
@ -44,28 +43,15 @@ public class MimeTable implements FileNameMap {
|
|||
= new Hashtable<String, MimeEntry>();
|
||||
|
||||
// Will be reset if in the platform-specific data file
|
||||
private static String tempFileTemplate;
|
||||
|
||||
static {
|
||||
@SuppressWarnings("removal")
|
||||
private static String tempFileTemplate =
|
||||
java.security.AccessController.doPrivileged(
|
||||
new java.security.PrivilegedAction<Void>() {
|
||||
public Void run() {
|
||||
tempFileTemplate =
|
||||
System.getProperty("content.types.temp.file.template",
|
||||
"/tmp/%s");
|
||||
|
||||
mailcapLocations = new String[] {
|
||||
System.getProperty("user.mailcap"),
|
||||
StaticProperty.userHome() + "/.mailcap",
|
||||
"/etc/mailcap",
|
||||
"/usr/etc/mailcap",
|
||||
"/usr/local/etc/mailcap",
|
||||
};
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
new java.security.PrivilegedAction<String>() {
|
||||
public String run() {
|
||||
return System.getProperty("content.types.temp.file.template",
|
||||
"/tmp/%s");
|
||||
}
|
||||
});
|
||||
|
||||
private static final String filePreamble = "sun.net.www MIME content-types table";
|
||||
private static final String fileMagic = "#" + filePreamble;
|
||||
|
@ -77,6 +63,7 @@ public class MimeTable implements FileNameMap {
|
|||
private static class DefaultInstanceHolder {
|
||||
static final MimeTable defaultInstance = getDefaultInstance();
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
static MimeTable getDefaultInstance() {
|
||||
return java.security.AccessController.doPrivileged(
|
||||
new java.security.PrivilegedAction<MimeTable>() {
|
||||
|
@ -220,7 +207,20 @@ public class MimeTable implements FileNameMap {
|
|||
// For backward compatibility -- mailcap format files
|
||||
// This is not currently used, but may in the future when we add ability
|
||||
// to read BOTH the properties format and the mailcap format.
|
||||
protected static String[] mailcapLocations;
|
||||
@SuppressWarnings("removal")
|
||||
protected static String[] mailcapLocations =
|
||||
java.security.AccessController.doPrivileged(
|
||||
new java.security.PrivilegedAction<String[]>() {
|
||||
public String[] run() {
|
||||
return new String[]{
|
||||
System.getProperty("user.mailcap"),
|
||||
StaticProperty.userHome() + "/.mailcap",
|
||||
"/etc/mailcap",
|
||||
"/usr/etc/mailcap",
|
||||
"/usr/local/etc/mailcap",
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
public synchronized void load() {
|
||||
Properties entries = new Properties();
|
||||
|
@ -388,6 +388,7 @@ public class MimeTable implements FileNameMap {
|
|||
properties.put("temp.file.template", tempFileTemplate);
|
||||
String tag;
|
||||
// Perform the property security check for user.name
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
sm.checkPropertyAccess("user.name");
|
||||
|
|
|
@ -53,7 +53,6 @@ import sun.net.www.HeaderParser;
|
|||
// policy in HttpURLConnection. A failure on baz.foo.com shouldn't
|
||||
// uncache foo.com!
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
public abstract class AuthenticationInfo extends AuthCacheValue implements Cloneable {
|
||||
|
||||
@java.io.Serial
|
||||
|
@ -70,12 +69,10 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone
|
|||
* repeatedly, via the Authenticator. Default is false, which means that this
|
||||
* behavior is switched off.
|
||||
*/
|
||||
static final boolean serializeAuth;
|
||||
static {
|
||||
serializeAuth = java.security.AccessController.doPrivileged(
|
||||
@SuppressWarnings("removal")
|
||||
static final boolean serializeAuth = java.security.AccessController.doPrivileged(
|
||||
new sun.security.action.GetBooleanAction(
|
||||
"http.auth.serializeRequests")).booleanValue();
|
||||
}
|
||||
|
||||
/* AuthCacheValue: */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue