Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
3891677c
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看板
提交
3891677c
编写于
9月 20, 2011
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6268216: Boolean.getBoolean() throws SecurityException
Reviewed-by: mduigou
上级
4eaaf923
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
11 deletion
+20
-11
src/share/classes/java/lang/Boolean.java
src/share/classes/java/lang/Boolean.java
+8
-11
src/share/classes/java/lang/Integer.java
src/share/classes/java/lang/Integer.java
+6
-0
src/share/classes/java/lang/Long.java
src/share/classes/java/lang/Long.java
+6
-0
未找到文件。
src/share/classes/java/lang/Boolean.java
浏览文件 @
3891677c
/*
/*
* Copyright (c) 1994, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 20
11
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -101,7 +101,7 @@ public final class Boolean implements java.io.Serializable,
...
@@ -101,7 +101,7 @@ public final class Boolean implements java.io.Serializable,
* @param s the string to be converted to a {@code Boolean}.
* @param s the string to be converted to a {@code Boolean}.
*/
*/
public
Boolean
(
String
s
)
{
public
Boolean
(
String
s
)
{
this
(
to
Boolean
(
s
));
this
(
parse
Boolean
(
s
));
}
}
/**
/**
...
@@ -118,7 +118,7 @@ public final class Boolean implements java.io.Serializable,
...
@@ -118,7 +118,7 @@ public final class Boolean implements java.io.Serializable,
* @since 1.5
* @since 1.5
*/
*/
public
static
boolean
parseBoolean
(
String
s
)
{
public
static
boolean
parseBoolean
(
String
s
)
{
return
toBoolean
(
s
);
return
((
s
!=
null
)
&&
s
.
equalsIgnoreCase
(
"true"
)
);
}
}
/**
/**
...
@@ -159,7 +159,7 @@ public final class Boolean implements java.io.Serializable,
...
@@ -159,7 +159,7 @@ public final class Boolean implements java.io.Serializable,
* @return the {@code Boolean} value represented by the string.
* @return the {@code Boolean} value represented by the string.
*/
*/
public
static
Boolean
valueOf
(
String
s
)
{
public
static
Boolean
valueOf
(
String
s
)
{
return
to
Boolean
(
s
)
?
TRUE
:
FALSE
;
return
parse
Boolean
(
s
)
?
TRUE
:
FALSE
;
}
}
/**
/**
...
@@ -229,15 +229,16 @@ public final class Boolean implements java.io.Serializable,
...
@@ -229,15 +229,16 @@ public final class Boolean implements java.io.Serializable,
*
*
* @param name the system property name.
* @param name the system property name.
* @return the {@code boolean} value of the system property.
* @return the {@code boolean} value of the system property.
* @throws SecurityException for the same reasons as
* {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
*/
public
static
boolean
getBoolean
(
String
name
)
{
public
static
boolean
getBoolean
(
String
name
)
{
boolean
result
=
false
;
boolean
result
=
false
;
try
{
try
{
result
=
toBoolean
(
System
.
getProperty
(
name
));
result
=
parseBoolean
(
System
.
getProperty
(
name
));
}
catch
(
IllegalArgumentException
e
)
{
}
catch
(
IllegalArgumentException
|
NullPointerException
e
)
{
}
catch
(
NullPointerException
e
)
{
}
}
return
result
;
return
result
;
}
}
...
@@ -275,8 +276,4 @@ public final class Boolean implements java.io.Serializable,
...
@@ -275,8 +276,4 @@ public final class Boolean implements java.io.Serializable,
public
static
int
compare
(
boolean
x
,
boolean
y
)
{
public
static
int
compare
(
boolean
x
,
boolean
y
)
{
return
(
x
==
y
)
?
0
:
(
x
?
1
:
-
1
);
return
(
x
==
y
)
?
0
:
(
x
?
1
:
-
1
);
}
}
private
static
boolean
toBoolean
(
String
name
)
{
return
((
name
!=
null
)
&&
name
.
equalsIgnoreCase
(
"true"
));
}
}
}
src/share/classes/java/lang/Integer.java
浏览文件 @
3891677c
...
@@ -797,6 +797,8 @@ public final class Integer extends Number implements Comparable<Integer> {
...
@@ -797,6 +797,8 @@ public final class Integer extends Number implements Comparable<Integer> {
*
*
* @param nm property name.
* @param nm property name.
* @return the {@code Integer} value of the property.
* @return the {@code Integer} value of the property.
* @throws SecurityException for the same reasons as
* {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
*/
...
@@ -841,6 +843,8 @@ public final class Integer extends Number implements Comparable<Integer> {
...
@@ -841,6 +843,8 @@ public final class Integer extends Number implements Comparable<Integer> {
* @param nm property name.
* @param nm property name.
* @param val default value.
* @param val default value.
* @return the {@code Integer} value of the property.
* @return the {@code Integer} value of the property.
* @throws SecurityException for the same reasons as
* {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
*/
...
@@ -881,6 +885,8 @@ public final class Integer extends Number implements Comparable<Integer> {
...
@@ -881,6 +885,8 @@ public final class Integer extends Number implements Comparable<Integer> {
* @param nm property name.
* @param nm property name.
* @param val default value.
* @param val default value.
* @return the {@code Integer} value of the property.
* @return the {@code Integer} value of the property.
* @throws SecurityException for the same reasons as
* {@link System#getProperty(String) System.getProperty}
* @see System#getProperty(java.lang.String)
* @see System#getProperty(java.lang.String)
* @see System#getProperty(java.lang.String, java.lang.String)
* @see System#getProperty(java.lang.String, java.lang.String)
*/
*/
...
...
src/share/classes/java/lang/Long.java
浏览文件 @
3891677c
...
@@ -827,6 +827,8 @@ public final class Long extends Number implements Comparable<Long> {
...
@@ -827,6 +827,8 @@ public final class Long extends Number implements Comparable<Long> {
*
*
* @param nm property name.
* @param nm property name.
* @return the {@code Long} value of the property.
* @return the {@code Long} value of the property.
* @throws SecurityException for the same reasons as
* {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
*/
...
@@ -870,6 +872,8 @@ public final class Long extends Number implements Comparable<Long> {
...
@@ -870,6 +872,8 @@ public final class Long extends Number implements Comparable<Long> {
* @param nm property name.
* @param nm property name.
* @param val default value.
* @param val default value.
* @return the {@code Long} value of the property.
* @return the {@code Long} value of the property.
* @throws SecurityException for the same reasons as
* {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
*/
...
@@ -917,6 +921,8 @@ public final class Long extends Number implements Comparable<Long> {
...
@@ -917,6 +921,8 @@ public final class Long extends Number implements Comparable<Long> {
* @param nm property name.
* @param nm property name.
* @param val default value.
* @param val default value.
* @return the {@code Long} value of the property.
* @return the {@code Long} value of the property.
* @throws SecurityException for the same reasons as
* {@link System#getProperty(String) System.getProperty}
* @see System#getProperty(java.lang.String)
* @see System#getProperty(java.lang.String)
* @see System#getProperty(java.lang.String, java.lang.String)
* @see System#getProperty(java.lang.String, java.lang.String)
*/
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录