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

Remove Java 7 close() hack in OutputStreamIndexOutput

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 6.0
    • 6.0
    • None
    • None
    • 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

              uschindler Uwe Schindler
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: