Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b2a2c099
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看板
提交
b2a2c099
编写于
11月 10, 2011
作者:
M
malenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7064279: Introspector.getBeanInfo() should release some resources in timely manner
Reviewed-by: art, alexp
上级
82b0bea5
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
230 addition
and
97 deletion
+230
-97
src/share/classes/java/beans/Beans.java
src/share/classes/java/beans/Beans.java
+4
-11
src/share/classes/java/beans/Introspector.java
src/share/classes/java/beans/Introspector.java
+14
-44
src/share/classes/java/beans/PropertyEditorManager.java
src/share/classes/java/beans/PropertyEditorManager.java
+4
-20
src/share/classes/java/beans/ThreadGroupContext.java
src/share/classes/java/beans/ThreadGroupContext.java
+133
-0
test/java/beans/Beans/6669869/TestDesignTime.java
test/java/beans/Beans/6669869/TestDesignTime.java
+0
-2
test/java/beans/Beans/6669869/TestGuiAvailable.java
test/java/beans/Beans/6669869/TestGuiAvailable.java
+0
-2
test/java/beans/Introspector/6380849/TestBeanInfo.java
test/java/beans/Introspector/6380849/TestBeanInfo.java
+0
-7
test/java/beans/Introspector/7064279/Test7064279.java
test/java/beans/Introspector/7064279/Test7064279.java
+75
-0
test/java/beans/Introspector/7064279/test.jar
test/java/beans/Introspector/7064279/test.jar
+0
-0
test/java/beans/Introspector/Test6660539.java
test/java/beans/Introspector/Test6660539.java
+0
-3
test/java/beans/PropertyEditor/6380849/TestPropertyEditor.java
...java/beans/PropertyEditor/6380849/TestPropertyEditor.java
+0
-8
未找到文件。
src/share/classes/java/beans/Beans.java
浏览文件 @
b2a2c099
...
...
@@ -32,7 +32,6 @@ import java.applet.AppletContext;
import
java.applet.AppletStub
;
import
java.applet.AudioClip
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Image
;
import
java.beans.beancontext.BeanContext
;
...
...
@@ -53,15 +52,11 @@ import java.util.Hashtable;
import
java.util.Iterator
;
import
java.util.Vector
;
import
sun.awt.AppContext
;
/**
* This class provides some general purpose beans control methods.
*/
public
class
Beans
{
private
static
final
Object
DESIGN_TIME
=
new
Object
();
private
static
final
Object
GUI_AVAILABLE
=
new
Object
();
/**
* <p>
...
...
@@ -395,8 +390,7 @@ public class Beans {
* @see DesignMode
*/
public
static
boolean
isDesignTime
()
{
Object
value
=
AppContext
.
getAppContext
().
get
(
DESIGN_TIME
);
return
(
value
instanceof
Boolean
)
&&
(
Boolean
)
value
;
return
ThreadGroupContext
.
getContext
().
isDesignTime
();
}
/**
...
...
@@ -413,8 +407,7 @@ public class Beans {
*
*/
public
static
boolean
isGuiAvailable
()
{
Object
value
=
AppContext
.
getAppContext
().
get
(
GUI_AVAILABLE
);
return
(
value
instanceof
Boolean
)
?
(
Boolean
)
value
:
!
GraphicsEnvironment
.
isHeadless
();
return
ThreadGroupContext
.
getContext
().
isGuiAvailable
();
}
/**
...
...
@@ -440,7 +433,7 @@ public class Beans {
if
(
sm
!=
null
)
{
sm
.
checkPropertiesAccess
();
}
AppContext
.
getAppContext
().
put
(
DESIGN_TIME
,
Boolean
.
valueOf
(
isDesignTime
)
);
ThreadGroupContext
.
getContext
().
setDesignTime
(
isDesignTime
);
}
/**
...
...
@@ -466,7 +459,7 @@ public class Beans {
if
(
sm
!=
null
)
{
sm
.
checkPropertiesAccess
();
}
AppContext
.
getAppContext
().
put
(
GUI_AVAILABLE
,
Boolean
.
valueOf
(
isGuiAvailable
)
);
ThreadGroupContext
.
getContext
().
setGuiAvailable
(
isGuiAvailable
);
}
}
...
...
src/share/classes/java/beans/Introspector.java
浏览文件 @
b2a2c099
...
...
@@ -26,7 +26,6 @@
package
java.beans
;
import
com.sun.beans.WeakCache
;
import
com.sun.beans.finder.BeanInfoFinder
;
import
com.sun.beans.finder.ClassFinder
;
import
java.awt.Component
;
...
...
@@ -44,9 +43,7 @@ import java.util.EventListener;
import
java.util.EventObject
;
import
java.util.List
;
import
java.util.TreeMap
;
import
java.util.WeakHashMap
;
import
sun.awt.AppContext
;
import
sun.reflect.misc.ReflectUtil
;
/**
...
...
@@ -98,10 +95,7 @@ public class Introspector {
public
final
static
int
IGNORE_ALL_BEANINFO
=
3
;
// Static Caches to speed up introspection.
private
static
WeakCache
<
Class
<?>,
Method
[]>
declaredMethodCache
=
new
WeakCache
<
Class
<?>,
Method
[]>();
private
static
final
Object
BEANINFO_CACHE
=
new
Object
();
private
static
final
WeakCache
<
Class
<?>,
Method
[]>
declaredMethodCache
=
new
WeakCache
<>();
private
Class
beanClass
;
private
BeanInfo
explicitBeanInfo
;
...
...
@@ -134,8 +128,6 @@ public class Introspector {
static
final
String
SET_PREFIX
=
"set"
;
static
final
String
IS_PREFIX
=
"is"
;
private
static
final
Object
FINDER_KEY
=
new
Object
();
//======================================================================
// Public methods
//======================================================================
...
...
@@ -160,20 +152,15 @@ public class Introspector {
if
(!
ReflectUtil
.
isPackageAccessible
(
beanClass
))
{
return
(
new
Introspector
(
beanClass
,
null
,
USE_ALL_BEANINFO
)).
getBeanInfo
();
}
Map
<
Class
<?>,
BeanInfo
>
beanInfoCache
;
ThreadGroupContext
context
=
ThreadGroupContext
.
getContext
()
;
BeanInfo
beanInfo
;
synchronized
(
BEANINFO_CACHE
)
{
beanInfoCache
=
(
Map
<
Class
<?>,
BeanInfo
>)
AppContext
.
getAppContext
().
get
(
BEANINFO_CACHE
);
if
(
beanInfoCache
==
null
)
{
beanInfoCache
=
new
WeakHashMap
<
Class
<?>,
BeanInfo
>();
AppContext
.
getAppContext
().
put
(
BEANINFO_CACHE
,
beanInfoCache
);
}
beanInfo
=
beanInfoCache
.
get
(
beanClass
);
synchronized
(
declaredMethodCache
)
{
beanInfo
=
context
.
getBeanInfo
(
beanClass
);
}
if
(
beanInfo
==
null
)
{
beanInfo
=
new
Introspector
(
beanClass
,
null
,
USE_ALL_BEANINFO
).
getBeanInfo
();
synchronized
(
BEANINFO_CACHE
)
{
beanInfoCache
.
put
(
beanClass
,
beanInfo
);
synchronized
(
declaredMethodCache
)
{
context
.
putBeanInfo
(
beanClass
,
beanInfo
);
}
}
return
beanInfo
;
...
...
@@ -306,7 +293,7 @@ public class Introspector {
*/
public
static
String
[]
getBeanInfoSearchPath
()
{
return
get
Finder
().
getPackages
();
return
ThreadGroupContext
.
getContext
().
getBeanInfo
Finder
().
getPackages
();
}
/**
...
...
@@ -330,7 +317,7 @@ public class Introspector {
if
(
sm
!=
null
)
{
sm
.
checkPropertiesAccess
();
}
get
Finder
().
setPackages
(
path
);
ThreadGroupContext
.
getContext
().
getBeanInfo
Finder
().
setPackages
(
path
);
}
...
...
@@ -342,11 +329,8 @@ public class Introspector {
*/
public
static
void
flushCaches
()
{
synchronized
(
BEANINFO_CACHE
)
{
Map
beanInfoCache
=
(
Map
)
AppContext
.
getAppContext
().
get
(
BEANINFO_CACHE
);
if
(
beanInfoCache
!=
null
)
{
beanInfoCache
.
clear
();
}
synchronized
(
declaredMethodCache
)
{
ThreadGroupContext
.
getContext
().
clearBeanInfoCache
();
declaredMethodCache
.
clear
();
}
}
...
...
@@ -370,11 +354,8 @@ public class Introspector {
if
(
clz
==
null
)
{
throw
new
NullPointerException
();
}
synchronized
(
BEANINFO_CACHE
)
{
Map
beanInfoCache
=
(
Map
)
AppContext
.
getAppContext
().
get
(
BEANINFO_CACHE
);
if
(
beanInfoCache
!=
null
)
{
beanInfoCache
.
put
(
clz
,
null
);
}
synchronized
(
declaredMethodCache
)
{
ThreadGroupContext
.
getContext
().
removeBeanInfo
(
clz
);
declaredMethodCache
.
put
(
clz
,
null
);
}
}
...
...
@@ -452,7 +433,7 @@ public class Introspector {
* @return Instance of an explicit BeanInfo class or null if one isn't found.
*/
private
static
BeanInfo
findExplicitBeanInfo
(
Class
beanClass
)
{
return
get
Finder
().
find
(
beanClass
);
return
ThreadGroupContext
.
getContext
().
getBeanInfo
Finder
().
find
(
beanClass
);
}
/**
...
...
@@ -1275,7 +1256,7 @@ public class Introspector {
if
(!
ReflectUtil
.
isPackageAccessible
(
clz
))
{
return
new
Method
[
0
];
}
synchronized
(
BEANINFO_CACHE
)
{
synchronized
(
declaredMethodCache
)
{
Method
[]
result
=
declaredMethodCache
.
get
(
clz
);
if
(
result
==
null
)
{
result
=
clz
.
getMethods
();
...
...
@@ -1426,17 +1407,6 @@ public class Introspector {
return
false
;
}
private
static
BeanInfoFinder
getFinder
()
{
AppContext
context
=
AppContext
.
getAppContext
();
Object
object
=
context
.
get
(
FINDER_KEY
);
if
(
object
instanceof
BeanInfoFinder
)
{
return
(
BeanInfoFinder
)
object
;
}
BeanInfoFinder
finder
=
new
BeanInfoFinder
();
context
.
put
(
FINDER_KEY
,
finder
);
return
finder
;
}
/**
* Try to create an instance of a named class.
* First try the classloader of "sibling", then try the system
...
...
src/share/classes/java/beans/PropertyEditorManager.java
浏览文件 @
b2a2c099
...
...
@@ -25,9 +25,6 @@
package
java.beans
;
import
com.sun.beans.finder.PropertyEditorFinder
;
import
sun.awt.AppContext
;
/**
* The PropertyEditorManager can be used to locate a property editor for
* any given type name. This property editor must support the
...
...
@@ -55,8 +52,6 @@ import sun.awt.AppContext;
public
class
PropertyEditorManager
{
private
static
final
Object
FINDER_KEY
=
new
Object
();
/**
* Registers an editor class to edit values of the given target class.
* If the editor class is {@code null},
...
...
@@ -81,7 +76,7 @@ public class PropertyEditorManager {
if
(
sm
!=
null
)
{
sm
.
checkPropertiesAccess
();
}
get
Finder
().
register
(
targetType
,
editorClass
);
ThreadGroupContext
.
getContext
().
getPropertyEditor
Finder
().
register
(
targetType
,
editorClass
);
}
/**
...
...
@@ -92,7 +87,7 @@ public class PropertyEditorManager {
* The result is null if no suitable editor can be found.
*/
public
static
PropertyEditor
findEditor
(
Class
<?>
targetType
)
{
return
get
Finder
().
find
(
targetType
);
return
ThreadGroupContext
.
getContext
().
getPropertyEditor
Finder
().
find
(
targetType
);
}
/**
...
...
@@ -104,7 +99,7 @@ public class PropertyEditorManager {
* e.g. Sun implementation initially sets to {"sun.beans.editors"}.
*/
public
static
String
[]
getEditorSearchPath
()
{
return
get
Finder
().
getPackages
();
return
ThreadGroupContext
.
getContext
().
getPropertyEditor
Finder
().
getPackages
();
}
/**
...
...
@@ -125,17 +120,6 @@ public class PropertyEditorManager {
if
(
sm
!=
null
)
{
sm
.
checkPropertiesAccess
();
}
getFinder
().
setPackages
(
path
);
}
private
static
PropertyEditorFinder
getFinder
()
{
AppContext
context
=
AppContext
.
getAppContext
();
Object
object
=
context
.
get
(
FINDER_KEY
);
if
(
object
instanceof
PropertyEditorFinder
)
{
return
(
PropertyEditorFinder
)
object
;
}
PropertyEditorFinder
finder
=
new
PropertyEditorFinder
();
context
.
put
(
FINDER_KEY
,
finder
);
return
finder
;
ThreadGroupContext
.
getContext
().
getPropertyEditorFinder
().
setPackages
(
path
);
}
}
src/share/classes/java/beans/ThreadGroupContext.java
0 → 100644
浏览文件 @
b2a2c099
/*
* 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
java.beans
;
import
com.sun.beans.finder.BeanInfoFinder
;
import
com.sun.beans.finder.PropertyEditorFinder
;
import
java.awt.GraphicsEnvironment
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.WeakHashMap
;
/**
* The {@code ThreadGroupContext} is an application-dependent
* context referenced by the specific {@link ThreadGroup}.
* This is a replacement for the {@link sun.awt.AppContext}.
*
* @author Sergey Malenkov
*/
final
class
ThreadGroupContext
{
private
static
final
Map
<
ThreadGroup
,
ThreadGroupContext
>
contexts
=
new
WeakHashMap
<>();
/**
* Returns the appropriate {@code AppContext} for the caller,
* as determined by its {@code ThreadGroup}.
*
* @return the application-dependent context
*/
static
ThreadGroupContext
getContext
()
{
ThreadGroup
group
=
Thread
.
currentThread
().
getThreadGroup
();
synchronized
(
contexts
)
{
ThreadGroupContext
context
=
contexts
.
get
(
group
);
if
(
context
==
null
)
{
context
=
new
ThreadGroupContext
();
contexts
.
put
(
group
,
context
);
}
return
context
;
}
}
private
volatile
boolean
isDesignTime
;
private
volatile
Boolean
isGuiAvailable
;
private
Map
<
Class
<?>,
BeanInfo
>
beanInfoCache
;
private
BeanInfoFinder
beanInfoFinder
;
private
PropertyEditorFinder
propertyEditorFinder
;
boolean
isDesignTime
()
{
return
this
.
isDesignTime
;
}
void
setDesignTime
(
boolean
isDesignTime
)
{
this
.
isDesignTime
=
isDesignTime
;
}
boolean
isGuiAvailable
()
{
Boolean
isGuiAvailable
=
this
.
isGuiAvailable
;
return
(
isGuiAvailable
!=
null
)
?
isGuiAvailable
.
booleanValue
()
:
!
GraphicsEnvironment
.
isHeadless
();
}
void
setGuiAvailable
(
boolean
isGuiAvailable
)
{
this
.
isGuiAvailable
=
Boolean
.
valueOf
(
isGuiAvailable
);
}
BeanInfo
getBeanInfo
(
Class
<?>
type
)
{
return
(
this
.
beanInfoCache
!=
null
)
?
this
.
beanInfoCache
.
get
(
type
)
:
null
;
}
BeanInfo
putBeanInfo
(
Class
<?>
type
,
BeanInfo
info
)
{
if
(
this
.
beanInfoCache
==
null
)
{
this
.
beanInfoCache
=
new
WeakHashMap
<>();
}
return
this
.
beanInfoCache
.
put
(
type
,
info
);
}
void
removeBeanInfo
(
Class
<?>
type
)
{
if
(
this
.
beanInfoCache
!=
null
)
{
this
.
beanInfoCache
.
remove
(
type
);
}
}
void
clearBeanInfoCache
()
{
if
(
this
.
beanInfoCache
!=
null
)
{
this
.
beanInfoCache
.
clear
();
}
}
synchronized
BeanInfoFinder
getBeanInfoFinder
()
{
if
(
this
.
beanInfoFinder
==
null
)
{
this
.
beanInfoFinder
=
new
BeanInfoFinder
();
}
return
this
.
beanInfoFinder
;
}
synchronized
PropertyEditorFinder
getPropertyEditorFinder
()
{
if
(
this
.
propertyEditorFinder
==
null
)
{
this
.
propertyEditorFinder
=
new
PropertyEditorFinder
();
}
return
this
.
propertyEditorFinder
;
}
}
test/java/beans/Beans/6669869/TestDesignTime.java
浏览文件 @
b2a2c099
...
...
@@ -29,7 +29,6 @@
*/
import
java.beans.Beans
;
import
sun.awt.SunToolkit
;
public
class
TestDesignTime
implements
Runnable
{
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
...
...
@@ -44,7 +43,6 @@ public class TestDesignTime implements Runnable {
}
public
void
run
()
{
SunToolkit
.
createNewAppContext
();
if
(
Beans
.
isDesignTime
())
{
throw
new
Error
(
"shared DesignTime property"
);
}
...
...
test/java/beans/Beans/6669869/TestGuiAvailable.java
浏览文件 @
b2a2c099
...
...
@@ -30,7 +30,6 @@
import
java.awt.GraphicsEnvironment
;
import
java.beans.Beans
;
import
sun.awt.SunToolkit
;
public
class
TestGuiAvailable
implements
Runnable
{
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
...
...
@@ -45,7 +44,6 @@ public class TestGuiAvailable implements Runnable {
}
public
void
run
()
{
SunToolkit
.
createNewAppContext
();
if
(
Beans
.
isGuiAvailable
()
==
GraphicsEnvironment
.
isHeadless
())
{
throw
new
Error
(
"shared GuiAvailable property"
);
}
...
...
test/java/beans/Introspector/6380849/TestBeanInfo.java
浏览文件 @
b2a2c099
...
...
@@ -41,8 +41,6 @@ import java.beans.Introspector;
import
java.lang.ref.Reference
;
import
java.lang.reflect.Field
;
import
sun.awt.SunToolkit
;
public
class
TestBeanInfo
implements
Runnable
{
private
static
final
String
[]
SEARCH_PATH
=
{
"infos"
};
// NON-NLS: package name
...
...
@@ -81,9 +79,6 @@ public class TestBeanInfo implements Runnable {
private
boolean
passed
;
public
void
run
()
{
if
(
this
.
passed
)
{
SunToolkit
.
createNewAppContext
();
}
Introspector
.
flushCaches
();
test
(
FirstBean
.
class
,
FirstBeanBeanInfo
.
class
);
...
...
@@ -98,7 +93,5 @@ public class TestBeanInfo implements Runnable {
test
(
SecondBean
.
class
,
SecondBeanBeanInfo
.
class
);
test
(
ThirdBean
.
class
,
null
);
test
(
ThirdBeanBeanInfo
.
class
,
ThirdBeanBeanInfo
.
class
);
this
.
passed
=
true
;
}
}
test/java/beans/Introspector/7064279/Test7064279.java
0 → 100644
浏览文件 @
b2a2c099
/*
* 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.
*
* 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.
*/
/*
* @test
* @bug 7064279
* @summary Tests that Introspector does not have strong references to context class loader
* @author Sergey Malenkov
*/
import
java.beans.Introspector
;
import
java.io.File
;
import
java.lang.ref.WeakReference
;
import
java.net.URL
;
import
java.net.URLClassLoader
;
public
class
Test7064279
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
WeakReference
ref
=
new
WeakReference
(
test
(
"test.jar"
,
"test.Test"
));
try
{
int
[]
array
=
new
int
[
1024
];
while
(
true
)
{
array
=
new
int
[
array
.
length
<<
1
];
}
}
catch
(
OutOfMemoryError
error
)
{
System
.
gc
();
}
if
(
null
!=
ref
.
get
())
{
throw
new
Error
(
"ClassLoader is not released"
);
}
}
private
static
Object
test
(
String
jarName
,
String
className
)
throws
Exception
{
StringBuilder
sb
=
new
StringBuilder
(
256
);
sb
.
append
(
"file:"
);
sb
.
append
(
System
.
getProperty
(
"test.src"
,
"."
));
sb
.
append
(
File
.
separatorChar
);
sb
.
append
(
jarName
);
ClassLoader
newLoader
=
new
URLClassLoader
(
new
URL
[]
{
new
URL
(
sb
.
toString
())
});
ClassLoader
oldLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
Thread
.
currentThread
().
setContextClassLoader
(
newLoader
);
test
(
newLoader
.
loadClass
(
className
));
Thread
.
currentThread
().
setContextClassLoader
(
oldLoader
);
return
newLoader
;
}
private
static
void
test
(
Class
type
)
throws
Exception
{
Introspector
.
getBeanInfo
(
type
);
}
}
test/java/beans/Introspector/7064279/test.jar
0 → 100644
浏览文件 @
b2a2c099
文件已添加
test/java/beans/Introspector/Test6660539.java
浏览文件 @
b2a2c099
...
...
@@ -28,8 +28,6 @@
* @author Sergey Malenkov
*/
import
sun.awt.SunToolkit
;
import
java.beans.BeanInfo
;
import
java.beans.IntrospectionException
;
import
java.beans.Introspector
;
...
...
@@ -49,7 +47,6 @@ public class Test6660539 implements Runnable {
}
public
void
run
()
{
SunToolkit
.
createNewAppContext
();
for
(
PropertyDescriptor
pd
:
getPropertyDescriptors
())
{
if
(
pd
.
getDisplayName
().
equals
(
NAME
))
throw
new
Error
(
"shared BeanInfo cache"
);
...
...
test/java/beans/PropertyEditor/6380849/TestPropertyEditor.java
浏览文件 @
b2a2c099
...
...
@@ -36,7 +36,6 @@ import java.awt.Font;
import
java.beans.PropertyEditor
;
import
java.beans.PropertyEditorManager
;
import
sun.awt.SunToolkit
;
import
sun.beans.editors.BooleanEditor
;
import
sun.beans.editors.ByteEditor
;
import
sun.beans.editors.ColorEditor
;
...
...
@@ -77,12 +76,7 @@ public class TestPropertyEditor implements Runnable {
}
}
private
boolean
passed
;
public
void
run
()
{
if
(
this
.
passed
)
{
SunToolkit
.
createNewAppContext
();
}
PropertyEditorManager
.
registerEditor
(
ThirdBean
.
class
,
ThirdBeanEditor
.
class
);
test
(
FirstBean
.
class
,
FirstBeanEditor
.
class
);
...
...
@@ -135,7 +129,5 @@ public class TestPropertyEditor implements Runnable {
test
(
Color
.
class
,
null
);
test
(
Font
.
class
,
null
);
test
(
Enumeration
.
class
,
EnumEditor
.
class
);
this
.
passed
=
true
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录