Uploaded image for project: '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();
          }
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: