Karaf
  1. Karaf
  2. KARAF-1065

TextDumpProvider.createDump(DumpDestination) does not flush OutputStreamWriter

    Details

      Description

      I think there's a problem at class org.apache.karaf.diagnostic.core.common.TextDumpProvider from version 2.2.4 (and trunk). The code at method public final void createDump(DumpDestination destination) creates a new OutputStreamWriter for the OutputStream returned by the dump destination but after calling writeDump does not enforce an OutputStreamWriter's flush.

      Changing the method to something like this solves the problem:

       
          public final void createDump(DumpDestination destination) throws Exception {
              OutputStream outputStream = destination.add(name);
              OutputStreamWriter writer = new OutputStreamWriter(outputStream); 
              writeDump(writer);
              writer.close();
              outputStream.close();
          }
      

        Activity

        Andreas Pieber made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Andreas Pieber added a comment -

        Thank you very much for the report

        Committing to https://svn.apache.org/repos/asf/karaf/trunk ...
        M diagnostic/core/src/main/java/org/apache/karaf/diagnostic/core/common/TextDumpProvider.java
        Committed r1208996

        Committing to https://svn.apache.org/repos/asf/karaf/branches/karaf-2.2.x ...
        M diagnostic/core/src/main/java/org/apache/karaf/diagnostic/core/common/TextDumpProvider.java
        Committed r1208997

        Show
        Andreas Pieber added a comment - Thank you very much for the report Committing to https://svn.apache.org/repos/asf/karaf/trunk ... M diagnostic/core/src/main/java/org/apache/karaf/diagnostic/core/common/TextDumpProvider.java Committed r1208996 Committing to https://svn.apache.org/repos/asf/karaf/branches/karaf-2.2.x ... M diagnostic/core/src/main/java/org/apache/karaf/diagnostic/core/common/TextDumpProvider.java Committed r1208997
        Andreas Pieber made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Andreas Pieber made changes -
        Field Original Value New Value
        Assignee Andreas Pieber [ pieber ]
        Fix Version/s 2.2.5 [ 12317857 ]
        Fix Version/s 3.0.0 [ 12316040 ]
        Affects Version/s 3.0.0 [ 12316040 ]
        Hide
        Andreas Pieber added a comment -

        Looks pretty fine to me; I'll change this.

        Show
        Andreas Pieber added a comment - Looks pretty fine to me; I'll change this.
        Enrico Pizzorno created issue -

          People

          • Assignee:
            Andreas Pieber
            Reporter:
            Enrico Pizzorno
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development