8294241: Deprecate URL public constructors

Reviewed-by: joehw, prr, alanb, aefimov, michaelm
This commit is contained in:
Daniel Fuchs 2022-11-03 17:18:14 +00:00
parent 68209adfa7
commit 4338f527aa
82 changed files with 848 additions and 146 deletions

View file

@ -25,6 +25,7 @@
package java.security;
import java.net.MalformedURLException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.io.*;
@ -135,10 +136,10 @@ public final class Security {
File propFile = new File(extraPropFile);
URL propURL;
if (propFile.exists()) {
propURL = new URL
propURL = newURL
("file:" + propFile.getCanonicalPath());
} else {
propURL = new URL(extraPropFile);
propURL = newURL(extraPropFile);
}
is = propURL.openStream();
@ -993,4 +994,9 @@ public final class Security {
}
return Collections.unmodifiableSet(result);
}
@SuppressWarnings("deprecation")
private static URL newURL(String spec) throws MalformedURLException {
return new URL(spec);
}
}