Name: dsR10051 Date: 10/11/2001
Javadoc for constructors of java.beans.Expression class:
public Expression(Object target, String methodName, Object[] arguments)
public Expression(Object value, Object target, String methodName, Object[] arguments)
does not specify their behavior if arguments parameter has null value.
In this case the constructors set the arguments of expression to emply array.
It should be documented.
Here is example:
import java.beans.Expression;
public class ExpressionTest01 {
public static void main(String[] args) {
Object target = new Object();
String methodName = "hashCode";
Object[] arguments = null;
Expression expression = new Expression(target, methodName, arguments);
Object[] result = expression.getArguments();
if (result != null) {
System.out.println("expression.getArguments() returns non-null array with length " + result.length);
} else {
System.out.println("expression.getArguments() returns null");
}
}
}
--- Output ---
$ /set/jdk-builds/JDK1.4.0beta2-b81/solaris/bin/java ExpressionTest01
expression.getArguments() returns non-null array with length 0
======================================================================
Javadoc for constructors of java.beans.Expression class:
public Expression(Object target, String methodName, Object[] arguments)
public Expression(Object value, Object target, String methodName, Object[] arguments)
does not specify their behavior if arguments parameter has null value.
In this case the constructors set the arguments of expression to emply array.
It should be documented.
Here is example:
import java.beans.Expression;
public class ExpressionTest01 {
public static void main(String[] args) {
Object target = new Object();
String methodName = "hashCode";
Object[] arguments = null;
Expression expression = new Expression(target, methodName, arguments);
Object[] result = expression.getArguments();
if (result != null) {
System.out.println("expression.getArguments() returns non-null array with length " + result.length);
} else {
System.out.println("expression.getArguments() returns null");
}
}
}
--- Output ---
$ /set/jdk-builds/JDK1.4.0beta2-b81/solaris/bin/java ExpressionTest01
expression.getArguments() returns non-null array with length 0
======================================================================
- relates to
-
JDK-4512904 constructor java.beans.Statement does not specify null value of arguments array
-
- Closed
-