Unclear handling of null values in Component.get/setComponentOrientation

XMLWordPrintable

    • Cause Known
    • generic
    • generic

      The specifications for java.awt.Component.get/setComponentOrientation do not specify the handling of null values. There are two possibilities:
      1) setComponentOrientation throws NullPointerException when null is passed in; getComponentOrientation does not return null.
      2) setComponentOrientation accepts null, getComponentOrientation may return null.

      Currently, no exception is thrown. However, numerous callers in the J2RE assume that getComponentOrientation returns non-null values and call methods on the returned object without first checking for null. This indicates that solution 1) should be preferred.

            Assignee:
            Andrei Dmitriev (Inactive)
            Reporter:
            Norbert Lindenberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: