Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
95f0caa5
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
95f0caa5
编写于
1月 19, 2015
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8068320: Limit applet requests
Reviewed-by: prr, skoivu, art
上级
f8fdba99
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
49 addition
and
65 deletion
+49
-65
make/data/swingbeaninfo/SwingBeanInfo.template
make/data/swingbeaninfo/SwingBeanInfo.template
+23
-10
src/share/classes/java/beans/Beans.java
src/share/classes/java/beans/Beans.java
+9
-27
src/share/classes/java/beans/SimpleBeanInfo.java
src/share/classes/java/beans/SimpleBeanInfo.java
+17
-28
未找到文件。
make/data/swingbeaninfo/SwingBeanInfo.template
浏览文件 @
95f0caa5
/*
*
Copyright
(
c
)
1998
,
201
3
,
Oracle
and
/
or
its
affiliates
.
All
rights
reserved
.
*
Copyright
(
c
)
1998
,
201
5
,
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
...
...
@@ -92,25 +92,38 @@ public class @(BeanClassName)BeanInfo extends javax.swing.SwingBeanInfoBase {
/**
*
@
return
an
icon
of
the
specified
kind
for
@(
BeanClassName
)
*/
public
Image
getIcon
(
int
kind
)
{
public
Image
getIcon
(
final
int
kind
)
{
Image
i
;
switch
(
kind
){
case
ICON_COLOR_32x32
:
i
=
loadImage
(
"beaninfo/images/@(BeanClassName)Color32.gif"
);
return
((
i
==
null
)
?
loadImage
(
"beaninfo/images/JComponentColor32.gif"
)
:
i
);
i
=
load
Standard
Image
(
"beaninfo/images/@(BeanClassName)Color32.gif"
);
return
((
i
==
null
)
?
load
Standard
Image
(
"beaninfo/images/JComponentColor32.gif"
)
:
i
);
case
ICON_COLOR_16x16
:
i
=
loadImage
(
"beaninfo/images/@(BeanClassName)Color16.gif"
);
return
((
i
==
null
)
?
loadImage
(
"beaninfo/images/JComponentColor16.gif"
)
:
i
);
i
=
load
Standard
Image
(
"beaninfo/images/@(BeanClassName)Color16.gif"
);
return
((
i
==
null
)
?
load
Standard
Image
(
"beaninfo/images/JComponentColor16.gif"
)
:
i
);
case
ICON_MONO_32x32
:
i
=
loadImage
(
"beaninfo/images/@(BeanClassName)Mono32.gif"
);
return
((
i
==
null
)
?
load
Image
(
"beaninfo/images/JComponentMono32.gif"
)
:
i
);
i
=
load
Standard
Image
(
"beaninfo/images/@(BeanClassName)Mono32.gif"
);
return
((
i
==
null
)
?
load
StandardImage
(
"beaninfo/images/JComponentMono32.gif"
)
:
i
);
case
ICON_MONO_16x16
:
i
=
loadImage
(
"beaninfo/images/@(BeanClassName)Mono16.gif"
);
return
((
i
==
null
)
?
load
Image
(
"beaninfo/images/JComponentMono16.gif"
)
:
i
);
i
=
load
Standard
Image
(
"beaninfo/images/@(BeanClassName)Mono16.gif"
);
return
((
i
==
null
)
?
load
StandardImage
(
"beaninfo/images/JComponentMono16.gif"
)
:
i
);
default
:
return
super
.
getIcon
(
kind
);
}
}
/**
*
This
is
a
utility
method
to
help
in
loading
standard
icon
images
.
*
*
@
param
resourceName
A
pathname
relative
to
the
directory
holding
the
*
class
file
of
the
current
class
*
@
return
an
image
object
.
May
be
null
if
the
load
failed
.
*
@
see
java
.
beans
.
SimpleBeanInfo
#
loadImage
(
String
)
*/
private
Image
loadStandardImage
(
final
String
resourceName
)
{
return
java
.
security
.
AccessController
.
doPrivileged
(
(
java
.
security
.
PrivilegedAction
<
Image
>)
()
->
loadImage
(
resourceName
));
}
}
src/share/classes/java/beans/Beans.java
浏览文件 @
95f0caa5
/*
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
5
, 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
...
...
@@ -46,9 +46,6 @@ import java.lang.reflect.Modifier;
import
java.net.URL
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
java.util.Enumeration
;
import
java.util.Hashtable
;
import
java.util.Iterator
;
...
...
@@ -179,16 +176,10 @@ public class Beans {
// Try to find a serialized object with this name
final
String
serName
=
beanName
.
replace
(
'.'
,
'/'
).
concat
(
".ser"
);
final
ClassLoader
loader
=
cls
;
ins
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
InputStream
>()
{
public
InputStream
run
()
{
if
(
loader
==
null
)
return
ClassLoader
.
getSystemResourceAsStream
(
serName
);
else
return
loader
.
getResourceAsStream
(
serName
);
}
});
if
(
cls
==
null
)
ins
=
ClassLoader
.
getSystemResourceAsStream
(
serName
);
else
ins
=
cls
.
getResourceAsStream
(
serName
);
if
(
ins
!=
null
)
{
try
{
if
(
cls
==
null
)
{
...
...
@@ -279,19 +270,10 @@ public class Beans {
URL
docBase
=
null
;
// Now get the URL correponding to the resource name.
final
ClassLoader
cloader
=
cls
;
objectUrl
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
URL
>()
{
public
URL
run
()
{
if
(
cloader
==
null
)
return
ClassLoader
.
getSystemResource
(
resourceName
);
else
return
cloader
.
getResource
(
resourceName
);
}
});
if
(
cls
==
null
)
{
objectUrl
=
ClassLoader
.
getSystemResource
(
resourceName
);
}
else
objectUrl
=
cls
.
getResource
(
resourceName
);
// If we found a URL, we try to locate the docbase by taking
// of the final path name component, and the code base by taking
...
...
src/share/classes/java/beans/SimpleBeanInfo.java
浏览文件 @
95f0caa5
/*
* Copyright (c) 1996, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
5
, 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
...
...
@@ -25,6 +25,11 @@
package
java.beans
;
import
java.awt.Image
;
import
java.awt.Toolkit
;
import
java.awt.image.ImageProducer
;
import
java.net.URL
;
/**
* This is a support class to make it easier for people to provide
* BeanInfo classes.
...
...
@@ -99,7 +104,7 @@ public class SimpleBeanInfo implements BeanInfo {
* Claim there are no icons available. You can override
* this if you want to provide icons for your bean.
*/
public
java
.
awt
.
Image
getIcon
(
int
iconKind
)
{
public
Image
getIcon
(
int
iconKind
)
{
return
null
;
}
...
...
@@ -114,33 +119,17 @@ public class SimpleBeanInfo implements BeanInfo {
* "wombat.gif".
* @return an image object. May be null if the load failed.
*/
public
java
.
awt
.
Image
loadImage
(
final
String
resourceName
)
{
public
Image
loadImage
(
final
String
resourceName
)
{
try
{
final
Class
<?>
c
=
getClass
();
java
.
awt
.
image
.
ImageProducer
ip
=
(
java
.
awt
.
image
.
ImageProducer
)
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
Object
>()
{
public
Object
run
()
{
java
.
net
.
URL
url
;
if
((
url
=
c
.
getResource
(
resourceName
))
==
null
)
{
return
null
;
}
else
{
try
{
return
url
.
getContent
();
}
catch
(
java
.
io
.
IOException
ioe
)
{
return
null
;
}
}
}
});
if
(
ip
==
null
)
return
null
;
java
.
awt
.
Toolkit
tk
=
java
.
awt
.
Toolkit
.
getDefaultToolkit
();
return
tk
.
createImage
(
ip
);
}
catch
(
Exception
ex
)
{
return
null
;
final
URL
url
=
getClass
().
getResource
(
resourceName
);
if
(
url
!=
null
)
{
final
ImageProducer
ip
=
(
ImageProducer
)
url
.
getContent
();
if
(
ip
!=
null
)
{
return
Toolkit
.
getDefaultToolkit
().
createImage
(
ip
);
}
}
}
catch
(
final
Exception
ignored
)
{
}
return
null
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录