Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
dfead855
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看板
提交
dfead855
编写于
6月 26, 2015
作者:
D
dcherepanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8080246: JNLP app cannot be launched due to deadlock
Reviewed-by: alexsch, azvegint Contributed-by: daniil.x.titov@oracle.com
上级
7bb0cdab
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
22 addition
and
13 deletion
+22
-13
src/share/classes/sun/awt/SunToolkit.java
src/share/classes/sun/awt/SunToolkit.java
+22
-13
未找到文件。
src/share/classes/sun/awt/SunToolkit.java
浏览文件 @
dfead855
...
@@ -715,16 +715,19 @@ public abstract class SunToolkit extends Toolkit
...
@@ -715,16 +715,19 @@ public abstract class SunToolkit extends Toolkit
}
}
static
final
SoftCache
imgCache
=
new
SoftCache
();
static
final
SoftCache
fileImgCache
=
new
SoftCache
();
static
final
SoftCache
urlImgCache
=
new
SoftCache
();
static
Image
getImageFromHash
(
Toolkit
tk
,
URL
url
)
{
static
Image
getImageFromHash
(
Toolkit
tk
,
URL
url
)
{
checkPermissions
(
url
);
checkPermissions
(
url
);
synchronized
(
imgCache
)
{
synchronized
(
urlImgCache
)
{
Image
img
=
(
Image
)
imgCache
.
get
(
url
);
String
key
=
url
.
toString
();
Image
img
=
(
Image
)
urlImgCache
.
get
(
key
);
if
(
img
==
null
)
{
if
(
img
==
null
)
{
try
{
try
{
img
=
tk
.
createImage
(
new
URLImageSource
(
url
));
img
=
tk
.
createImage
(
new
URLImageSource
(
url
));
imgCache
.
put
(
url
,
img
);
urlImgCache
.
put
(
key
,
img
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
}
}
...
@@ -735,12 +738,12 @@ public abstract class SunToolkit extends Toolkit
...
@@ -735,12 +738,12 @@ public abstract class SunToolkit extends Toolkit
static
Image
getImageFromHash
(
Toolkit
tk
,
static
Image
getImageFromHash
(
Toolkit
tk
,
String
filename
)
{
String
filename
)
{
checkPermissions
(
filename
);
checkPermissions
(
filename
);
synchronized
(
i
mgCache
)
{
synchronized
(
fileI
mgCache
)
{
Image
img
=
(
Image
)
i
mgCache
.
get
(
filename
);
Image
img
=
(
Image
)
fileI
mgCache
.
get
(
filename
);
if
(
img
==
null
)
{
if
(
img
==
null
)
{
try
{
try
{
img
=
tk
.
createImage
(
new
FileImageSource
(
filename
));
img
=
tk
.
createImage
(
new
FileImageSource
(
filename
));
i
mgCache
.
put
(
filename
,
img
);
fileI
mgCache
.
put
(
filename
,
img
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
}
}
...
@@ -758,28 +761,29 @@ public abstract class SunToolkit extends Toolkit
...
@@ -758,28 +761,29 @@ public abstract class SunToolkit extends Toolkit
protected
Image
getImageWithResolutionVariant
(
String
fileName
,
protected
Image
getImageWithResolutionVariant
(
String
fileName
,
String
resolutionVariantName
)
{
String
resolutionVariantName
)
{
synchronized
(
i
mgCache
)
{
synchronized
(
fileI
mgCache
)
{
Image
image
=
getImageFromHash
(
this
,
fileName
);
Image
image
=
getImageFromHash
(
this
,
fileName
);
if
(
image
instanceof
MultiResolutionImage
)
{
if
(
image
instanceof
MultiResolutionImage
)
{
return
image
;
return
image
;
}
}
Image
resolutionVariant
=
getImageFromHash
(
this
,
resolutionVariantName
);
Image
resolutionVariant
=
getImageFromHash
(
this
,
resolutionVariantName
);
image
=
createImageWithResolutionVariant
(
image
,
resolutionVariant
);
image
=
createImageWithResolutionVariant
(
image
,
resolutionVariant
);
i
mgCache
.
put
(
fileName
,
image
);
fileI
mgCache
.
put
(
fileName
,
image
);
return
image
;
return
image
;
}
}
}
}
protected
Image
getImageWithResolutionVariant
(
URL
url
,
protected
Image
getImageWithResolutionVariant
(
URL
url
,
URL
resolutionVariantURL
)
{
URL
resolutionVariantURL
)
{
synchronized
(
i
mgCache
)
{
synchronized
(
urlI
mgCache
)
{
Image
image
=
getImageFromHash
(
this
,
url
);
Image
image
=
getImageFromHash
(
this
,
url
);
if
(
image
instanceof
MultiResolutionImage
)
{
if
(
image
instanceof
MultiResolutionImage
)
{
return
image
;
return
image
;
}
}
Image
resolutionVariant
=
getImageFromHash
(
this
,
resolutionVariantURL
);
Image
resolutionVariant
=
getImageFromHash
(
this
,
resolutionVariantURL
);
image
=
createImageWithResolutionVariant
(
image
,
resolutionVariant
);
image
=
createImageWithResolutionVariant
(
image
,
resolutionVariant
);
imgCache
.
put
(
url
,
image
);
String
key
=
url
.
toString
();
urlImgCache
.
put
(
key
,
image
);
return
image
;
return
image
;
}
}
}
}
...
@@ -884,8 +888,13 @@ public abstract class SunToolkit extends Toolkit
...
@@ -884,8 +888,13 @@ public abstract class SunToolkit extends Toolkit
return
null
;
return
null
;
}
}
protected
static
boolean
imageCached
(
Object
key
)
{
protected
static
boolean
imageCached
(
String
fileName
)
{
return
imgCache
.
containsKey
(
key
);
return
fileImgCache
.
containsKey
(
fileName
);
}
protected
static
boolean
imageCached
(
URL
url
)
{
String
key
=
url
.
toString
();
return
urlImgCache
.
containsKey
(
key
);
}
}
protected
static
boolean
imageExists
(
String
filename
)
{
protected
static
boolean
imageExists
(
String
filename
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录