Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d76f9567
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看板
提交
d76f9567
编写于
12月 05, 2011
作者:
N
naoto
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7117469: Warning cleanup for j.u.Currency and j.u.Locale related classes
Reviewed-by: okutsu, smarks
上级
a571f6a0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
10 deletion
+21
-10
src/share/classes/java/util/Currency.java
src/share/classes/java/util/Currency.java
+4
-2
src/share/classes/sun/util/LocaleServiceProviderPool.java
src/share/classes/sun/util/LocaleServiceProviderPool.java
+15
-6
src/share/classes/sun/util/resources/LocaleData.java
src/share/classes/sun/util/resources/LocaleData.java
+2
-2
未找到文件。
src/share/classes/java/util/Currency.java
浏览文件 @
d76f9567
...
...
@@ -189,7 +189,7 @@ public final class Currency implements Serializable {
private
static
final
int
VALID_FORMAT_VERSION
=
1
;
static
{
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Object
>
()
{
public
Object
run
()
{
String
homeDir
=
System
.
getProperty
(
"java.home"
);
try
{
...
...
@@ -431,7 +431,9 @@ public final class Currency implements Serializable {
}
}
return
(
Set
<
Currency
>)
available
.
clone
();
@SuppressWarnings
(
"unchecked"
)
Set
<
Currency
>
result
=
(
Set
<
Currency
>)
available
.
clone
();
return
result
;
}
/**
...
...
src/share/classes/sun/util/LocaleServiceProviderPool.java
浏览文件 @
d76f9567
...
...
@@ -58,7 +58,7 @@ public final class LocaleServiceProviderPool {
* A Map that holds singleton instances of this class. Each instance holds a
* set of provider implementations of a particular locale sensitive service.
*/
private
static
ConcurrentMap
<
Class
,
LocaleServiceProviderPool
>
poolOfPools
=
private
static
ConcurrentMap
<
Class
<?
extends
LocaleServiceProvider
>
,
LocaleServiceProviderPool
>
poolOfPools
=
new
ConcurrentHashMap
<>();
/**
...
...
@@ -147,6 +147,10 @@ public final class LocaleServiceProviderPool {
/**
* Lazy loaded set of available locales.
* Loading all locales is a very long operation.
*
* We know "providerClasses" contains classes that extends LocaleServiceProvider,
* but generic array creation is not allowed, thus the "unchecked" warning
* is suppressed here.
*/
private
static
class
AllAvailableLocales
{
/**
...
...
@@ -156,7 +160,9 @@ public final class LocaleServiceProviderPool {
static
final
Locale
[]
allAvailableLocales
;
static
{
Class
[]
providerClasses
=
{
@SuppressWarnings
(
"unchecked"
)
Class
<
LocaleServiceProvider
>[]
providerClasses
=
(
Class
<
LocaleServiceProvider
>[])
new
Class
<?>[]
{
java
.
text
.
spi
.
BreakIteratorProvider
.
class
,
java
.
text
.
spi
.
CollatorProvider
.
class
,
java
.
text
.
spi
.
DateFormatProvider
.
class
,
...
...
@@ -174,7 +180,7 @@ public final class LocaleServiceProviderPool {
all
.
add
(
getLookupLocale
(
locale
));
}
for
(
Class
providerClass
:
providerClasses
)
{
for
(
Class
<
LocaleServiceProvider
>
providerClass
:
providerClasses
)
{
LocaleServiceProviderPool
pool
=
LocaleServiceProviderPool
.
getPool
(
providerClass
);
all
.
addAll
(
pool
.
getProviderLocales
());
...
...
@@ -355,7 +361,6 @@ public final class LocaleServiceProviderPool {
}
Locale
bundleLocale
=
(
bundle
!=
null
?
bundle
.
getLocale
()
:
null
);
List
<
Locale
>
lookupLocales
=
getLookupLocales
(
locale
);
P
lsp
;
S
providersObj
=
null
;
// check whether a provider has an implementation that's closer
...
...
@@ -375,7 +380,9 @@ public final class LocaleServiceProviderPool {
}
}
if
(
provLoc
.
contains
(
current
))
{
lsp
=
(
P
)
findProvider
(
current
);
// It is safe to assume that findProvider() returns the instance of type P.
@SuppressWarnings
(
"unchecked"
)
P
lsp
=
(
P
)
findProvider
(
current
);
if
(
lsp
!=
null
)
{
providersObj
=
getter
.
getObject
(
lsp
,
locale
,
key
,
params
);
if
(
providersObj
!=
null
)
{
...
...
@@ -397,7 +404,9 @@ public final class LocaleServiceProviderPool {
// JRE has it.
return
null
;
}
else
{
lsp
=
(
P
)
findProvider
(
bundleLocale
);
// It is safe to assume that findProvider() returns the instance of type P.
@SuppressWarnings
(
"unchecked"
)
P
lsp
=
(
P
)
findProvider
(
bundleLocale
);
if
(
lsp
!=
null
)
{
providersObj
=
getter
.
getObject
(
lsp
,
locale
,
key
,
params
);
if
(
providersObj
!=
null
)
{
...
...
src/share/classes/sun/util/resources/LocaleData.java
浏览文件 @
d76f9567
...
...
@@ -137,8 +137,8 @@ public class LocaleData {
}
private
static
ResourceBundle
getBundle
(
final
String
baseName
,
final
Locale
locale
)
{
return
(
ResourceBundle
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
return
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
ResourceBundle
>
()
{
public
ResourceBundle
run
()
{
return
ResourceBundle
.
getBundle
(
baseName
,
locale
,
LocaleDataResourceBundleControl
.
getRBControlInstance
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录