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

Proposing Optional chaining

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      Proposal for an optional chaining operator "?". When used, it would short circuit the evaluation of a chain and return null. For example.
      String name = cart?.getShippingAddress()?.getName();
      In this case if cart is null or getShippingAddress() is null, name would be null and the rest of the chain would not be evaluated.


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: