Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
a8969e0a
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看板
提交
a8969e0a
编写于
3月 03, 2010
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6931216: TEST_BUG: test/java/nio/file/WatchService/LotsOfEvents.java failed with NPE
Reviewed-by: chegar
上级
c7e0111d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
4 deletion
+4
-4
test/java/nio/file/WatchService/LotsOfEvents.java
test/java/nio/file/WatchService/LotsOfEvents.java
+4
-4
未找到文件。
test/java/nio/file/WatchService/LotsOfEvents.java
浏览文件 @
a8969e0a
...
@@ -102,7 +102,7 @@ public class LotsOfEvents {
...
@@ -102,7 +102,7 @@ public class LotsOfEvents {
int
nread
=
0
;
int
nread
=
0
;
boolean
gotOverflow
=
false
;
boolean
gotOverflow
=
false
;
do
{
while
(
key
!=
null
)
{
List
<
WatchEvent
<?>>
events
=
key
.
pollEvents
();
List
<
WatchEvent
<?>>
events
=
key
.
pollEvents
();
for
(
WatchEvent
<?>
event:
events
)
{
for
(
WatchEvent
<?>
event:
events
)
{
WatchEvent
.
Kind
<?>
kind
=
event
.
kind
();
WatchEvent
.
Kind
<?>
kind
=
event
.
kind
();
...
@@ -122,7 +122,7 @@ public class LotsOfEvents {
...
@@ -122,7 +122,7 @@ public class LotsOfEvents {
if
(!
key
.
reset
())
if
(!
key
.
reset
())
throw
new
RuntimeException
(
"Key is no longer valid"
);
throw
new
RuntimeException
(
"Key is no longer valid"
);
key
=
watcher
.
poll
(
2
,
TimeUnit
.
SECONDS
);
key
=
watcher
.
poll
(
2
,
TimeUnit
.
SECONDS
);
}
while
(
key
!=
null
);
}
// check that all expected events were received or there was an overflow
// check that all expected events were received or there was an overflow
if
(
nread
<
count
&&
!
gotOverflow
)
if
(
nread
<
count
&&
!
gotOverflow
)
...
@@ -168,7 +168,7 @@ public class LotsOfEvents {
...
@@ -168,7 +168,7 @@ public class LotsOfEvents {
// process events and ensure that we don't get repeated modify
// process events and ensure that we don't get repeated modify
// events for the same file.
// events for the same file.
WatchKey
key
=
watcher
.
poll
(
15
,
TimeUnit
.
SECONDS
);
WatchKey
key
=
watcher
.
poll
(
15
,
TimeUnit
.
SECONDS
);
do
{
while
(
key
!=
null
)
{
Set
<
Path
>
modified
=
new
HashSet
<
Path
>();
Set
<
Path
>
modified
=
new
HashSet
<
Path
>();
for
(
WatchEvent
<?>
event:
key
.
pollEvents
())
{
for
(
WatchEvent
<?>
event:
key
.
pollEvents
())
{
WatchEvent
.
Kind
<?>
kind
=
event
.
kind
();
WatchEvent
.
Kind
<?>
kind
=
event
.
kind
();
...
@@ -186,7 +186,7 @@ public class LotsOfEvents {
...
@@ -186,7 +186,7 @@ public class LotsOfEvents {
if
(!
key
.
reset
())
if
(!
key
.
reset
())
throw
new
RuntimeException
(
"Key is no longer valid"
);
throw
new
RuntimeException
(
"Key is no longer valid"
);
key
=
watcher
.
poll
(
2
,
TimeUnit
.
SECONDS
);
key
=
watcher
.
poll
(
2
,
TimeUnit
.
SECONDS
);
}
while
(
key
!=
null
);
}
}
}
}
finally
{
}
finally
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录