Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
34ec043a
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看板
提交
34ec043a
编写于
8月 10, 2009
作者:
R
rupashka
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6461173: One JCK test([NewFolderAction0001]) failed on Windows due to lack of PropertyPermission(s)
Reviewed-by: peterz, malenkov
上级
a766d790
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
25 deletion
+36
-25
src/share/classes/javax/swing/filechooser/FileSystemView.java
...share/classes/javax/swing/filechooser/FileSystemView.java
+9
-2
src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
+2
-11
src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
...ndows/classes/sun/awt/shell/Win32ShellFolderManager2.java
+25
-12
未找到文件。
src/share/classes/javax/swing/filechooser/FileSystemView.java
浏览文件 @
34ec043a
...
...
@@ -37,6 +37,8 @@ import java.util.Vector;
import
java.lang.ref.WeakReference
;
import
java.beans.PropertyChangeListener
;
import
java.beans.PropertyChangeEvent
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
sun.awt.shell.*
;
...
...
@@ -718,8 +720,13 @@ class WindowsFileSystemView extends FileSystemView {
return
isFileSystemRoot
(
dir
);
}
public
boolean
isFloppyDrive
(
File
dir
)
{
String
path
=
dir
.
getAbsolutePath
();
public
boolean
isFloppyDrive
(
final
File
dir
)
{
String
path
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
String
>()
{
public
String
run
()
{
return
dir
.
getAbsolutePath
();
}
});
return
(
path
!=
null
&&
(
path
.
equals
(
"A:\\"
)
||
path
.
equals
(
"B:\\"
)));
}
...
...
src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
浏览文件 @
34ec043a
...
...
@@ -73,12 +73,7 @@ final class Win32ShellFolder2 extends ShellFolder {
private
static
native
void
initIDs
();
private
static
final
boolean
is98
;
static
{
String
osName
=
System
.
getProperty
(
"os.name"
);
is98
=
(
osName
!=
null
&&
osName
.
startsWith
(
"Windows 98"
));
initIDs
();
}
...
...
@@ -305,7 +300,6 @@ final class Win32ShellFolder2 extends ShellFolder {
},
RuntimeException
.
class
)
);
this
.
disposer
.
relativePIDL
=
relativePIDL
;
getAbsolutePath
();
sun
.
java2d
.
Disposer
.
addRecord
(
this
,
disposer
);
}
...
...
@@ -616,11 +610,8 @@ final class Win32ShellFolder2 extends ShellFolder {
public
boolean
isDirectory
()
{
if
(
isDir
==
null
)
{
// Folders with SFGAO_BROWSABLE have "shell extension" handlers and are
// not traversable in JFileChooser. An exception is "My Documents" on
// Windows 98.
if
(
hasAttribute
(
ATTRIB_FOLDER
)
&&
(!
hasAttribute
(
ATTRIB_BROWSABLE
)
||
(
is98
&&
equals
(
Win32ShellFolderManager2
.
getPersonal
()))))
{
// not traversable in JFileChooser.
if
(
hasAttribute
(
ATTRIB_FOLDER
)
&&
!
hasAttribute
(
ATTRIB_BROWSABLE
))
{
isDir
=
Boolean
.
TRUE
;
}
else
if
(
isLink
())
{
ShellFolder
linkLocation
=
getLinkLocation
(
false
);
...
...
src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
浏览文件 @
34ec043a
...
...
@@ -105,9 +105,11 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
private
static
Win32ShellFolder2
network
;
private
static
Win32ShellFolder2
personal
;
private
static
String
osVersion
=
System
.
getProperty
(
"os.version"
);
private
static
final
boolean
useShell32Icons
=
(
osVersion
!=
null
&&
osVersion
.
compareTo
(
"5.1"
)
>=
0
);
private
static
final
boolean
USE_SHELL32_ICONS
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Boolean
>()
{
public
Boolean
run
()
{
return
OSInfo
.
getWindowsVersion
().
compareTo
(
OSInfo
.
WINDOWS_XP
)
>=
0
;
}
});
static
Win32ShellFolder2
getDesktop
()
{
if
(
desktop
==
null
)
{
...
...
@@ -307,15 +309,15 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
i
=
Integer
.
parseInt
(
name
);
}
catch
(
NumberFormatException
ex
)
{
if
(
name
.
equals
(
"ListView"
))
{
i
=
(
useShell32Icons
)
?
21
:
2
;
i
=
(
USE_SHELL32_ICONS
)
?
21
:
2
;
}
else
if
(
name
.
equals
(
"DetailsView"
))
{
i
=
(
useShell32Icons
)
?
23
:
3
;
i
=
(
USE_SHELL32_ICONS
)
?
23
:
3
;
}
else
if
(
name
.
equals
(
"UpFolder"
))
{
i
=
(
useShell32Icons
)
?
28
:
8
;
i
=
(
USE_SHELL32_ICONS
)
?
28
:
8
;
}
else
if
(
name
.
equals
(
"NewFolder"
))
{
i
=
(
useShell32Icons
)
?
31
:
11
;
i
=
(
USE_SHELL32_ICONS
)
?
31
:
11
;
}
else
if
(
name
.
equals
(
"ViewMenu"
))
{
i
=
(
useShell32Icons
)
?
21
:
2
;
i
=
(
USE_SHELL32_ICONS
)
?
21
:
2
;
}
}
if
(
i
>=
0
)
{
...
...
@@ -352,11 +354,16 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
* Does <code>dir</code> represent a "computer" such as a node on the network, or
* "My Computer" on the desktop.
*/
public
boolean
isComputerNode
(
File
dir
)
{
public
boolean
isComputerNode
(
final
File
dir
)
{
if
(
dir
!=
null
&&
dir
==
getDrives
())
{
return
true
;
}
else
{
String
path
=
dir
.
getAbsolutePath
();
String
path
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
String
>()
{
public
String
run
()
{
return
dir
.
getAbsolutePath
();
}
});
return
(
path
.
startsWith
(
"\\\\"
)
&&
path
.
indexOf
(
"\\"
,
2
)
<
0
);
//Network path
}
}
...
...
@@ -501,7 +508,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
// thread, we don't need to delegate the task
return
task
.
call
();
}
else
{
Future
<
T
>
future
;
final
Future
<
T
>
future
;
try
{
future
=
submit
(
task
);
...
...
@@ -512,7 +519,13 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
try
{
return
future
.
get
();
}
catch
(
InterruptedException
e
)
{
future
.
cancel
(
true
);
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Void
>()
{
public
Void
run
()
{
future
.
cancel
(
true
);
return
null
;
}
});
throw
e
;
}
catch
(
ExecutionException
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录