AttachmentsSoapService getAttachmentData doesn't close inputStream

XMLWordPrintable

      AttachmentsSoapService doesn't close inputStream in getAttachmentData(long, String, int).

      (AttachmentsSoapService:108)
      FileUtils.copy(attachmentManager.getAttachmentData(attachment),baos);
      baos.close();

      There is no use in closing baos, but input stream must be closed, as it could be a file stream, for example.

      Should be something like this, I presume:
      InputStream inputStream = attachmentManager.getAttachmentData(attachment);
      FileUtils.copy(inputStream,baos);
      inputStream.close();

              Assignee:
              Christopher Owen [Atlassian]
              Reporter:
              Oleg Efimov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: