You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Mukundha Madhavan (JIRA)" <ji...@apache.org> on 2010/10/12 18:54:40 UTC

[jira] Updated: (CAMEL-3223) GenericFileProducer.writeFile method creates instance of un-used InputStream

     [ https://issues.apache.org/activemq/browse/CAMEL-3223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mukundha Madhavan updated CAMEL-3223:
-------------------------------------

    Attachment: patch.txt

Fix for Issue CAMEL-3223: GenericFileProducer.writeFile method creates instance of un-used InputStream
* src\main\java\org\apache\camel\component\file\GenericFileProducer.java
   writeFile(): Removed the InputStream variable initialization

Patch by: Mukundha Madhavan

> GenericFileProducer.writeFile method creates instance of un-used InputStream
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-3223
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3223
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>         Environment: Not significant, can be reproduced agnostic of any environment
>            Reporter: Madhav Bhargava
>            Priority: Minor
>         Attachments: patch.txt
>
>
> org.apache.camel.component.file.GenericFileProducer
> Method: writeFile
> This method has the following statement:
> InputStream payload = exchange.getIn().getBody(InputStream.class);
> This internally results in calling a TypeConverter to convert an object into InputStream type. However this InputStream has not been used and is eventually closed in the finally block. 
> In the same method calling method storeFile on FileOperations (boolean success = operations.storeFile(fileName, exchange);) also opens an InputStream on the same message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.