Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
5f587cdd
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看板
提交
5f587cdd
编写于
8月 15, 2011
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4850225: Integer.getInteger() : Bad reference to getProperty?
Reviewed-by: lancea
上级
88504796
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
47 deletion
+38
-47
src/share/classes/java/lang/Integer.java
src/share/classes/java/lang/Integer.java
+18
-21
src/share/classes/java/lang/Long.java
src/share/classes/java/lang/Long.java
+20
-26
未找到文件。
src/share/classes/java/lang/Integer.java
浏览文件 @
5f587cdd
...
...
@@ -776,17 +776,17 @@ public final class Integer extends Number implements Comparable<Integer> {
* Determines the integer value of the system property with the
* specified name.
*
* <p>The first argument is treated as the name of a system
property.
*
System properties are accessible through the
*
{@link
java.lang.System#getProperty(java.lang.String)} method. The
* <p>The first argument is treated as the name of a system
*
property. System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
* string value of this property is then interpreted as an integer
* value and an {@code Integer} object representing this value is
* returned. Details of possible numeric formats can be found with
* the definition of {@code getProperty}.
* value using the grammar supported by {@link Integer#decode decode} and
* an {@code Integer} object representing this value is returned.
*
* <p>If there is no property with the specified name, if the specified name
* is empty or {@code null}, or if the property does not have
* the correct numeric format, then {@code null} is returned.
* <p>If there is no property with the specified name, if the
* specified name is empty or {@code null}, or if the property
* does not have the correct numeric format, then {@code null} is
* returned.
*
* <p>In other words, this method returns an {@code Integer}
* object equal to the value of:
...
...
@@ -808,13 +808,12 @@ public final class Integer extends Number implements Comparable<Integer> {
* Determines the integer value of the system property with the
* specified name.
*
* <p>The first argument is treated as the name of a system
property.
* System properties are accessible through the {@link
* <p>The first argument is treated as the name of a system
*
property.
System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
* string value of this property is then interpreted as an integer
* value and an {@code Integer} object representing this value is
* returned. Details of possible numeric formats can be found with
* the definition of {@code getProperty}.
* value using the grammar supported by {@link Integer#decode decode} and
* an {@code Integer} object representing this value is returned.
*
* <p>The second argument is the default value. An {@code Integer} object
* that represents the value of the second argument is returned if there
...
...
@@ -856,9 +855,9 @@ public final class Integer extends Number implements Comparable<Integer> {
* system property. System properties are accessible through the
* {@link java.lang.System#getProperty(java.lang.String)} method.
* The string value of this property is then interpreted as an
* integer value, as per the {@
code Integer.
decode} method,
* integer value, as per the {@
link Integer#decode
decode} method,
* and an {@code Integer} object representing this value is
* returned
.
* returned
; in summary:
*
* <ul><li>If the property value begins with the two ASCII characters
* {@code 0x} or the ASCII character {@code #}, not
...
...
@@ -882,16 +881,14 @@ public final class Integer extends Number implements Comparable<Integer> {
* @param nm property name.
* @param val default value.
* @return the {@code Integer} value of the property.
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
* @see java.lang.Integer#decode
* @see System#getProperty(java.lang.String)
* @see System#getProperty(java.lang.String, java.lang.String)
*/
public
static
Integer
getInteger
(
String
nm
,
Integer
val
)
{
String
v
=
null
;
try
{
v
=
System
.
getProperty
(
nm
);
}
catch
(
IllegalArgumentException
e
)
{
}
catch
(
NullPointerException
e
)
{
}
catch
(
IllegalArgumentException
|
NullPointerException
e
)
{
}
if
(
v
!=
null
)
{
try
{
...
...
src/share/classes/java/lang/Long.java
浏览文件 @
5f587cdd
...
...
@@ -806,22 +806,20 @@ public final class Long extends Number implements Comparable<Long> {
* Determines the {@code long} value of the system property
* with the specified name.
*
* <p>The first argument is treated as the name of a system
property.
* System properties are accessible through the {@link
* <p>The first argument is treated as the name of a system
*
property.
System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
* string value of this property is then interpreted as a
* {@code long} value and a {@code Long} object
* representing this value is returned. Details of possible
* numeric formats can be found with the definition of
* {@code getProperty}.
* string value of this property is then interpreted as a {@code
* long} value using the grammar supported by {@link Long#decode decode}
* and a {@code Long} object representing this value is returned.
*
* <p>If there is no property with the specified name, if the
* specified name is empty or {@code null}, or if the
*
property does not have the correct numeric format, then
*
{@code null} is
returned.
* specified name is empty or {@code null}, or if the
property
*
does not have the correct numeric format, then {@code null} is
* returned.
*
* <p>In other words, this method returns a {@code Long} object
equal to
* the value of:
* <p>In other words, this method returns a {@code Long} object
*
equal to
the value of:
*
* <blockquote>
* {@code getLong(nm, null)}
...
...
@@ -840,14 +838,12 @@ public final class Long extends Number implements Comparable<Long> {
* Determines the {@code long} value of the system property
* with the specified name.
*
* <p>The first argument is treated as the name of a system
property.
* System properties are accessible through the {@link
* <p>The first argument is treated as the name of a system
*
property.
System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
* string value of this property is then interpreted as a
* {@code long} value and a {@code Long} object
* representing this value is returned. Details of possible
* numeric formats can be found with the definition of
* {@code getProperty}.
* string value of this property is then interpreted as a {@code
* long} value using the grammar supported by {@link Long#decode decode}
* and a {@code Long} object representing this value is returned.
*
* <p>The second argument is the default value. A {@code Long} object
* that represents the value of the second argument is returned if there
...
...
@@ -889,8 +885,8 @@ public final class Long extends Number implements Comparable<Long> {
* the {@link java.lang.System#getProperty(java.lang.String)}
* method. The string value of this property is then interpreted
* as a {@code long} value, as per the
* {@
code Long.
decode} method, and a {@code Long} object
* representing this value is returned
.
* {@
link Long#decode
decode} method, and a {@code Long} object
* representing this value is returned
; in summary:
*
* <ul>
* <li>If the property value begins with the two ASCII characters
...
...
@@ -921,16 +917,14 @@ public final class Long extends Number implements Comparable<Long> {
* @param nm property name.
* @param val default value.
* @return the {@code Long} value of the property.
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
* @see java.lang.Long#decode
* @see System#getProperty(java.lang.String)
* @see System#getProperty(java.lang.String, java.lang.String)
*/
public
static
Long
getLong
(
String
nm
,
Long
val
)
{
String
v
=
null
;
try
{
v
=
System
.
getProperty
(
nm
);
}
catch
(
IllegalArgumentException
e
)
{
}
catch
(
NullPointerException
e
)
{
}
catch
(
IllegalArgumentException
|
NullPointerException
e
)
{
}
if
(
v
!=
null
)
{
try
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录