mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8344252: SM cleanup in java.util classes
Reviewed-by: naoto, smarks
This commit is contained in:
parent
59ffac84d3
commit
c5b6ed8ca0
13 changed files with 160 additions and 330 deletions
|
@ -43,7 +43,6 @@ import java.time.ZoneId;
|
|||
import java.time.ZoneOffset;
|
||||
|
||||
import jdk.internal.util.StaticProperty;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
import sun.util.calendar.ZoneInfo;
|
||||
import sun.util.calendar.ZoneInfoFile;
|
||||
import sun.util.locale.provider.TimeZoneNameUtility;
|
||||
|
@ -683,7 +682,7 @@ public abstract class TimeZone implements Serializable, Cloneable {
|
|||
private static synchronized TimeZone setDefaultZone() {
|
||||
TimeZone tz;
|
||||
// get the time zone ID from the system properties
|
||||
Properties props = GetPropertyAction.privilegedGetProperties();
|
||||
Properties props = System.getProperties();
|
||||
String zoneID = props.getProperty("user.timezone");
|
||||
|
||||
// if the time zone ID is not set (yet), perform the
|
||||
|
@ -729,12 +728,6 @@ public abstract class TimeZone implements Serializable, Cloneable {
|
|||
*/
|
||||
public static void setDefault(TimeZone zone)
|
||||
{
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
sm.checkPermission(new PropertyPermission
|
||||
("user.timezone", "write"));
|
||||
}
|
||||
// by saving a defensive clone and returning a clone in getDefault() too,
|
||||
// the defaultTimeZone instance is isolated from user code which makes it
|
||||
// effectively immutable. This is important to avoid races when the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue