Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6151

Remove Java 7 close() hack in OutputStreamIndexOutput

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 6.0
    • Fix Version/s: 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      In OutputStreamIndexOutput we have the following hack:

        @Override
        public void close() throws IOException {
          try (final OutputStream o = os) {
            // We want to make sure that os.flush() was running before close:
            // BufferedOutputStream may ignore IOExceptions while flushing on close().
            // TODO: this is no longer an issue in Java 8:
            // http://hg.openjdk.java.net/jdk8/tl/jdk/rev/759aa847dcaf
            o.flush();
          }
        }
      

      As we are on Java 8 already in trunk, we can remove this hack. The bug was fixed in Java 8, BufferedOutputStream / FilterOutputStream always calls flush() and close(), although an error happened!

        Attachments

        1. LUCENE-6151.patch
          0.8 kB
          Uwe Schindler

          Issue Links

            Activity

              People

              • Assignee:
                thetaphi Uwe Schindler
                Reporter:
                thetaphi Uwe Schindler
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: