Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:

      Java SE

      Description

      The API interface javax.state.Closeable raises the valid question, if the recently added java.lang.AutoCloseable interface could be extended there, too.
      The only reason not to do so, would be if strict backward-compatibility with Java 6 or earlier was desired.
      Otherwise using AutoCloseable would add value of the new Java 7 try-with-resources block being applicable to the spec.

      The only difference is, that try-with-resources requires the close() method to throw an exception, the current close() method in the interface doesn't. Not sure, if this was a big show-stopper, but the value of using some new Java 7+ functionality might justify such tweak.

      Other JSRs, though they have mostly become of the core Java package also picked up AutoCloseable, e.g. javax.sound.midi.Transmitter.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            keilw
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: