Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7e566c46
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7e566c46
编写于
12月 14, 2011
作者:
O
okutsu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6351654: Problem with java/classes_util_i18n
Reviewed-by: hawtin, coffeys
上级
191cb1b9
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
130 addition
and
5 deletion
+130
-5
make/java/java/FILES_java.gmk
make/java/java/FILES_java.gmk
+1
-0
src/share/classes/java/util/TimeZone.java
src/share/classes/java/util/TimeZone.java
+63
-5
src/share/classes/sun/awt/AppContext.java
src/share/classes/sun/awt/AppContext.java
+21
-0
src/share/classes/sun/misc/JavaAWTAccess.java
src/share/classes/sun/misc/JavaAWTAccess.java
+34
-0
src/share/classes/sun/misc/SharedSecrets.java
src/share/classes/sun/misc/SharedSecrets.java
+11
-0
未找到文件。
make/java/java/FILES_java.gmk
浏览文件 @
7e566c46
...
...
@@ -475,6 +475,7 @@ JAVA_JAVA_java = \
sun/misc/MessageUtils.java \
sun/misc/GC.java \
sun/misc/Service.java \
sun/misc/JavaAWTAccess.java \
sun/misc/JavaLangAccess.java \
sun/misc/JavaIOAccess.java \
sun/misc/JavaIOFileDescriptorAccess.java \
...
...
src/share/classes/java/util/TimeZone.java
浏览文件 @
7e566c46
...
...
@@ -43,6 +43,8 @@ import java.lang.ref.SoftReference;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
java.util.concurrent.ConcurrentHashMap
;
import
sun.misc.SharedSecrets
;
import
sun.misc.JavaAWTAccess
;
import
sun.security.action.GetPropertyAction
;
import
sun.util.TimeZoneNameUtility
;
import
sun.util.calendar.ZoneInfo
;
...
...
@@ -615,7 +617,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* method doesn't create a clone.
*/
static
TimeZone
getDefaultRef
()
{
TimeZone
defaultZone
=
defaultZoneTL
.
ge
t
();
TimeZone
defaultZone
=
getDefaultInAppContex
t
();
if
(
defaultZone
==
null
)
{
defaultZone
=
defaultTimeZone
;
if
(
defaultZone
==
null
)
{
...
...
@@ -706,10 +708,65 @@ abstract public class TimeZone implements Serializable, Cloneable {
if
(
hasPermission
())
{
synchronized
(
TimeZone
.
class
)
{
defaultTimeZone
=
zone
;
defaultZoneTL
.
se
t
(
null
);
setDefaultInAppContex
t
(
null
);
}
}
else
{
defaultZoneTL
.
set
(
zone
);
setDefaultInAppContext
(
zone
);
}
}
/**
* Returns the default TimeZone in an AppContext if any AppContext
* has ever used. null is returned if any AppContext hasn't been
* used or if the AppContext doesn't have the default TimeZone.
*/
private
synchronized
static
TimeZone
getDefaultInAppContext
()
{
// JavaAWTAccess provides access implementation-private methods without using reflection.
JavaAWTAccess
javaAWTAccess
=
SharedSecrets
.
getJavaAWTAccess
();
// Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
// been loaded. If so, it implies that AWTSecurityManager is not our
// SecurityManager and we can use a local static variable.
// This works around a build time issue.
if
(
javaAWTAccess
==
null
)
{
return
mainAppContextDefault
;
}
else
{
if
(!
javaAWTAccess
.
isDisposed
())
{
TimeZone
tz
=
(
TimeZone
)
javaAWTAccess
.
get
(
TimeZone
.
class
);
if
(
tz
==
null
&&
javaAWTAccess
.
isMainAppContext
())
{
return
mainAppContextDefault
;
}
else
{
return
tz
;
}
}
}
return
null
;
}
/**
* Sets the default TimeZone in the AppContext to the given
* tz. null is handled special: do nothing if any AppContext
* hasn't been used, remove the default TimeZone in the
* AppContext otherwise.
*/
private
synchronized
static
void
setDefaultInAppContext
(
TimeZone
tz
)
{
// JavaAWTAccess provides access implementation-private methods without using reflection.
JavaAWTAccess
javaAWTAccess
=
SharedSecrets
.
getJavaAWTAccess
();
// Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
// been loaded. If so, it implies that AWTSecurityManager is not our
// SecurityManager and we can use a local static variable.
// This works around a build time issue.
if
(
javaAWTAccess
==
null
)
{
mainAppContextDefault
=
tz
;
}
else
{
if
(!
javaAWTAccess
.
isDisposed
())
{
javaAWTAccess
.
put
(
TimeZone
.
class
,
tz
);
if
(
javaAWTAccess
.
isMainAppContext
())
{
mainAppContextDefault
=
null
;
}
}
}
}
...
...
@@ -760,12 +817,13 @@ abstract public class TimeZone implements Serializable, Cloneable {
*/
private
String
ID
;
private
static
volatile
TimeZone
defaultTimeZone
;
private
static
final
InheritableThreadLocal
<
TimeZone
>
defaultZoneTL
=
new
InheritableThreadLocal
<
TimeZone
>();
static
final
String
GMT_ID
=
"GMT"
;
private
static
final
int
GMT_ID_LENGTH
=
3
;
// a static TimeZone we can reference if no AppContext is in place
private
static
TimeZone
mainAppContextDefault
;
/**
* Parses a custom time zone identifier and returns a corresponding zone.
* This method doesn't support the RFC 822 time zone format. (e.g., +hhmm)
...
...
src/share/classes/sun/awt/AppContext.java
浏览文件 @
7e566c46
...
...
@@ -777,6 +777,27 @@ public final class AppContext {
}
return
changeSupport
.
getPropertyChangeListeners
(
propertyName
);
}
// Set up JavaAWTAccess in SharedSecrets
static
{
sun
.
misc
.
SharedSecrets
.
setJavaAWTAccess
(
new
sun
.
misc
.
JavaAWTAccess
()
{
public
Object
get
(
Object
key
)
{
return
getAppContext
().
get
(
key
);
}
public
void
put
(
Object
key
,
Object
value
)
{
getAppContext
().
put
(
key
,
value
);
}
public
void
remove
(
Object
key
)
{
getAppContext
().
remove
(
key
);
}
public
boolean
isDisposed
()
{
return
getAppContext
().
isDisposed
();
}
public
boolean
isMainAppContext
()
{
return
(
numAppContexts
==
1
);
}
});
}
}
final
class
MostRecentKeyValue
{
...
...
src/share/classes/sun/misc/JavaAWTAccess.java
0 → 100644
浏览文件 @
7e566c46
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
sun.misc
;
public
interface
JavaAWTAccess
{
public
Object
get
(
Object
key
);
public
void
put
(
Object
key
,
Object
value
);
public
void
remove
(
Object
key
);
public
boolean
isDisposed
();
public
boolean
isMainAppContext
();
}
src/share/classes/sun/misc/SharedSecrets.java
浏览文件 @
7e566c46
...
...
@@ -51,6 +51,7 @@ public class SharedSecrets {
private
static
JavaIOFileDescriptorAccess
javaIOFileDescriptorAccess
;
private
static
JavaSecurityProtectionDomainAccess
javaSecurityProtectionDomainAccess
;
private
static
JavaSecurityAccess
javaSecurityAccess
;
private
static
JavaAWTAccess
javaAWTAccess
;
public
static
JavaUtilJarAccess
javaUtilJarAccess
()
{
if
(
javaUtilJarAccess
==
null
)
{
...
...
@@ -139,4 +140,14 @@ public class SharedSecrets {
}
return
javaSecurityAccess
;
}
public
static
void
setJavaAWTAccess
(
JavaAWTAccess
jaa
)
{
javaAWTAccess
=
jaa
;
}
public
static
JavaAWTAccess
getJavaAWTAccess
()
{
// this may return null in which case calling code needs to
// provision for.
return
javaAWTAccess
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录