You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Amichai Rothman (JIRA)" <ji...@apache.org> on 2006/05/19 02:04:06 UTC

[jira] Updated: (FILEUPLOAD-109) MultipartStream.discardBodyData() implementation is redundant.

     [ http://issues.apache.org/jira/browse/FILEUPLOAD-109?page=all ]

Amichai Rothman updated FILEUPLOAD-109:
---------------------------------------

    Attachment: commons-fileupload-1.1-bug-109.patch

The suggested fix using NullInputStream.

> MultipartStream.discardBodyData()  implementation is redundant.
> ---------------------------------------------------------------
>
>          Key: FILEUPLOAD-109
>          URL: http://issues.apache.org/jira/browse/FILEUPLOAD-109
>      Project: Commons FileUpload
>         Type: Improvement

>     Versions: 1.1 Final
>     Reporter: Amichai Rothman
>     Priority: Minor
>  Attachments: commons-fileupload-1.1-bug-109.patch
>
> MultipartStream.discardBodyData() is identical to readBodyData() - copied and pasted, but with output removed.
> discardBodyData() can be changed to call readBodyData() with a NullInputStream (from commons io package, which is already a dependency). This is much more readable and maintainable, and much less error prone.
> (Alternatively, readBodyData() can be modified to handle a null output stream by performing a null check before writing into it, and skipping the writes if output is null. then discardBodyData() can call it with a null argument. However, the first solution seems more elegant.)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org