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

        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
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development