Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4513435

Ctors of java.beans.Expression does not specify null value of

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.0, 5.0
    • docs
    • b28
    • generic, sparc
    • generic, solaris_2.6

      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

      ======================================================================

            shommel Scott Hommel (Inactive)
            sdasunw Sda Sda (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: