commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (IO-356) CharSequenceInputStream#reset() behaves incorrectly in case when buffer size is not dividable by data size
Date Wed, 24 Apr 2013 00:19:16 GMT

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

Sebb resolved IO-356.
---------------------

       Resolution: Fixed
    Fix Version/s: 2.5

URL: http://svn.apache.org/r1471209
Log:
IO-356 CharSequenceInputStream#reset() behaves incorrectly in case when buffer size is not
dividable by data size.
       Fix code so skip relates to the encoded bytes; reset now re-encodes the data up to
the point of the mark

Modified:
    commons/proper/io/trunk/src/changes/changes.xml
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java

                
> CharSequenceInputStream#reset() behaves incorrectly in case when buffer size is not dividable
by data size
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: IO-356
>                 URL: https://issues.apache.org/jira/browse/IO-356
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Streams/Writers
>    Affects Versions: 2.4
>            Reporter: Dmitry Katsubo
>             Fix For: 2.5
>
>         Attachments: CharSequenceInputStreamTest.java
>
>
> The size effect happens when buffer size of input stream is not dividable by requested
data size. The bug is hidden in {{CharSequenceInputStream#reset()}} method which should also
call (I think) {{bbuf.limit(0)}} otherwise next call to {{CharSequenceInputStream#read()}}
will return the remaining tail which {{bbuf}} has accumulated.
> In the attached test case the test fails, if {{dataSize = 13}} (not dividable by 10)
and runs OK if {{dataSize = 20}} (dividable by 10).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message