Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e8364968
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看板
提交
e8364968
编写于
11月 15, 2012
作者:
N
naoto
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7199750: Loading sequence of service provider is changed
Reviewed-by: okutsu
上级
60ba0fdd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
19 deletion
+28
-19
src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java
...es/sun/util/locale/provider/SPILocaleProviderAdapter.java
+13
-13
test/java/util/PluggableLocale/CurrencyNameProviderTest.sh
test/java/util/PluggableLocale/CurrencyNameProviderTest.sh
+1
-1
test/java/util/PluggableLocale/barprovider.jar
test/java/util/PluggableLocale/barprovider.jar
+0
-0
test/java/util/PluggableLocale/providersrc/CurrencyNameProviderImpl2.java
...luggableLocale/providersrc/CurrencyNameProviderImpl2.java
+14
-5
未找到文件。
src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java
浏览文件 @
e8364968
...
...
@@ -91,7 +91,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
IllegalAccessException
e
)
{
LocaleServiceProviderPool
.
config
(
SPILocaleProviderAdapter
.
class
,
e
.
toString
());
return
null
;
}
}
}
((
Delegate
)
delegate
).
addImpl
(
provider
);
...
...
@@ -112,7 +112,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
interface
Delegate
<
P
extends
LocaleServiceProvider
>
{
public
void
addImpl
(
P
impl
);
public
P
getImpl
(
Locale
locale
);
}
}
/*
* Obtain the real SPI implementation, using locale fallback
...
...
@@ -137,7 +137,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
BreakIteratorProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -192,7 +192,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
CollatorProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -226,7 +226,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
DateFormatProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -274,7 +274,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
DateFormatSymbolsProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -308,7 +308,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
DecimalFormatSymbolsProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -342,7 +342,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
NumberFormatProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -397,7 +397,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
CalendarDataProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -438,7 +438,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
CalendarNameProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -483,7 +483,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
CurrencyNameProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -524,7 +524,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
LocaleNameProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
@@ -579,7 +579,7 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter {
@Override
public
void
addImpl
(
TimeZoneNameProvider
impl
)
{
for
(
Locale
l
:
impl
.
getAvailableLocales
())
{
map
.
put
(
l
,
impl
);
map
.
put
IfAbsent
(
l
,
impl
);
}
}
...
...
test/java/util/PluggableLocale/CurrencyNameProviderTest.sh
浏览文件 @
e8364968
...
...
@@ -23,6 +23,6 @@
#!/bin/sh
#
# @test
# @bug 4052440 8000997
# @bug 4052440
7199750
8000997
# @summary CurrencyNameProvider tests
# @run shell ExecTest.sh bar CurrencyNameProviderTest true
test/java/util/PluggableLocale/barprovider.jar
浏览文件 @
e8364968
无法预览此类型文件
test/java/util/PluggableLocale/providersrc/CurrencyNameProviderImpl2.java
浏览文件 @
e8364968
...
...
@@ -32,7 +32,8 @@ import java.util.spi.*;
import
com.foobar.Utils
;
public
class
CurrencyNameProviderImpl2
extends
CurrencyNameProvider
{
static
Locale
[]
avail
=
{
new
Locale
(
"ja"
,
"JP"
,
"tokyo"
)};
static
Locale
[]
avail
=
{
new
Locale
(
"ja"
,
"JP"
,
"tokyo"
),
new
Locale
(
"ja"
,
"JP"
,
"osaka"
),
};
public
Locale
[]
getAvailableLocales
()
{
return
avail
;
}
...
...
@@ -43,8 +44,12 @@ public class CurrencyNameProviderImpl2 extends CurrencyNameProvider {
throw
new
IllegalArgumentException
(
"locale is not supported: "
+
locale
);
}
if
(
c
.
equals
(
"JPY"
)
&&
Utils
.
supportsLocale
(
avail
[
0
],
locale
))
{
return
"JPY-tokyo"
;
if
(
c
.
equals
(
"JPY"
))
{
if
(
Utils
.
supportsLocale
(
avail
[
0
],
locale
))
{
return
"JPY-tokyo"
;
}
else
if
(
Utils
.
supportsLocale
(
avail
[
1
],
locale
))
{
return
"JPY-osaka"
;
}
}
return
null
;
}
...
...
@@ -55,8 +60,12 @@ public class CurrencyNameProviderImpl2 extends CurrencyNameProvider {
throw
new
IllegalArgumentException
(
"locale is not supported: "
+
locale
);
}
if
(
c
.
equals
(
"JPY"
)
&&
Utils
.
supportsLocale
(
avail
[
0
],
locale
))
{
return
"JPY-tokyo"
;
if
(
c
.
equals
(
"JPY"
))
{
if
(
Utils
.
supportsLocale
(
avail
[
0
],
locale
))
{
return
"JPY-tokyo"
;
}
else
if
(
Utils
.
supportsLocale
(
avail
[
1
],
locale
))
{
return
"JPY-osaka"
;
}
}
return
null
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录