Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
6e3b273a
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看板
提交
6e3b273a
编写于
3月 31, 2014
作者:
P
pchelko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8035332: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_Window.cpp
Reviewed-by: anthony, serb
上级
fc1f55c7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
58 addition
and
25 deletion
+58
-25
src/windows/native/sun/windows/awt.h
src/windows/native/sun/windows/awt.h
+5
-0
src/windows/native/sun/windows/awt_Window.cpp
src/windows/native/sun/windows/awt_Window.cpp
+53
-25
未找到文件。
src/windows/native/sun/windows/awt.h
浏览文件 @
6e3b273a
...
@@ -49,6 +49,7 @@ typedef AwtObject* PDATA;
...
@@ -49,6 +49,7 @@ typedef AwtObject* PDATA;
#define JNI_CHECK_NULL_GOTO(obj, msg, where) { \
#define JNI_CHECK_NULL_GOTO(obj, msg, where) { \
if (obj == NULL) { \
if (obj == NULL) { \
env->ExceptionClear(); \
JNU_ThrowNullPointerException(env, msg); \
JNU_ThrowNullPointerException(env, msg); \
goto where; \
goto where; \
} \
} \
...
@@ -65,6 +66,7 @@ typedef AwtObject* PDATA;
...
@@ -65,6 +66,7 @@ typedef AwtObject* PDATA;
#define JNI_CHECK_NULL_RETURN(obj, msg) { \
#define JNI_CHECK_NULL_RETURN(obj, msg) { \
if (obj == NULL) { \
if (obj == NULL) { \
env->ExceptionClear(); \
JNU_ThrowNullPointerException(env, msg); \
JNU_ThrowNullPointerException(env, msg); \
return; \
return; \
} \
} \
...
@@ -91,6 +93,7 @@ typedef AwtObject* PDATA;
...
@@ -91,6 +93,7 @@ typedef AwtObject* PDATA;
#define JNI_CHECK_NULL_RETURN_NULL(obj, msg) { \
#define JNI_CHECK_NULL_RETURN_NULL(obj, msg) { \
if (obj == NULL) { \
if (obj == NULL) { \
env->ExceptionClear(); \
JNU_ThrowNullPointerException(env, msg); \
JNU_ThrowNullPointerException(env, msg); \
return 0; \
return 0; \
} \
} \
...
@@ -98,6 +101,7 @@ typedef AwtObject* PDATA;
...
@@ -98,6 +101,7 @@ typedef AwtObject* PDATA;
#define JNI_CHECK_NULL_RETURN_VAL(obj, msg, val) { \
#define JNI_CHECK_NULL_RETURN_VAL(obj, msg, val) { \
if (obj == NULL) { \
if (obj == NULL) { \
env->ExceptionClear(); \
JNU_ThrowNullPointerException(env, msg); \
JNU_ThrowNullPointerException(env, msg); \
return val; \
return val; \
} \
} \
...
@@ -124,6 +128,7 @@ typedef AwtObject* PDATA;
...
@@ -124,6 +128,7 @@ typedef AwtObject* PDATA;
#define THROW_NULL_PDATA_IF_NOT_DESTROYED(peer) { \
#define THROW_NULL_PDATA_IF_NOT_DESTROYED(peer) { \
jboolean destroyed = JNI_GET_DESTROYED(peer); \
jboolean destroyed = JNI_GET_DESTROYED(peer); \
if (destroyed != JNI_TRUE) { \
if (destroyed != JNI_TRUE) { \
env->ExceptionClear(); \
JNU_ThrowNullPointerException(env, "null pData"); \
JNU_ThrowNullPointerException(env, "null pData"); \
} \
} \
}
}
...
...
src/windows/native/sun/windows/awt_Window.cpp
浏览文件 @
6e3b273a
...
@@ -483,6 +483,8 @@ void AwtWindow::CreateHWnd(JNIEnv *env, LPCWSTR title,
...
@@ -483,6 +483,8 @@ void AwtWindow::CreateHWnd(JNIEnv *env, LPCWSTR title,
env
->
DeleteLocalRef
(
target
);
env
->
DeleteLocalRef
(
target
);
InitType
(
env
,
peer
);
InitType
(
env
,
peer
);
JNU_CHECK_EXCEPTION
(
env
);
TweakStyle
(
windowStyle
,
windowExStyle
);
TweakStyle
(
windowStyle
,
windowExStyle
);
AwtCanvas
::
CreateHWnd
(
env
,
title
,
AwtCanvas
::
CreateHWnd
(
env
,
title
,
...
@@ -684,15 +686,27 @@ void AwtWindow::CalculateWarningWindowBounds(JNIEnv *env, LPRECT rect)
...
@@ -684,15 +686,27 @@ void AwtWindow::CalculateWarningWindowBounds(JNIEnv *env, LPRECT rect)
if
(
point2DClassID
==
NULL
)
{
if
(
point2DClassID
==
NULL
)
{
jclass
point2DClassIDLocal
=
env
->
FindClass
(
"java/awt/geom/Point2D"
);
jclass
point2DClassIDLocal
=
env
->
FindClass
(
"java/awt/geom/Point2D"
);
if
(
point2DClassIDLocal
==
NULL
)
{
env
->
DeleteLocalRef
(
point2D
);
return
;
}
point2DClassID
=
(
jclass
)
env
->
NewGlobalRef
(
point2DClassIDLocal
);
point2DClassID
=
(
jclass
)
env
->
NewGlobalRef
(
point2DClassIDLocal
);
env
->
DeleteLocalRef
(
point2DClassIDLocal
);
env
->
DeleteLocalRef
(
point2DClassIDLocal
);
}
}
if
(
point2DGetXMID
==
NULL
)
{
if
(
point2DGetXMID
==
NULL
)
{
point2DGetXMID
=
env
->
GetMethodID
(
point2DClassID
,
"getX"
,
"()D"
);
point2DGetXMID
=
env
->
GetMethodID
(
point2DClassID
,
"getX"
,
"()D"
);
if
(
point2DGetXMID
==
NULL
)
{
env
->
DeleteLocalRef
(
point2D
);
return
;
}
}
}
if
(
point2DGetYMID
==
NULL
)
{
if
(
point2DGetYMID
==
NULL
)
{
point2DGetYMID
=
env
->
GetMethodID
(
point2DClassID
,
"getY"
,
"()D"
);
point2DGetYMID
=
env
->
GetMethodID
(
point2DClassID
,
"getY"
,
"()D"
);
if
(
point2DGetYMID
==
NULL
)
{
env
->
DeleteLocalRef
(
point2D
);
return
;
}
}
}
...
@@ -1071,6 +1085,7 @@ AwtWindow* AwtWindow::Create(jobject self, jobject parent)
...
@@ -1071,6 +1085,7 @@ AwtWindow* AwtWindow::Create(jobject self, jobject parent)
if
(
JNU_IsInstanceOfByName
(
env
,
target
,
"javax/swing/Popup$HeavyWeightWindow"
)
>
0
)
{
if
(
JNU_IsInstanceOfByName
(
env
,
target
,
"javax/swing/Popup$HeavyWeightWindow"
)
>
0
)
{
window
->
m_isRetainingHierarchyZOrder
=
TRUE
;
window
->
m_isRetainingHierarchyZOrder
=
TRUE
;
}
}
if
(
env
->
ExceptionCheck
())
goto
done
;
DWORD
style
=
WS_CLIPCHILDREN
|
WS_POPUP
;
DWORD
style
=
WS_CLIPCHILDREN
|
WS_POPUP
;
DWORD
exStyle
=
WS_EX_NOACTIVATE
;
DWORD
exStyle
=
WS_EX_NOACTIVATE
;
if
(
GetRTL
())
{
if
(
GetRTL
())
{
...
@@ -1378,6 +1393,10 @@ BOOL AwtWindow::UpdateInsets(jobject insets)
...
@@ -1378,6 +1393,10 @@ BOOL AwtWindow::UpdateInsets(jobject insets)
((
AwtFrame
*
)
this
)
->
GetMenuBar
())
{
((
AwtFrame
*
)
this
)
->
GetMenuBar
())
{
m_insets
.
top
+=
::
GetSystemMetrics
(
SM_CYMENU
);
m_insets
.
top
+=
::
GetSystemMetrics
(
SM_CYMENU
);
}
}
if
(
env
->
ExceptionCheck
())
{
env
->
DeleteLocalRef
(
target
);
return
FALSE
;
}
m_insets
.
bottom
+=
extraBottomInsets
;
m_insets
.
bottom
+=
extraBottomInsets
;
env
->
DeleteLocalRef
(
target
);
env
->
DeleteLocalRef
(
target
);
}
}
...
@@ -1445,14 +1464,13 @@ void AwtWindow::SendComponentEvent(jint eventId)
...
@@ -1445,14 +1464,13 @@ void AwtWindow::SendComponentEvent(jint eventId)
classEvent
=
(
jclass
)
env
->
NewGlobalRef
(
classEvent
);
classEvent
=
(
jclass
)
env
->
NewGlobalRef
(
classEvent
);
}
}
env
->
PopLocalFrame
(
0
);
env
->
PopLocalFrame
(
0
);
CHECK_NULL
(
classEvent
);
}
}
static
jmethodID
eventInitMID
=
NULL
;
static
jmethodID
eventInitMID
=
NULL
;
if
(
eventInitMID
==
NULL
)
{
if
(
eventInitMID
==
NULL
)
{
eventInitMID
=
env
->
GetMethodID
(
classEvent
,
"<init>"
,
eventInitMID
=
env
->
GetMethodID
(
classEvent
,
"<init>"
,
"(Ljava/awt/Component;I)V"
);
"(Ljava/awt/Component;I)V"
);
if
(
eventInitMID
==
NULL
)
{
CHECK_NULL
(
eventInitMID
);
return
;
}
}
}
if
(
env
->
EnsureLocalCapacity
(
2
)
<
0
)
{
if
(
env
->
EnsureLocalCapacity
(
2
)
<
0
)
{
return
;
return
;
...
@@ -1462,6 +1480,10 @@ void AwtWindow::SendComponentEvent(jint eventId)
...
@@ -1462,6 +1480,10 @@ void AwtWindow::SendComponentEvent(jint eventId)
target
,
eventId
);
target
,
eventId
);
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
event
!=
NULL
);
DASSERT
(
event
!=
NULL
);
if
(
event
==
NULL
)
{
env
->
DeleteLocalRef
(
target
);
return
;
}
SendEvent
(
event
);
SendEvent
(
event
);
env
->
DeleteLocalRef
(
target
);
env
->
DeleteLocalRef
(
target
);
...
@@ -1503,10 +1525,7 @@ void AwtWindow::SendWindowEvent(jint id, HWND opposite,
...
@@ -1503,10 +1525,7 @@ void AwtWindow::SendWindowEvent(jint id, HWND opposite,
jclass
sequencedEventClsLocal
jclass
sequencedEventClsLocal
=
env
->
FindClass
(
"java/awt/SequencedEvent"
);
=
env
->
FindClass
(
"java/awt/SequencedEvent"
);
DASSERT
(
sequencedEventClsLocal
);
DASSERT
(
sequencedEventClsLocal
);
if
(
sequencedEventClsLocal
==
NULL
)
{
CHECK_NULL
(
sequencedEventClsLocal
);
/* exception already thrown */
return
;
}
sequencedEventCls
=
sequencedEventCls
=
(
jclass
)
env
->
NewGlobalRef
(
sequencedEventClsLocal
);
(
jclass
)
env
->
NewGlobalRef
(
sequencedEventClsLocal
);
env
->
DeleteLocalRef
(
sequencedEventClsLocal
);
env
->
DeleteLocalRef
(
sequencedEventClsLocal
);
...
@@ -1517,6 +1536,7 @@ void AwtWindow::SendWindowEvent(jint id, HWND opposite,
...
@@ -1517,6 +1536,7 @@ void AwtWindow::SendWindowEvent(jint id, HWND opposite,
sequencedEventConst
=
sequencedEventConst
=
env
->
GetMethodID
(
sequencedEventCls
,
"<init>"
,
env
->
GetMethodID
(
sequencedEventCls
,
"<init>"
,
"(Ljava/awt/AWTEvent;)V"
);
"(Ljava/awt/AWTEvent;)V"
);
CHECK_NULL
(
sequencedEventConst
);
}
}
if
(
env
->
EnsureLocalCapacity
(
3
)
<
0
)
{
if
(
env
->
EnsureLocalCapacity
(
3
)
<
0
)
{
...
@@ -1539,6 +1559,7 @@ void AwtWindow::SendWindowEvent(jint id, HWND opposite,
...
@@ -1539,6 +1559,7 @@ void AwtWindow::SendWindowEvent(jint id, HWND opposite,
env
->
DeleteLocalRef
(
jOpposite
);
jOpposite
=
NULL
;
env
->
DeleteLocalRef
(
jOpposite
);
jOpposite
=
NULL
;
}
}
env
->
DeleteLocalRef
(
target
);
target
=
NULL
;
env
->
DeleteLocalRef
(
target
);
target
=
NULL
;
CHECK_NULL
(
event
);
if
(
id
==
java_awt_event_WindowEvent_WINDOW_GAINED_FOCUS
||
if
(
id
==
java_awt_event_WindowEvent_WINDOW_GAINED_FOCUS
||
id
==
java_awt_event_WindowEvent_WINDOW_LOST_FOCUS
)
id
==
java_awt_event_WindowEvent_WINDOW_LOST_FOCUS
)
...
@@ -2024,10 +2045,15 @@ void AwtWindow::CheckIfOnNewScreen() {
...
@@ -2024,10 +2045,15 @@ void AwtWindow::CheckIfOnNewScreen() {
jclass
peerCls
=
env
->
GetObjectClass
(
m_peerObject
);
jclass
peerCls
=
env
->
GetObjectClass
(
m_peerObject
);
DASSERT
(
peerCls
);
DASSERT
(
peerCls
);
CHECK_NULL
(
peerCls
);
jmethodID
draggedID
=
env
->
GetMethodID
(
peerCls
,
"draggedToNewScreen"
,
jmethodID
draggedID
=
env
->
GetMethodID
(
peerCls
,
"draggedToNewScreen"
,
"()V"
);
"()V"
);
DASSERT
(
draggedID
);
DASSERT
(
draggedID
);
if
(
draggedID
==
NULL
)
{
env
->
DeleteLocalRef
(
peerCls
);
return
;
}
env
->
CallVoidMethod
(
m_peerObject
,
draggedID
);
env
->
CallVoidMethod
(
m_peerObject
,
draggedID
);
m_screenNum
=
curScrn
;
m_screenNum
=
curScrn
;
...
@@ -2505,6 +2531,7 @@ void AwtWindow::SetIconData(JNIEnv* env, jintArray iconRaster, jint w, jint h,
...
@@ -2505,6 +2531,7 @@ void AwtWindow::SetIconData(JNIEnv* env, jintArray iconRaster, jint w, jint h,
}
}
m_hIconSm
=
NULL
;
m_hIconSm
=
NULL
;
m_hIcon
=
CreateIconFromRaster
(
env
,
iconRaster
,
w
,
h
);
m_hIcon
=
CreateIconFromRaster
(
env
,
iconRaster
,
w
,
h
);
JNU_CHECK_EXCEPTION
(
env
);
m_hIconSm
=
CreateIconFromRaster
(
env
,
smallIconRaster
,
smw
,
smh
);
m_hIconSm
=
CreateIconFromRaster
(
env
,
smallIconRaster
,
smw
,
smh
);
m_iconInherited
=
(
m_hIcon
==
NULL
);
m_iconInherited
=
(
m_hIcon
==
NULL
);
...
@@ -3057,22 +3084,23 @@ Java_java_awt_Window_initIDs(JNIEnv *env, jclass cls)
...
@@ -3057,22 +3084,23 @@ Java_java_awt_Window_initIDs(JNIEnv *env, jclass cls)
{
{
TRY
;
TRY
;
AwtWindow
::
warningStringID
=
CHECK_NULL
(
AwtWindow
::
warningStringID
=
env
->
GetFieldID
(
cls
,
"warningString"
,
"Ljava/lang/String;"
);
env
->
GetFieldID
(
cls
,
"warningString"
,
"Ljava/lang/String;"
)
)
;
AwtWindow
::
locationByPlatformID
=
CHECK_NULL
(
AwtWindow
::
locationByPlatformID
=
env
->
GetFieldID
(
cls
,
"locationByPlatform"
,
"Z"
);
env
->
GetFieldID
(
cls
,
"locationByPlatform"
,
"Z"
)
)
;
AwtWindow
::
securityWarningWidthID
=
CHECK_NULL
(
AwtWindow
::
securityWarningWidthID
=
env
->
GetFieldID
(
cls
,
"securityWarningWidth"
,
"I"
);
env
->
GetFieldID
(
cls
,
"securityWarningWidth"
,
"I"
)
)
;
AwtWindow
::
securityWarningHeightID
=
CHECK_NULL
(
AwtWindow
::
securityWarningHeightID
=
env
->
GetFieldID
(
cls
,
"securityWarningHeight"
,
"I"
);
env
->
GetFieldID
(
cls
,
"securityWarningHeight"
,
"I"
)
)
;
AwtWindow
::
getWarningStringMID
=
CHECK_NULL
(
AwtWindow
::
getWarningStringMID
=
env
->
GetMethodID
(
cls
,
"getWarningString"
,
"()Ljava/lang/String;"
);
env
->
GetMethodID
(
cls
,
"getWarningString"
,
"()Ljava/lang/String;"
)
)
;
AwtWindow
::
autoRequestFocusID
=
CHECK_NULL
(
AwtWindow
::
autoRequestFocusID
=
env
->
GetFieldID
(
cls
,
"autoRequestFocus"
,
"Z"
);
env
->
GetFieldID
(
cls
,
"autoRequestFocus"
,
"Z"
)
)
;
AwtWindow
::
calculateSecurityWarningPositionMID
=
CHECK_NULL
(
AwtWindow
::
calculateSecurityWarningPositionMID
=
env
->
GetMethodID
(
cls
,
"calculateSecurityWarningPosition"
,
"(DDDD)Ljava/awt/geom/Point2D;"
);
env
->
GetMethodID
(
cls
,
"calculateSecurityWarningPosition"
,
"(DDDD)Ljava/awt/geom/Point2D;"
)
)
;
jclass
windowTypeClass
=
env
->
FindClass
(
"java/awt/Window$Type"
);
jclass
windowTypeClass
=
env
->
FindClass
(
"java/awt/Window$Type"
);
CHECK_NULL
(
windowTypeClass
);
AwtWindow
::
windowTypeNameMID
=
AwtWindow
::
windowTypeNameMID
=
env
->
GetMethodID
(
windowTypeClass
,
"name"
,
"()Ljava/lang/String;"
);
env
->
GetMethodID
(
windowTypeClass
,
"name"
,
"()Ljava/lang/String;"
);
env
->
DeleteLocalRef
(
windowTypeClass
);
env
->
DeleteLocalRef
(
windowTypeClass
);
...
@@ -3099,10 +3127,10 @@ Java_sun_awt_windows_WWindowPeer_initIDs(JNIEnv *env, jclass cls)
...
@@ -3099,10 +3127,10 @@ Java_sun_awt_windows_WWindowPeer_initIDs(JNIEnv *env, jclass cls)
{
{
TRY
;
TRY
;
AwtWindow
::
sysXID
=
env
->
GetFieldID
(
cls
,
"sysX"
,
"I"
);
CHECK_NULL
(
AwtWindow
::
sysXID
=
env
->
GetFieldID
(
cls
,
"sysX"
,
"I"
)
);
AwtWindow
::
sysYID
=
env
->
GetFieldID
(
cls
,
"sysY"
,
"I"
);
CHECK_NULL
(
AwtWindow
::
sysYID
=
env
->
GetFieldID
(
cls
,
"sysY"
,
"I"
)
);
AwtWindow
::
sysWID
=
env
->
GetFieldID
(
cls
,
"sysW"
,
"I"
);
CHECK_NULL
(
AwtWindow
::
sysWID
=
env
->
GetFieldID
(
cls
,
"sysW"
,
"I"
)
);
AwtWindow
::
sysHID
=
env
->
GetFieldID
(
cls
,
"sysH"
,
"I"
);
CHECK_NULL
(
AwtWindow
::
sysHID
=
env
->
GetFieldID
(
cls
,
"sysH"
,
"I"
)
);
AwtWindow
::
windowTypeID
=
env
->
GetFieldID
(
cls
,
"windowType"
,
AwtWindow
::
windowTypeID
=
env
->
GetFieldID
(
cls
,
"windowType"
,
"Ljava/awt/Window$Type;"
);
"Ljava/awt/Window$Type;"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录