Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
371ca36c
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看板
提交
371ca36c
编写于
4月 23, 2015
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6829245: Reg test: java/awt/Component/isLightweightCrash/StubPeerCrash.java fails
Reviewed-by: azvegint, alexsch
上级
ba31725b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
188 deletion
+0
-188
test/java/awt/Component/isLightweightCrash/StubPeerCrash.java
.../java/awt/Component/isLightweightCrash/StubPeerCrash.java
+0
-188
未找到文件。
test/java/awt/Component/isLightweightCrash/StubPeerCrash.java
已删除
100644 → 0
浏览文件 @
ba31725b
/*
* Copyright (c) 2007, 2008, 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 6255653
@summary REGRESSION: Override isLightweight() causes access violation in awt.dll
@author Andrei Dmitriev: area=awt-component
@run main StubPeerCrash
*/
/*
* The test may not crash for several times so iteratively continue up to some limit.
*/
import
java.awt.*
;
import
java.awt.peer.*
;
import
java.awt.event.PaintEvent
;
import
java.awt.image.ImageProducer
;
import
java.awt.image.ImageObserver
;
import
java.awt.image.ColorModel
;
import
java.awt.image.VolatileImage
;
import
java.awt.GraphicsConfiguration
;
import
sun.awt.CausedFocusEvent
;
import
sun.java2d.pipe.Region
;
public
class
StubPeerCrash
{
public
static
int
ITERATIONS
=
20
;
public
static
void
main
(
String
[]
s
)
{
for
(
int
i
=
0
;
i
<
ITERATIONS
;
i
++){
showFrame
(
i
);
}
}
private
static
void
showFrame
(
int
i
){
System
.
out
.
println
(
"iteration = "
+
i
);
Frame
f
=
new
Frame
();
f
.
add
(
new
AHeavyweightComponent
());
f
.
setVisible
(
true
);
f
.
setVisible
(
false
);
}
}
class
AHeavyweightComponent
extends
Component
{
private
ComponentPeer
peer
=
new
StubComponentPeer
();
public
AHeavyweightComponent
(){
}
public
boolean
isLightweight
()
{
return
false
;
}
public
ComponentPeer
getPeer
(){
return
peer
;
}
}
class
StubComponentPeer
implements
ComponentPeer
{
public
boolean
isObscured
(){
return
true
;};
public
boolean
canDetermineObscurity
(){
return
true
;};
public
void
setVisible
(
boolean
b
){};
public
void
setEnabled
(
boolean
b
){};
public
void
paint
(
Graphics
g
){};
public
void
repaint
(
long
tm
,
int
x
,
int
y
,
int
width
,
int
height
){};
public
void
print
(
Graphics
g
){};
public
void
setBounds
(
int
x
,
int
y
,
int
width
,
int
height
,
int
op
){};
public
void
handleEvent
(
AWTEvent
e
){};
public
void
coalescePaintEvent
(
PaintEvent
e
){};
public
Point
getLocationOnScreen
(){
return
null
;};
public
Dimension
getPreferredSize
(){
return
null
;};
public
Dimension
getMinimumSize
(){
return
null
;};
public
ColorModel
getColorModel
(){
return
null
;};
public
Toolkit
getToolkit
(){
return
null
;};
public
Graphics
getGraphics
(){
return
null
;};
public
FontMetrics
getFontMetrics
(
Font
font
){
return
null
;};
public
void
dispose
(){};
public
void
setForeground
(
Color
c
){};
public
void
setBackground
(
Color
c
){};
public
void
setFont
(
Font
f
){};
public
void
updateCursorImmediately
(){};
public
boolean
requestFocus
(
Component
lightweightChild
,
boolean
temporary
,
boolean
focusedWindowChangeAllowed
,
long
time
,
CausedFocusEvent
.
Cause
cause
){
return
true
;
};
public
boolean
isFocusable
(){
return
true
;};
public
Image
createImage
(
ImageProducer
producer
){
return
null
;};
public
Image
createImage
(
int
width
,
int
height
){
return
null
;};
public
VolatileImage
createVolatileImage
(
int
width
,
int
height
){
return
null
;};
public
boolean
prepareImage
(
Image
img
,
int
w
,
int
h
,
ImageObserver
o
){
return
true
;};
public
int
checkImage
(
Image
img
,
int
w
,
int
h
,
ImageObserver
o
){
return
0
;};
public
GraphicsConfiguration
getGraphicsConfiguration
(){
return
null
;};
public
boolean
handlesWheelScrolling
(){
return
true
;};
public
void
createBuffers
(
int
numBuffers
,
BufferCapabilities
caps
)
throws
AWTException
{};
public
Image
getBackBuffer
(){
return
null
;};
public
void
flip
(
int
x1
,
int
y1
,
int
x2
,
int
y2
,
BufferCapabilities
.
FlipContents
flipAction
){};
public
void
destroyBuffers
(){};
/**
* Reparents this peer to the new parent referenced by <code>newContainer</code> peer
* Implementation depends on toolkit and container.
* @param newContainer peer of the new parent container
* @since 1.5
*/
public
void
reparent
(
ContainerPeer
newContainer
){};
/**
* Returns whether this peer supports reparenting to another parent withour destroying the peer
* @return true if appropriate reparent is supported, false otherwise
* @since 1.5
*/
public
boolean
isReparentSupported
(){
return
true
;};
/**
* Used by lightweight implementations to tell a ComponentPeer to layout
* its sub-elements. For instance, a lightweight Checkbox needs to layout
* the box, as well as the text label.
*/
public
void
layout
(){};
public
Rectangle
getBounds
(){
return
null
;};
/**
* Applies the shape to the native component window.
* @since 1.7
*/
public
void
applyShape
(
Region
shape
){};
/**
* DEPRECATED: Replaced by getPreferredSize().
*/
public
Dimension
preferredSize
(){
return
null
;};
/**
* DEPRECATED: Replaced by getMinimumSize().
*/
public
Dimension
minimumSize
(){
return
null
;};
/**
* DEPRECATED: Replaced by setVisible(boolean).
*/
public
void
show
(){};
/**
* DEPRECATED: Replaced by setVisible(boolean).
*/
public
void
hide
(){};
/**
* DEPRECATED: Replaced by setEnabled(boolean).
*/
public
void
enable
(){};
/**
* DEPRECATED: Replaced by setEnabled(boolean).
*/
public
void
disable
(){};
/**
* DEPRECATED: Replaced by setBounds(int, int, int, int).
*/
public
void
reshape
(
int
x
,
int
y
,
int
width
,
int
height
){};
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录