java for-each loop should handle nulls cleanly.

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 15
    • Component/s: specification
    • x86_64
    • windows_10

      A DESCRIPTION OF THE PROBLEM :
      java for-each loop throws a NullPointerException when a null collection is passed in. Instead, it should act like it does for an empty collection and just exit the loop cleanly. This would reduce a lot of boilerplate code that either has to check for null values, use Optionals, or the use of third party software (eg apache.commons).


            Assignee:
            swati sharma (Inactive)
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: