Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
6742ab21
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看板
提交
6742ab21
编写于
9月 08, 2012
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
2e952539
af47f116
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
35 deletion
+36
-35
src/share/classes/java/util/logging/FileHandler.java
src/share/classes/java/util/logging/FileHandler.java
+6
-6
src/share/classes/java/util/logging/Handler.java
src/share/classes/java/util/logging/Handler.java
+8
-8
src/share/classes/java/util/logging/LogManager.java
src/share/classes/java/util/logging/LogManager.java
+12
-11
src/share/classes/java/util/logging/Logger.java
src/share/classes/java/util/logging/Logger.java
+8
-8
src/share/classes/java/util/logging/MemoryHandler.java
src/share/classes/java/util/logging/MemoryHandler.java
+1
-1
src/share/classes/java/util/logging/StreamHandler.java
src/share/classes/java/util/logging/StreamHandler.java
+1
-1
未找到文件。
src/share/classes/java/util/logging/FileHandler.java
浏览文件 @
6742ab21
...
@@ -220,7 +220,7 @@ public class FileHandler extends StreamHandler {
...
@@ -220,7 +220,7 @@ public class FileHandler extends StreamHandler {
* @exception NullPointerException if pattern property is an empty String.
* @exception NullPointerException if pattern property is an empty String.
*/
*/
public
FileHandler
()
throws
IOException
,
SecurityException
{
public
FileHandler
()
throws
IOException
,
SecurityException
{
check
Access
();
check
Permission
();
configure
();
configure
();
openFiles
();
openFiles
();
}
}
...
@@ -246,7 +246,7 @@ public class FileHandler extends StreamHandler {
...
@@ -246,7 +246,7 @@ public class FileHandler extends StreamHandler {
if
(
pattern
.
length
()
<
1
)
{
if
(
pattern
.
length
()
<
1
)
{
throw
new
IllegalArgumentException
();
throw
new
IllegalArgumentException
();
}
}
check
Access
();
check
Permission
();
configure
();
configure
();
this
.
pattern
=
pattern
;
this
.
pattern
=
pattern
;
this
.
limit
=
0
;
this
.
limit
=
0
;
...
@@ -278,7 +278,7 @@ public class FileHandler extends StreamHandler {
...
@@ -278,7 +278,7 @@ public class FileHandler extends StreamHandler {
if
(
pattern
.
length
()
<
1
)
{
if
(
pattern
.
length
()
<
1
)
{
throw
new
IllegalArgumentException
();
throw
new
IllegalArgumentException
();
}
}
check
Access
();
check
Permission
();
configure
();
configure
();
this
.
pattern
=
pattern
;
this
.
pattern
=
pattern
;
this
.
limit
=
0
;
this
.
limit
=
0
;
...
@@ -315,7 +315,7 @@ public class FileHandler extends StreamHandler {
...
@@ -315,7 +315,7 @@ public class FileHandler extends StreamHandler {
if
(
limit
<
0
||
count
<
1
||
pattern
.
length
()
<
1
)
{
if
(
limit
<
0
||
count
<
1
||
pattern
.
length
()
<
1
)
{
throw
new
IllegalArgumentException
();
throw
new
IllegalArgumentException
();
}
}
check
Access
();
check
Permission
();
configure
();
configure
();
this
.
pattern
=
pattern
;
this
.
pattern
=
pattern
;
this
.
limit
=
limit
;
this
.
limit
=
limit
;
...
@@ -354,7 +354,7 @@ public class FileHandler extends StreamHandler {
...
@@ -354,7 +354,7 @@ public class FileHandler extends StreamHandler {
if
(
limit
<
0
||
count
<
1
||
pattern
.
length
()
<
1
)
{
if
(
limit
<
0
||
count
<
1
||
pattern
.
length
()
<
1
)
{
throw
new
IllegalArgumentException
();
throw
new
IllegalArgumentException
();
}
}
check
Access
();
check
Permission
();
configure
();
configure
();
this
.
pattern
=
pattern
;
this
.
pattern
=
pattern
;
this
.
limit
=
limit
;
this
.
limit
=
limit
;
...
@@ -367,7 +367,7 @@ public class FileHandler extends StreamHandler {
...
@@ -367,7 +367,7 @@ public class FileHandler extends StreamHandler {
// configured instance variables.
// configured instance variables.
private
void
openFiles
()
throws
IOException
{
private
void
openFiles
()
throws
IOException
{
LogManager
manager
=
LogManager
.
getLogManager
();
LogManager
manager
=
LogManager
.
getLogManager
();
manager
.
check
Access
();
manager
.
check
Permission
();
if
(
count
<
1
)
{
if
(
count
<
1
)
{
throw
new
IllegalArgumentException
(
"file count = "
+
count
);
throw
new
IllegalArgumentException
(
"file count = "
+
count
);
}
}
...
...
src/share/classes/java/util/logging/Handler.java
浏览文件 @
6742ab21
...
@@ -111,7 +111,7 @@ public abstract class Handler {
...
@@ -111,7 +111,7 @@ public abstract class Handler {
* the caller does not have <tt>LoggingPermission("control")</tt>.
* the caller does not have <tt>LoggingPermission("control")</tt>.
*/
*/
public
void
setFormatter
(
Formatter
newFormatter
)
throws
SecurityException
{
public
void
setFormatter
(
Formatter
newFormatter
)
throws
SecurityException
{
check
Access
();
check
Permission
();
// Check for a null pointer:
// Check for a null pointer:
newFormatter
.
getClass
();
newFormatter
.
getClass
();
formatter
=
newFormatter
;
formatter
=
newFormatter
;
...
@@ -140,7 +140,7 @@ public abstract class Handler {
...
@@ -140,7 +140,7 @@ public abstract class Handler {
*/
*/
public
void
setEncoding
(
String
encoding
)
public
void
setEncoding
(
String
encoding
)
throws
SecurityException
,
java
.
io
.
UnsupportedEncodingException
{
throws
SecurityException
,
java
.
io
.
UnsupportedEncodingException
{
check
Access
();
check
Permission
();
if
(
encoding
!=
null
)
{
if
(
encoding
!=
null
)
{
try
{
try
{
if
(!
java
.
nio
.
charset
.
Charset
.
isSupported
(
encoding
))
{
if
(!
java
.
nio
.
charset
.
Charset
.
isSupported
(
encoding
))
{
...
@@ -175,7 +175,7 @@ public abstract class Handler {
...
@@ -175,7 +175,7 @@ public abstract class Handler {
* the caller does not have <tt>LoggingPermission("control")</tt>.
* the caller does not have <tt>LoggingPermission("control")</tt>.
*/
*/
public
void
setFilter
(
Filter
newFilter
)
throws
SecurityException
{
public
void
setFilter
(
Filter
newFilter
)
throws
SecurityException
{
check
Access
();
check
Permission
();
filter
=
newFilter
;
filter
=
newFilter
;
}
}
...
@@ -199,7 +199,7 @@ public abstract class Handler {
...
@@ -199,7 +199,7 @@ public abstract class Handler {
* the caller does not have <tt>LoggingPermission("control")</tt>.
* the caller does not have <tt>LoggingPermission("control")</tt>.
*/
*/
public
void
setErrorManager
(
ErrorManager
em
)
{
public
void
setErrorManager
(
ErrorManager
em
)
{
check
Access
();
check
Permission
();
if
(
em
==
null
)
{
if
(
em
==
null
)
{
throw
new
NullPointerException
();
throw
new
NullPointerException
();
}
}
...
@@ -213,7 +213,7 @@ public abstract class Handler {
...
@@ -213,7 +213,7 @@ public abstract class Handler {
* the caller does not have <tt>LoggingPermission("control")</tt>.
* the caller does not have <tt>LoggingPermission("control")</tt>.
*/
*/
public
ErrorManager
getErrorManager
()
{
public
ErrorManager
getErrorManager
()
{
check
Access
();
check
Permission
();
return
errorManager
;
return
errorManager
;
}
}
...
@@ -253,7 +253,7 @@ public abstract class Handler {
...
@@ -253,7 +253,7 @@ public abstract class Handler {
if
(
newLevel
==
null
)
{
if
(
newLevel
==
null
)
{
throw
new
NullPointerException
();
throw
new
NullPointerException
();
}
}
check
Access
();
check
Permission
();
logLevel
=
newLevel
;
logLevel
=
newLevel
;
}
}
...
@@ -296,9 +296,9 @@ public abstract class Handler {
...
@@ -296,9 +296,9 @@ public abstract class Handler {
// If "sealed" is true, we check that the caller has
// If "sealed" is true, we check that the caller has
// appropriate security privileges to update Handler
// appropriate security privileges to update Handler
// state and if not throw a SecurityException.
// state and if not throw a SecurityException.
void
check
Access
()
throws
SecurityException
{
void
check
Permission
()
throws
SecurityException
{
if
(
sealed
)
{
if
(
sealed
)
{
manager
.
check
Access
();
manager
.
check
Permission
();
}
}
}
}
}
}
src/share/classes/java/util/logging/LogManager.java
浏览文件 @
6742ab21
...
@@ -314,7 +314,7 @@ public class LogManager {
...
@@ -314,7 +314,7 @@ public class LogManager {
*/
*/
public
void
addPropertyChangeListener
(
PropertyChangeListener
l
)
throws
SecurityException
{
public
void
addPropertyChangeListener
(
PropertyChangeListener
l
)
throws
SecurityException
{
PropertyChangeListener
listener
=
Objects
.
requireNonNull
(
l
);
PropertyChangeListener
listener
=
Objects
.
requireNonNull
(
l
);
check
Access
();
check
Permission
();
synchronized
(
listenerMap
)
{
synchronized
(
listenerMap
)
{
// increment the registration count if already registered
// increment the registration count if already registered
Integer
value
=
listenerMap
.
get
(
listener
);
Integer
value
=
listenerMap
.
get
(
listener
);
...
@@ -338,7 +338,7 @@ public class LogManager {
...
@@ -338,7 +338,7 @@ public class LogManager {
* the caller does not have LoggingPermission("control").
* the caller does not have LoggingPermission("control").
*/
*/
public
void
removePropertyChangeListener
(
PropertyChangeListener
l
)
throws
SecurityException
{
public
void
removePropertyChangeListener
(
PropertyChangeListener
l
)
throws
SecurityException
{
check
Access
();
check
Permission
();
if
(
l
!=
null
)
{
if
(
l
!=
null
)
{
PropertyChangeListener
listener
=
l
;
PropertyChangeListener
listener
=
l
;
synchronized
(
listenerMap
)
{
synchronized
(
listenerMap
)
{
...
@@ -793,7 +793,7 @@ public class LogManager {
...
@@ -793,7 +793,7 @@ public class LogManager {
* @exception IOException if there are IO problems reading the configuration.
* @exception IOException if there are IO problems reading the configuration.
*/
*/
public
void
readConfiguration
()
throws
IOException
,
SecurityException
{
public
void
readConfiguration
()
throws
IOException
,
SecurityException
{
check
Access
();
check
Permission
();
// if a configuration class is specified, load it and use it.
// if a configuration class is specified, load it and use it.
String
cname
=
System
.
getProperty
(
"java.util.logging.config.class"
);
String
cname
=
System
.
getProperty
(
"java.util.logging.config.class"
);
...
@@ -851,7 +851,7 @@ public class LogManager {
...
@@ -851,7 +851,7 @@ public class LogManager {
*/
*/
public
void
reset
()
throws
SecurityException
{
public
void
reset
()
throws
SecurityException
{
check
Access
();
check
Permission
();
synchronized
(
this
)
{
synchronized
(
this
)
{
props
=
new
Properties
();
props
=
new
Properties
();
// Since we are doing a reset we no longer want to initialize
// Since we are doing a reset we no longer want to initialize
...
@@ -936,7 +936,7 @@ public class LogManager {
...
@@ -936,7 +936,7 @@ public class LogManager {
* @exception IOException if there are problems reading from the stream.
* @exception IOException if there are problems reading from the stream.
*/
*/
public
void
readConfiguration
(
InputStream
ins
)
throws
IOException
,
SecurityException
{
public
void
readConfiguration
(
InputStream
ins
)
throws
IOException
,
SecurityException
{
check
Access
();
check
Permission
();
reset
();
reset
();
// Load the properties
// Load the properties
...
@@ -1113,8 +1113,13 @@ public class LogManager {
...
@@ -1113,8 +1113,13 @@ public class LogManager {
loadLoggerHandlers
(
rootLogger
,
null
,
"handlers"
);
loadLoggerHandlers
(
rootLogger
,
null
,
"handlers"
);
}
}
private
final
Permission
controlPermission
=
new
LoggingPermission
(
"control"
,
null
);
private
Permission
ourPermission
=
new
LoggingPermission
(
"control"
,
null
);
void
checkPermission
()
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
sm
.
checkPermission
(
controlPermission
);
}
/**
/**
* Check that the current context is trusted to modify the logging
* Check that the current context is trusted to modify the logging
...
@@ -1127,11 +1132,7 @@ public class LogManager {
...
@@ -1127,11 +1132,7 @@ public class LogManager {
* the caller does not have LoggingPermission("control").
* the caller does not have LoggingPermission("control").
*/
*/
public
void
checkAccess
()
throws
SecurityException
{
public
void
checkAccess
()
throws
SecurityException
{
SecurityManager
sm
=
System
.
getSecurityManager
();
checkPermission
();
if
(
sm
==
null
)
{
return
;
}
sm
.
checkPermission
(
ourPermission
);
}
}
// Nested class to represent a node in our tree of named loggers.
// Nested class to represent a node in our tree of named loggers.
...
...
src/share/classes/java/util/logging/Logger.java
浏览文件 @
6742ab21
...
@@ -276,13 +276,13 @@ public class Logger {
...
@@ -276,13 +276,13 @@ public class Logger {
this
.
manager
=
manager
;
this
.
manager
=
manager
;
}
}
private
void
check
Access
()
throws
SecurityException
{
private
void
check
Permission
()
throws
SecurityException
{
if
(!
anonymous
)
{
if
(!
anonymous
)
{
if
(
manager
==
null
)
{
if
(
manager
==
null
)
{
// Complete initialization of the global Logger.
// Complete initialization of the global Logger.
manager
=
LogManager
.
getLogManager
();
manager
=
LogManager
.
getLogManager
();
}
}
manager
.
check
Access
();
manager
.
check
Permission
();
}
}
}
}
...
@@ -482,7 +482,7 @@ public class Logger {
...
@@ -482,7 +482,7 @@ public class Logger {
* the caller does not have LoggingPermission("control").
* the caller does not have LoggingPermission("control").
*/
*/
public
void
setFilter
(
Filter
newFilter
)
throws
SecurityException
{
public
void
setFilter
(
Filter
newFilter
)
throws
SecurityException
{
check
Access
();
check
Permission
();
filter
=
newFilter
;
filter
=
newFilter
;
}
}
...
@@ -1168,7 +1168,7 @@ public class Logger {
...
@@ -1168,7 +1168,7 @@ public class Logger {
* the caller does not have LoggingPermission("control").
* the caller does not have LoggingPermission("control").
*/
*/
public
void
setLevel
(
Level
newLevel
)
throws
SecurityException
{
public
void
setLevel
(
Level
newLevel
)
throws
SecurityException
{
check
Access
();
check
Permission
();
synchronized
(
treeLock
)
{
synchronized
(
treeLock
)
{
levelObject
=
newLevel
;
levelObject
=
newLevel
;
updateEffectiveLevel
();
updateEffectiveLevel
();
...
@@ -1223,7 +1223,7 @@ public class Logger {
...
@@ -1223,7 +1223,7 @@ public class Logger {
public
void
addHandler
(
Handler
handler
)
throws
SecurityException
{
public
void
addHandler
(
Handler
handler
)
throws
SecurityException
{
// Check for null handler
// Check for null handler
handler
.
getClass
();
handler
.
getClass
();
check
Access
();
check
Permission
();
handlers
.
add
(
handler
);
handlers
.
add
(
handler
);
}
}
...
@@ -1237,7 +1237,7 @@ public class Logger {
...
@@ -1237,7 +1237,7 @@ public class Logger {
* the caller does not have LoggingPermission("control").
* the caller does not have LoggingPermission("control").
*/
*/
public
void
removeHandler
(
Handler
handler
)
throws
SecurityException
{
public
void
removeHandler
(
Handler
handler
)
throws
SecurityException
{
check
Access
();
check
Permission
();
if
(
handler
==
null
)
{
if
(
handler
==
null
)
{
return
;
return
;
}
}
...
@@ -1265,7 +1265,7 @@ public class Logger {
...
@@ -1265,7 +1265,7 @@ public class Logger {
* the caller does not have LoggingPermission("control").
* the caller does not have LoggingPermission("control").
*/
*/
public
void
setUseParentHandlers
(
boolean
useParentHandlers
)
{
public
void
setUseParentHandlers
(
boolean
useParentHandlers
)
{
check
Access
();
check
Permission
();
this
.
useParentHandlers
=
useParentHandlers
;
this
.
useParentHandlers
=
useParentHandlers
;
}
}
...
@@ -1420,7 +1420,7 @@ public class Logger {
...
@@ -1420,7 +1420,7 @@ public class Logger {
if
(
parent
==
null
)
{
if
(
parent
==
null
)
{
throw
new
NullPointerException
();
throw
new
NullPointerException
();
}
}
manager
.
check
Access
();
manager
.
check
Permission
();
doSetParent
(
parent
);
doSetParent
(
parent
);
}
}
...
...
src/share/classes/java/util/logging/MemoryHandler.java
浏览文件 @
6742ab21
...
@@ -238,7 +238,7 @@ public class MemoryHandler extends Handler {
...
@@ -238,7 +238,7 @@ public class MemoryHandler extends Handler {
throw
new
NullPointerException
();
throw
new
NullPointerException
();
}
}
LogManager
manager
=
LogManager
.
getLogManager
();
LogManager
manager
=
LogManager
.
getLogManager
();
check
Access
();
check
Permission
();
pushLevel
=
newLevel
;
pushLevel
=
newLevel
;
}
}
...
...
src/share/classes/java/util/logging/StreamHandler.java
浏览文件 @
6742ab21
...
@@ -249,7 +249,7 @@ public class StreamHandler extends Handler {
...
@@ -249,7 +249,7 @@ public class StreamHandler extends Handler {
}
}
private
synchronized
void
flushAndClose
()
throws
SecurityException
{
private
synchronized
void
flushAndClose
()
throws
SecurityException
{
check
Access
();
check
Permission
();
if
(
writer
!=
null
)
{
if
(
writer
!=
null
)
{
try
{
try
{
if
(!
doneHeader
)
{
if
(!
doneHeader
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录