Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1242

CommitHeaderOutputStream may invoke headers.commit() several times

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.1.0.CR1, 3.0.20.Final
    • 3.0.14.Final
    • None
    • None

      Field

         protected boolean isHeadersCommitted;
      

      should be declared as volatile to ensure that

         public void commit()
         {
            if (isHeadersCommitted) return;
            isHeadersCommitted = true;
            headers.commit();
         }
      

      works as intended also if called by different threads.

      There are JDK classes which decorate/adapt OutputStreams which invokes OutputStream.close() in the finalize() method (e.g. javax.imageio.stream.MemoryCacheImageOutputStream ). Such classes cannot be (easily) used by Entity Providers without such fix.

              rsigal@redhat.com Ronald Sigal
              gunterze Gunter Zeilinger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: