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

Project Coin: improvements to try-with-resources desugaring

XMLWordPrintable

    • b116
    • generic
    • generic
    • Verified

      Various improvements to the javac implementation of the try-with-resources desugaring have been suggested:

      1) Generate a per-class helper method to encapsulate the if-primary-exception not-null... logic of the synthesized finally block. (Unfortunately, such code cannot be shared in a common library method because the more precise exception information cannot be captured in the method's signature.)

      2) From coin-dev ( http://mail.openjdk.java.net/pipermail/coin-dev/2011-February/003079.html ), omit the null-check on a resource if the resource is initialized with a constructor call since constructors cannot return null.

      These should be considered in the future.

            jlahoda Jan Lahoda
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: