Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
cb022047
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看板
提交
cb022047
编写于
7月 13, 2018
作者:
K
kaddepalli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8194546: Choosier FileManagers
Reviewed-by: prr, serb, skoivu, rhalade
上级
8e66fd62
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
8 deletion
+19
-8
src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
+4
-2
src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
...ndows/classes/sun/awt/shell/Win32ShellFolderManager2.java
+15
-6
未找到文件。
src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
浏览文件 @
cb022047
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
8
, 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
...
...
@@ -677,7 +677,7 @@ final class Win32ShellFolder2 extends ShellFolder {
}
try
{
return
invoke
(
new
Callable
<
File
[]>()
{
File
[]
files
=
invoke
(
new
Callable
<
File
[]>()
{
public
File
[]
call
()
throws
InterruptedException
{
if
(!
isDirectory
())
{
return
null
;
...
...
@@ -731,6 +731,8 @@ final class Win32ShellFolder2 extends ShellFolder {
?
new
File
[
0
]
:
list
.
toArray
(
new
ShellFolder
[
list
.
size
()]);
}
return
Win32ShellFolderManager2
.
checkFiles
(
files
);
},
InterruptedException
.
class
);
}
catch
(
InterruptedException
e
)
{
return
new
File
[
0
];
...
...
src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
浏览文件 @
cb022047
/*
* Copyright (c) 2003, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
8
, 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
...
...
@@ -379,21 +379,30 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
return
null
;
}
private
File
checkFile
(
File
file
)
{
private
static
File
checkFile
(
File
file
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
return
(
sm
==
null
||
file
==
null
)
?
file
:
checkFile
(
file
,
sm
);
}
private
File
checkFile
(
File
file
,
SecurityManager
sm
)
{
private
static
File
checkFile
(
File
file
,
SecurityManager
sm
)
{
try
{
sm
.
checkRead
(
file
.
getPath
());
if
(
file
instanceof
Win32ShellFolder2
)
{
Win32ShellFolder2
f
=
(
Win32ShellFolder2
)
file
;
if
(
f
.
isLink
())
{
Win32ShellFolder2
link
=
(
Win32ShellFolder2
)
f
.
getLinkLocation
();
if
(
link
!=
null
)
sm
.
checkRead
(
link
.
getPath
());
}
}
return
file
;
}
catch
(
SecurityException
se
)
{
return
null
;
}
}
private
File
[]
checkFiles
(
File
[]
files
)
{
static
File
[]
checkFiles
(
File
[]
files
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
==
null
||
files
==
null
||
files
.
length
==
0
)
{
return
files
;
...
...
@@ -401,7 +410,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
return
checkFiles
(
Arrays
.
stream
(
files
),
sm
);
}
private
File
[]
checkFiles
(
List
<
File
>
files
)
{
private
static
File
[]
checkFiles
(
List
<
File
>
files
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
==
null
||
files
.
isEmpty
())
{
return
files
.
toArray
(
new
File
[
files
.
size
()]);
...
...
@@ -409,7 +418,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
return
checkFiles
(
files
.
stream
(),
sm
);
}
private
File
[]
checkFiles
(
Stream
<
File
>
filesStream
,
SecurityManager
sm
)
{
private
static
File
[]
checkFiles
(
Stream
<
File
>
filesStream
,
SecurityManager
sm
)
{
return
filesStream
.
filter
((
file
)
->
checkFile
(
file
,
sm
)
!=
null
)
.
toArray
(
File
[]::
new
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录