Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
0710f8d3
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看板
提交
0710f8d3
编写于
12月 17, 2019
作者:
A
andrew
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8221246: NullPointerException within Win32ShellFolder2
Reviewed-by: andrew Contributed-by:
N
Alex Kashchenko
<
akashche@redhat.com
>
上级
20c17c10
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
65 addition
and
35 deletion
+65
-35
src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
...ndows/classes/sun/awt/shell/Win32ShellFolderManager2.java
+65
-35
未找到文件。
src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
浏览文件 @
0710f8d3
/*
* Copyright (c) 2003, 201
8
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
9
, 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
...
...
@@ -25,7 +25,8 @@
package
sun.awt.shell
;
import
java.awt.*
;
import
java.awt.Image
;
import
java.awt.Toolkit
;
import
java.awt.image.BufferedImage
;
import
java.io.File
;
...
...
@@ -33,14 +34,29 @@ import java.io.FileNotFoundException;
import
java.io.IOException
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.concurrent.*
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.RejectedExecutionException
;
import
java.util.concurrent.ThreadFactory
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Stream
;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.*;
import
sun.awt.OSInfo
;
import
sun.misc.ThreadGroupUtils
;
import
sun.util.logging.PlatformLogger
;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.
DESKTOP
;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.
DRIVES
;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.
Invoker
;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.
NETWORK
;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.
PERSONAL
;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.
RECENT
;
// NOTE: This class supersedes Win32ShellFolderManager, which was removed
// from distribution after version 1.4.2.
...
...
@@ -54,6 +70,9 @@ import sun.misc.ThreadGroupUtils;
public
class
Win32ShellFolderManager2
extends
ShellFolderManager
{
private
static
final
PlatformLogger
log
=
PlatformLogger
.
getLogger
(
"sun.awt.shell.Win32ShellFolderManager2"
);
static
{
// Load library here
sun
.
awt
.
windows
.
WToolkit
.
loadLibraries
();
...
...
@@ -137,12 +156,13 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
if
(
desktop
==
null
)
{
try
{
desktop
=
new
Win32ShellFolder2
(
DESKTOP
);
}
catch
(
SecurityException
e
)
{
// Ignore error
}
catch
(
IOException
e
)
{
// Ignore error
}
catch
(
InterruptedException
e
)
{
// Ignore error
}
catch
(
final
SecurityException
ignored
)
{
// Ignore, the message may have sensitive information, not
// accessible other ways
}
catch
(
IOException
|
InterruptedException
e
)
{
if
(
log
.
isLoggable
(
PlatformLogger
.
Level
.
WARNING
))
{
log
.
warning
(
"Cannot access 'Desktop'"
,
e
);
}
}
}
return
desktop
;
...
...
@@ -152,12 +172,13 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
if
(
drives
==
null
)
{
try
{
drives
=
new
Win32ShellFolder2
(
DRIVES
);
}
catch
(
SecurityException
e
)
{
// Ignore error
}
catch
(
IOException
e
)
{
// Ignore error
}
catch
(
InterruptedException
e
)
{
// Ignore error
}
catch
(
final
SecurityException
ignored
)
{
// Ignore, the message may have sensitive information, not
// accessible other ways
}
catch
(
IOException
|
InterruptedException
e
)
{
if
(
log
.
isLoggable
(
PlatformLogger
.
Level
.
WARNING
))
{
log
.
warning
(
"Cannot access 'Drives'"
,
e
);
}
}
}
return
drives
;
...
...
@@ -170,12 +191,13 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
if
(
path
!=
null
)
{
recent
=
createShellFolder
(
getDesktop
(),
new
File
(
path
));
}
}
catch
(
SecurityException
e
)
{
// Ignore error
}
catch
(
InterruptedException
e
)
{
// Ignore error
}
catch
(
IOException
e
)
{
// Ignore error
}
catch
(
final
SecurityException
ignored
)
{
// Ignore, the message may have sensitive information, not
// accessible other ways
}
catch
(
InterruptedException
|
IOException
e
)
{
if
(
log
.
isLoggable
(
PlatformLogger
.
Level
.
WARNING
))
{
log
.
warning
(
"Cannot access 'Recent'"
,
e
);
}
}
}
return
recent
;
...
...
@@ -185,12 +207,13 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
if
(
network
==
null
)
{
try
{
network
=
new
Win32ShellFolder2
(
NETWORK
);
}
catch
(
SecurityException
e
)
{
// Ignore error
}
catch
(
IOException
e
)
{
// Ignore error
}
catch
(
InterruptedException
e
)
{
// Ignore error
}
catch
(
final
SecurityException
ignored
)
{
// Ignore, the message may have sensitive information, not
// accessible other ways
}
catch
(
IOException
|
InterruptedException
e
)
{
if
(
log
.
isLoggable
(
PlatformLogger
.
Level
.
WARNING
))
{
log
.
warning
(
"Cannot access 'Network'"
,
e
);
}
}
}
return
network
;
...
...
@@ -210,12 +233,13 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
personal
.
setIsPersonal
();
}
}
}
catch
(
SecurityException
e
)
{
// Ignore error
}
catch
(
InterruptedException
e
)
{
// Ignore error
}
catch
(
IOException
e
)
{
// Ignore error
}
catch
(
final
SecurityException
ignored
)
{
// Ignore, the message may have sensitive information, not
// accessible other ways
}
catch
(
InterruptedException
|
IOException
e
)
{
if
(
log
.
isLoggable
(
PlatformLogger
.
Level
.
WARNING
))
{
log
.
warning
(
"Cannot access 'Personal'"
,
e
);
}
}
}
return
personal
;
...
...
@@ -316,8 +340,14 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
folders
.
add
(
createShellFolder
(
new
File
((
String
)
value
)));
}
}
catch
(
IOException
e
)
{
if
(
log
.
isLoggable
(
PlatformLogger
.
Level
.
WARNING
))
{
log
.
warning
(
"Cannot read value = "
+
value
,
e
);
}
// Skip this value
}
catch
(
InterruptedException
e
)
{
if
(
log
.
isLoggable
(
PlatformLogger
.
Level
.
WARNING
))
{
log
.
warning
(
"Cannot read value = "
+
value
,
e
);
}
// Return empty result
return
new
File
[
0
];
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录