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

(spec) System.set{In,Err,Out}() doesn't indicate whether null is valid

XMLWordPrintable

    • Cause Known
    • generic
    • generic

      Name: rmT116609 Date: 08/06/2002


      FULL PRODUCT VERSION :
      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
      Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)


      A DESCRIPTION OF THE PROBLEM :
      The Javadoc-generated documentation for java.lang.System.setIn(...), java.lang.System.setOut(...), and java.lang.System.setErr(...) does not say whether the call is allowed to pass a null pointer.

      Additionally, if passing a null pointer is allowed, the documentation doesn't say what behavior the caller is allowed to expect or is not allowed to count on. (E.g., is System.err set to null, is it set to the original value, or is it set to the previous value (possibly different from the original value)?)



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

      http://java.sun.com/j2se/1.4.1/docs/api/java/lang/System.html#setErr(java.io.PrintStream)

      http://java.sun.com/j2se/1.4.1/docs/api/java/lang/System.html#setIn(java.io.InputStream)

      http://java.sun.com/j2se/1.4.1/docs/api/java/lang/System.html#setOut(java.io.PrintStream)


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      I would expect the parameter documentation either to indicate that a null value is not allowed, or to indicate that a null value is allowed and also to indicate
      what behavior the caller can expect in that case.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER WORKAROUND :
      You'd have to experiment with things. (But that only tells you what the current implementation's behavior is (and only in the environments you tested), not which behavior you can count on.)
      (Review ID: 160414)
      ======================================================================

            Unassigned Unassigned
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: