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

Project Coin: Allow final or effectively final variables to be used as resources in try-with-resources

XMLWordPrintable

    • b130
    • 7
    • b42
    • generic
    • generic
    • Verified

        While general expression support was outlawed for the try-with-resources statement during the developement of Java SE 7, it would be helpful to allow limited expression support in the form of final or effectively final variables. Using (effectively) final variables avoids the need to declare a dummy variable for the purpose of using the try-with-resources statement and avoid the semantic ambiguity of whether the close method should be called on the initial or final value of the variable.

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: