Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-12384

Implement and use Java 7 AutoCloseable where relevant

    XMLWordPrintable

    Details

      Description

      Java 7's AutoCloseable allows the use of the new try-with-resource pattern that automatically does a close() at the end of the try block.

      We could implement this interface in our code in a number of places, among them:

      • IterableQueryResult
      • directory Session

      Then code using these could be simplified to avoid a verbose finally block.

      We can also make use of AutoCloseable classes now available in Java 7, among them:

      • java.sql.Statement
      • InputStream, OutputStream, Reader, Writer
      • Socket

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified