Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
88b54b54
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看板
提交
88b54b54
编写于
3月 12, 2014
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8035747: [parfait] JNI exception pending in src/windows/native/sun/windows/awt_FileDialog.cpp
Reviewed-by: pchelko, azvegint
上级
21661769
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
42 addition
and
16 deletion
+42
-16
src/windows/native/sun/windows/awt_FileDialog.cpp
src/windows/native/sun/windows/awt_FileDialog.cpp
+42
-16
未找到文件。
src/windows/native/sun/windows/awt_FileDialog.cpp
浏览文件 @
88b54b54
/*
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
4
, 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
...
...
@@ -180,6 +180,9 @@ FileDialogHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
return
TRUE
;
}
jstring
strPath
=
JNU_NewStringPlatform
(
env
,
szPath
);
if
(
strPath
==
NULL
)
{
throw
std
::
bad_alloc
();
}
// Call FilenameFilter.accept with path and filename
UINT
uRes
=
(
env
->
CallBooleanMethod
(
peer
,
AwtFileDialog
::
checkFilenameFilterMID
,
strPath
)
==
JNI_TRUE
);
...
...
@@ -269,6 +272,9 @@ AwtFileDialog::Show(void *p)
if
(
title
==
NULL
||
env
->
GetStringLength
(
title
)
==
0
)
{
title
=
JNU_NewStringPlatform
(
env
,
L" "
);
if
(
title
==
NULL
)
{
throw
std
::
bad_alloc
();
}
}
JavaStringBuffer
titleBuffer
(
env
,
title
);
...
...
@@ -376,6 +382,9 @@ AwtFileDialog::Show(void *p)
?
(
jint
)
GetBufferLength
(
ofn
.
lpstrFile
,
ofn
.
nMaxFile
)
:
(
jint
)
_tcslen
(
ofn
.
lpstrFile
);
jcharArray
jnames
=
env
->
NewCharArray
(
length
);
if
(
jnames
==
NULL
)
{
throw
std
::
bad_alloc
();
}
env
->
SetCharArrayRegion
(
jnames
,
0
,
length
,
(
jchar
*
)
ofn
.
lpstrFile
);
env
->
CallVoidMethod
(
peer
,
AwtFileDialog
::
handleSelectedMID
,
jnames
);
...
...
@@ -500,38 +509,55 @@ Java_sun_awt_windows_WFileDialogPeer_initIDs(JNIEnv *env, jclass cls)
AwtFileDialog
::
parentID
=
env
->
GetFieldID
(
cls
,
"parent"
,
"Lsun/awt/windows/WComponentPeer;"
);
DASSERT
(
AwtFileDialog
::
parentID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
parentID
);
AwtFileDialog
::
fileFilterID
=
env
->
GetFieldID
(
cls
,
"fileFilter"
,
"Ljava/io/FilenameFilter;"
);
AwtFileDialog
::
setHWndMID
=
env
->
GetMethodID
(
cls
,
"setHWnd"
,
"(J)V"
);
DASSERT
(
AwtFileDialog
::
fileFilterID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
fileFilterID
);
AwtFileDialog
::
setHWndMID
=
env
->
GetMethodID
(
cls
,
"setHWnd"
,
"(J)V"
);
DASSERT
(
AwtFileDialog
::
setHWndMID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
setHWndMID
);
AwtFileDialog
::
handleSelectedMID
=
env
->
GetMethodID
(
cls
,
"handleSelected"
,
"([C)V"
);
DASSERT
(
AwtFileDialog
::
handleSelectedMID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
handleSelectedMID
);
AwtFileDialog
::
handleCancelMID
=
env
->
GetMethodID
(
cls
,
"handleCancel"
,
"()V"
);
DASSERT
(
AwtFileDialog
::
handleCancelMID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
handleCancelMID
);
AwtFileDialog
::
checkFilenameFilterMID
=
env
->
GetMethodID
(
cls
,
"checkFilenameFilter"
,
"(Ljava/lang/String;)Z"
);
DASSERT
(
AwtFileDialog
::
checkFilenameFilterMID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
checkFilenameFilterMID
);
AwtFileDialog
::
isMultipleModeMID
=
env
->
GetMethodID
(
cls
,
"isMultipleMode"
,
"()Z"
);
DASSERT
(
AwtFileDialog
::
isMultipleModeMID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
isMultipleModeMID
);
/* java.awt.FileDialog fields */
cls
=
env
->
FindClass
(
"java/awt/FileDialog"
);
if
(
cls
==
NULL
)
{
return
;
}
CHECK_NULL
(
cls
);
AwtFileDialog
::
modeID
=
env
->
GetFieldID
(
cls
,
"mode"
,
"I"
);
DASSERT
(
AwtFileDialog
::
modeID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
modeID
);
AwtFileDialog
::
dirID
=
env
->
GetFieldID
(
cls
,
"dir"
,
"Ljava/lang/String;"
);
DASSERT
(
AwtFileDialog
::
dirID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
dirID
);
AwtFileDialog
::
fileID
=
env
->
GetFieldID
(
cls
,
"file"
,
"Ljava/lang/String;"
);
DASSERT
(
AwtFileDialog
::
fileID
!=
NULL
);
CHECK_NULL
(
AwtFileDialog
::
fileID
);
AwtFileDialog
::
filterID
=
env
->
GetFieldID
(
cls
,
"filter"
,
"Ljava/io/FilenameFilter;"
);
DASSERT
(
AwtFileDialog
::
parentID
!=
NULL
);
DASSERT
(
AwtFileDialog
::
setHWndMID
!=
NULL
);
DASSERT
(
AwtFileDialog
::
handleSelectedMID
!=
NULL
);
DASSERT
(
AwtFileDialog
::
handleCancelMID
!=
NULL
);
DASSERT
(
AwtFileDialog
::
isMultipleModeMID
!=
NULL
);
DASSERT
(
AwtFileDialog
::
modeID
!=
NULL
);
DASSERT
(
AwtFileDialog
::
dirID
!=
NULL
);
DASSERT
(
AwtFileDialog
::
fileID
!=
NULL
);
DASSERT
(
AwtFileDialog
::
filterID
!=
NULL
);
CATCH_BAD_ALLOC
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录