Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
a858d565
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a858d565
编写于
1月 21, 2010
作者:
M
malenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4922835: DOC: Statement javadoc should indicate that target and methodName cannot be null
Reviewed-by: peterz
上级
3694a07c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
63 addition
and
29 deletion
+63
-29
jdk/src/share/classes/java/beans/Expression.java
jdk/src/share/classes/java/beans/Expression.java
+29
-15
jdk/src/share/classes/java/beans/Statement.java
jdk/src/share/classes/java/beans/Statement.java
+34
-14
未找到文件。
jdk/src/share/classes/java/beans/Expression.java
浏览文件 @
a858d565
/*
* Copyright 2000-20
07
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-20
10
Sun Microsystems, Inc. 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
...
...
@@ -51,12 +51,19 @@ public class Expression extends Statement {
private
Object
value
=
unbound
;
/**
* Creates a new <code>Statement</code> object with a <code>target</code>,
* <code>methodName</code> and <code>arguments</code> as per the parameters.
* Creates a new {@link Expression} object
* for the specified target object to invoke the method
* specified by the name and by the array of arguments.
* <p>
* The {@code target} and the {@code methodName} values should not be {@code null}.
* Otherwise an attempt to execute this {@code Expression}
* will result in a {@code NullPointerException}.
* If the {@code arguments} value is {@code null},
* an empty array is used as the value of the {@code arguments} property.
*
* @param target
The target of this expression.
* @param methodName
The methodName of this expression.
* @param arguments
The arguments of this expression. If <code>null</code> then an empty array will be used.
* @param target
the target object of this expression
* @param methodName
the name of the method to invoke on the specified target
* @param arguments
the array of arguments to invoke the specified method
*
* @see #getValue
*/
...
...
@@ -66,16 +73,23 @@ public class Expression extends Statement {
}
/**
* Creates a new <code>Expression</code> object for a method
* that returns a result. The result will never be calculated
* however, since this constructor uses the <code>value</code>
* parameter to set the value property by calling the
* <code>setValue</code> method.
* Creates a new {@link Expression} object with the specified value
* for the specified target object to invoke the method
* specified by the name and by the array of arguments.
* The {@code value} value is used as the value of the {@code value} property,
* so the {@link #getValue} method will return it
* without executing this {@code Expression}.
* <p>
* The {@code target} and the {@code methodName} values should not be {@code null}.
* Otherwise an attempt to execute this {@code Expression}
* will result in a {@code NullPointerException}.
* If the {@code arguments} value is {@code null},
* an empty array is used as the value of the {@code arguments} property.
*
* @param value
The value of this expression.
* @param target
The target of this expression.
* @param methodName
The methodName of this expression.
* @param arguments
The arguments of this expression. If <code>null</code> then an empty array will be used.
* @param value
the value of this expression
* @param target
the target object of this expression
* @param methodName
the name of the method to invoke on the specified target
* @param arguments
the array of arguments to invoke the specified method
*
* @see #setValue
*/
...
...
jdk/src/share/classes/java/beans/Statement.java
浏览文件 @
a858d565
/*
* Copyright 2000-20
09
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-20
10
Sun Microsystems, Inc. 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
...
...
@@ -69,13 +69,19 @@ public class Statement {
ClassLoader
loader
;
/**
* Creates a new <code>Statement</code> object with a <code>target</code>,
* <code>methodName</code> and <code>arguments</code> as per the parameters.
*
* @param target The target of this statement.
* @param methodName The methodName of this statement.
* @param arguments The arguments of this statement. If <code>null</code> then an empty array will be used.
* Creates a new {@link Statement} object
* for the specified target object to invoke the method
* specified by the name and by the array of arguments.
* <p>
* The {@code target} and the {@code methodName} values should not be {@code null}.
* Otherwise an attempt to execute this {@code Expression}
* will result in a {@code NullPointerException}.
* If the {@code arguments} value is {@code null},
* an empty array is used as the value of the {@code arguments} property.
*
* @param target the target object of this statement
* @param methodName the name of the method to invoke on the specified target
* @param arguments the array of arguments to invoke the specified method
*/
@ConstructorProperties
({
"target"
,
"methodName"
,
"arguments"
})
public
Statement
(
Object
target
,
String
methodName
,
Object
[]
arguments
)
{
...
...
@@ -85,27 +91,36 @@ public class Statement {
}
/**
* Returns the target of this statement.
* Returns the target object of this statement.
* If this method returns {@code null},
* the {@link #execute} method
* throws a {@code NullPointerException}.
*
* @return
The target of this statement.
* @return
the target object of this statement
*/
public
Object
getTarget
()
{
return
target
;
}
/**
* Returns the name of the method.
* Returns the name of the method to invoke.
* If this method returns {@code null},
* the {@link #execute} method
* throws a {@code NullPointerException}.
*
* @return
The name of the method.
* @return
the name of the method
*/
public
String
getMethodName
()
{
return
methodName
;
}
/**
* Returns the arguments of this statement.
* Returns the arguments for the method to invoke.
* The number of arguments and their types
* must match the method being called.
* {@code null} can be used as a synonym of an empty array.
*
* @return the ar
guments of this statement.
* @return the ar
ray of arguments
*/
public
Object
[]
getArguments
()
{
return
arguments
;
...
...
@@ -154,6 +169,9 @@ public class Statement {
}
Object
[]
arguments
=
getArguments
();
if
(
arguments
==
null
)
{
arguments
=
emptyArray
;
}
// Class.forName() won't load classes outside
// of core from a class inside core. Special
// case this method.
...
...
@@ -285,7 +303,9 @@ public class Statement {
Object
target
=
getTarget
();
String
methodName
=
getMethodName
();
Object
[]
arguments
=
getArguments
();
if
(
arguments
==
null
)
{
arguments
=
emptyArray
;
}
StringBuffer
result
=
new
StringBuffer
(
instanceName
(
target
)
+
"."
+
methodName
+
"("
);
int
n
=
arguments
.
length
;
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录