You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2013/03/19 14:08:51 UTC

svn commit: r1458266 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java

Author: simonetripodi
Date: Tue Mar 19 13:08:50 2013
New Revision: 1458266

URL: http://svn.apache.org/r1458266
Log:
added a test where the encoded input string has the padding char in the middle; contrary to commons-codec, it doesn't halt and continues translating

Modified:
    commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java

Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java?rev=1458266&r1=1458265&r2=1458266&view=diff
==============================================================================
Files commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java (original) and commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Tue Mar 19 13:08:50 2013 differ



Re: svn commit: r1458266 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java

Posted by sebb <se...@gmail.com>.
Turns out the problem was caused by a NUL in the string in
decodeWithInnerPad() - diff then treats the file as binary.

Replaced with \0 for now.


On 19 March 2013 20:02, sebb <se...@gmail.com> wrote:
> On 19 March 2013 19:16, sebb <se...@gmail.com> wrote:
>> On 19 March 2013 18:52, Simone Tripodi <si...@apache.org> wrote:
>>> 3 commits? :O
>>
>> This one, and:
>>
>> r1458269
>> http://mail-archives.apache.org/mod_mbox/commons-commits/201303.mbox/%3C20130319132232.8ABD023888EA%40eris.apache.org%3E
>>
>> and
>>
>> r1458277
>> http://mail-archives.apache.org/mod_mbox/commons-commits/201303.mbox/%3C20130319130851.503092388906%40eris.apache.org%3E
>
> Sorry, that link was for r1458266; the correct link is
>
> http://mail-archives.apache.org/mod_mbox/commons-commits/201303.mbox/%3C20130319134309.BCF7323888EA%40eris.apache.org%3E
>> have the same problem.
>>
>> I'll raise it with infra.
>>
>>> sorry, I have no clue, svn history shows that only once...
>>>
>>> -Simo
>>>
>>>
>>> stripodi$ svn log
>>> ------------------------------------------------------------------------
>>> r1458278 | simonetripodi | 2013-03-19 14:44:37 +0100 (Tue, 19 Mar 2013) | 1 line
>>>
>>> [FILEUPLOAD-232] initial checkin of QuotedPrintableDecoderTestCase class
>>> ------------------------------------------------------------------------
>>> r1458277 | simonetripodi | 2013-03-19 14:43:09 +0100 (Tue, 19 Mar 2013) | 1 line
>>>
>>> aligned issue documentation reference to @see tag
>>> ------------------------------------------------------------------------
>>> r1458269 | simonetripodi | 2013-03-19 14:22:32 +0100 (Tue, 19 Mar 2013) | 1 line
>>>
>>> added a test to see how this Base64 decoder impl behaves compared to
>>> https://issues.apache.org/jira/browse/CODEC-68
>>> ------------------------------------------------------------------------
>>> r1458266 | simonetripodi | 2013-03-19 14:08:50 +0100 (Tue, 19 Mar 2013) | 1 line
>>>
>>> added a test where the encoded input string has the padding char in
>>> the middle; contrary to commons-codec, it doesn't halt and continues
>>> translating
>>> ------------------------------------------------------------------------
>>> r1458245 | simonetripodi | 2013-03-19 13:30:02 +0100 (Tue, 19 Mar 2013) | 1 line
>>>
>>> no needs to specify always the offset and the length of the byte[] has
>>> to be decoded, since in this implementation there's always the need to
>>> decode the whole buffer
>>> ------------------------------------------------------------------------
>>> r1458240 | sebb | 2013-03-19 13:18:39 +0100 (Tue, 19 Mar 2013) | 3 lines
>>>
>>> FILEUPLOAD-233 Base64Decoder doesn't correctly implement RFC 4648
>>> Oops, initial rework of code was wrong.
>>> Re-enabled failing tests
>>> ------------------------------------------------------------------------
>>> r1458236 | simonetripodi | 2013-03-19 12:56:27 +0100 (Tue, 19 Mar 2013) | 1 line
>>>
>>> [FILEUPLOAD-233] fixed and re-enabled the test case where an empty
>>> string doesn't need to be decoded
>>> ------------------------------------------------------------------------
>>> r1458220 | markt | 2013-03-19 11:56:17 +0100 (Tue, 19 Mar 2013) | 3 lines
>>>
>>> There needs to be the same number of place-holders as there are replacements.
>>> Fixes an issue introduced in r1453239.
>>> Identified by FindBugs running against the Tomcat code base (which has
>>> a package renamed copy of FileUpload).
>>> ------------------------------------------------------------------------
>>> r1458213 | simonetripodi | 2013-03-19 11:37:37 +0100 (Tue, 19 Mar 2013) | 1 line
>>>
>>> initial checkin of Base64 Decoder test case, which clearly demonstrate
>>> the current Base64 implementation is broken
>>> ------------------------------------------------------------------------
>>> r1458210 | simonetripodi | 2013-03-19 11:21:19 +0100 (Tue, 19 Mar 2013) | 1 line
>>>
>>> extracted and documented constants that are used inside each algorithm iteration
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://simonetripodi.livejournal.com/
>>> http://twitter.com/simonetripodi
>>> http://www.99soft.org/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>

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


Re: svn commit: r1458266 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java

Posted by sebb <se...@gmail.com>.
On 19 March 2013 19:16, sebb <se...@gmail.com> wrote:
> On 19 March 2013 18:52, Simone Tripodi <si...@apache.org> wrote:
>> 3 commits? :O
>
> This one, and:
>
> r1458269
> http://mail-archives.apache.org/mod_mbox/commons-commits/201303.mbox/%3C20130319132232.8ABD023888EA%40eris.apache.org%3E
>
> and
>
> r1458277
> http://mail-archives.apache.org/mod_mbox/commons-commits/201303.mbox/%3C20130319130851.503092388906%40eris.apache.org%3E

Sorry, that link was for r1458266; the correct link is

http://mail-archives.apache.org/mod_mbox/commons-commits/201303.mbox/%3C20130319134309.BCF7323888EA%40eris.apache.org%3E
> have the same problem.
>
> I'll raise it with infra.
>
>> sorry, I have no clue, svn history shows that only once...
>>
>> -Simo
>>
>>
>> stripodi$ svn log
>> ------------------------------------------------------------------------
>> r1458278 | simonetripodi | 2013-03-19 14:44:37 +0100 (Tue, 19 Mar 2013) | 1 line
>>
>> [FILEUPLOAD-232] initial checkin of QuotedPrintableDecoderTestCase class
>> ------------------------------------------------------------------------
>> r1458277 | simonetripodi | 2013-03-19 14:43:09 +0100 (Tue, 19 Mar 2013) | 1 line
>>
>> aligned issue documentation reference to @see tag
>> ------------------------------------------------------------------------
>> r1458269 | simonetripodi | 2013-03-19 14:22:32 +0100 (Tue, 19 Mar 2013) | 1 line
>>
>> added a test to see how this Base64 decoder impl behaves compared to
>> https://issues.apache.org/jira/browse/CODEC-68
>> ------------------------------------------------------------------------
>> r1458266 | simonetripodi | 2013-03-19 14:08:50 +0100 (Tue, 19 Mar 2013) | 1 line
>>
>> added a test where the encoded input string has the padding char in
>> the middle; contrary to commons-codec, it doesn't halt and continues
>> translating
>> ------------------------------------------------------------------------
>> r1458245 | simonetripodi | 2013-03-19 13:30:02 +0100 (Tue, 19 Mar 2013) | 1 line
>>
>> no needs to specify always the offset and the length of the byte[] has
>> to be decoded, since in this implementation there's always the need to
>> decode the whole buffer
>> ------------------------------------------------------------------------
>> r1458240 | sebb | 2013-03-19 13:18:39 +0100 (Tue, 19 Mar 2013) | 3 lines
>>
>> FILEUPLOAD-233 Base64Decoder doesn't correctly implement RFC 4648
>> Oops, initial rework of code was wrong.
>> Re-enabled failing tests
>> ------------------------------------------------------------------------
>> r1458236 | simonetripodi | 2013-03-19 12:56:27 +0100 (Tue, 19 Mar 2013) | 1 line
>>
>> [FILEUPLOAD-233] fixed and re-enabled the test case where an empty
>> string doesn't need to be decoded
>> ------------------------------------------------------------------------
>> r1458220 | markt | 2013-03-19 11:56:17 +0100 (Tue, 19 Mar 2013) | 3 lines
>>
>> There needs to be the same number of place-holders as there are replacements.
>> Fixes an issue introduced in r1453239.
>> Identified by FindBugs running against the Tomcat code base (which has
>> a package renamed copy of FileUpload).
>> ------------------------------------------------------------------------
>> r1458213 | simonetripodi | 2013-03-19 11:37:37 +0100 (Tue, 19 Mar 2013) | 1 line
>>
>> initial checkin of Base64 Decoder test case, which clearly demonstrate
>> the current Base64 implementation is broken
>> ------------------------------------------------------------------------
>> r1458210 | simonetripodi | 2013-03-19 11:21:19 +0100 (Tue, 19 Mar 2013) | 1 line
>>
>> extracted and documented constants that are used inside each algorithm iteration
>>
>> http://people.apache.org/~simonetripodi/
>> http://simonetripodi.livejournal.com/
>> http://twitter.com/simonetripodi
>> http://www.99soft.org/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>

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


Re: svn commit: r1458266 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java

Posted by sebb <se...@gmail.com>.
On 19 March 2013 18:52, Simone Tripodi <si...@apache.org> wrote:
> 3 commits? :O

This one, and:

r1458269
http://mail-archives.apache.org/mod_mbox/commons-commits/201303.mbox/%3C20130319132232.8ABD023888EA%40eris.apache.org%3E

and

r1458277
http://mail-archives.apache.org/mod_mbox/commons-commits/201303.mbox/%3C20130319130851.503092388906%40eris.apache.org%3E

have the same problem.

I'll raise it with infra.

> sorry, I have no clue, svn history shows that only once...
>
> -Simo
>
>
> stripodi$ svn log
> ------------------------------------------------------------------------
> r1458278 | simonetripodi | 2013-03-19 14:44:37 +0100 (Tue, 19 Mar 2013) | 1 line
>
> [FILEUPLOAD-232] initial checkin of QuotedPrintableDecoderTestCase class
> ------------------------------------------------------------------------
> r1458277 | simonetripodi | 2013-03-19 14:43:09 +0100 (Tue, 19 Mar 2013) | 1 line
>
> aligned issue documentation reference to @see tag
> ------------------------------------------------------------------------
> r1458269 | simonetripodi | 2013-03-19 14:22:32 +0100 (Tue, 19 Mar 2013) | 1 line
>
> added a test to see how this Base64 decoder impl behaves compared to
> https://issues.apache.org/jira/browse/CODEC-68
> ------------------------------------------------------------------------
> r1458266 | simonetripodi | 2013-03-19 14:08:50 +0100 (Tue, 19 Mar 2013) | 1 line
>
> added a test where the encoded input string has the padding char in
> the middle; contrary to commons-codec, it doesn't halt and continues
> translating
> ------------------------------------------------------------------------
> r1458245 | simonetripodi | 2013-03-19 13:30:02 +0100 (Tue, 19 Mar 2013) | 1 line
>
> no needs to specify always the offset and the length of the byte[] has
> to be decoded, since in this implementation there's always the need to
> decode the whole buffer
> ------------------------------------------------------------------------
> r1458240 | sebb | 2013-03-19 13:18:39 +0100 (Tue, 19 Mar 2013) | 3 lines
>
> FILEUPLOAD-233 Base64Decoder doesn't correctly implement RFC 4648
> Oops, initial rework of code was wrong.
> Re-enabled failing tests
> ------------------------------------------------------------------------
> r1458236 | simonetripodi | 2013-03-19 12:56:27 +0100 (Tue, 19 Mar 2013) | 1 line
>
> [FILEUPLOAD-233] fixed and re-enabled the test case where an empty
> string doesn't need to be decoded
> ------------------------------------------------------------------------
> r1458220 | markt | 2013-03-19 11:56:17 +0100 (Tue, 19 Mar 2013) | 3 lines
>
> There needs to be the same number of place-holders as there are replacements.
> Fixes an issue introduced in r1453239.
> Identified by FindBugs running against the Tomcat code base (which has
> a package renamed copy of FileUpload).
> ------------------------------------------------------------------------
> r1458213 | simonetripodi | 2013-03-19 11:37:37 +0100 (Tue, 19 Mar 2013) | 1 line
>
> initial checkin of Base64 Decoder test case, which clearly demonstrate
> the current Base64 implementation is broken
> ------------------------------------------------------------------------
> r1458210 | simonetripodi | 2013-03-19 11:21:19 +0100 (Tue, 19 Mar 2013) | 1 line
>
> extracted and documented constants that are used inside each algorithm iteration
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

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


Re: svn commit: r1458266 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java

Posted by Simone Tripodi <si...@apache.org>.
3 commits? :O

sorry, I have no clue, svn history shows that only once...

-Simo


stripodi$ svn log
------------------------------------------------------------------------
r1458278 | simonetripodi | 2013-03-19 14:44:37 +0100 (Tue, 19 Mar 2013) | 1 line

[FILEUPLOAD-232] initial checkin of QuotedPrintableDecoderTestCase class
------------------------------------------------------------------------
r1458277 | simonetripodi | 2013-03-19 14:43:09 +0100 (Tue, 19 Mar 2013) | 1 line

aligned issue documentation reference to @see tag
------------------------------------------------------------------------
r1458269 | simonetripodi | 2013-03-19 14:22:32 +0100 (Tue, 19 Mar 2013) | 1 line

added a test to see how this Base64 decoder impl behaves compared to
https://issues.apache.org/jira/browse/CODEC-68
------------------------------------------------------------------------
r1458266 | simonetripodi | 2013-03-19 14:08:50 +0100 (Tue, 19 Mar 2013) | 1 line

added a test where the encoded input string has the padding char in
the middle; contrary to commons-codec, it doesn't halt and continues
translating
------------------------------------------------------------------------
r1458245 | simonetripodi | 2013-03-19 13:30:02 +0100 (Tue, 19 Mar 2013) | 1 line

no needs to specify always the offset and the length of the byte[] has
to be decoded, since in this implementation there's always the need to
decode the whole buffer
------------------------------------------------------------------------
r1458240 | sebb | 2013-03-19 13:18:39 +0100 (Tue, 19 Mar 2013) | 3 lines

FILEUPLOAD-233 Base64Decoder doesn't correctly implement RFC 4648
Oops, initial rework of code was wrong.
Re-enabled failing tests
------------------------------------------------------------------------
r1458236 | simonetripodi | 2013-03-19 12:56:27 +0100 (Tue, 19 Mar 2013) | 1 line

[FILEUPLOAD-233] fixed and re-enabled the test case where an empty
string doesn't need to be decoded
------------------------------------------------------------------------
r1458220 | markt | 2013-03-19 11:56:17 +0100 (Tue, 19 Mar 2013) | 3 lines

There needs to be the same number of place-holders as there are replacements.
Fixes an issue introduced in r1453239.
Identified by FindBugs running against the Tomcat code base (which has
a package renamed copy of FileUpload).
------------------------------------------------------------------------
r1458213 | simonetripodi | 2013-03-19 11:37:37 +0100 (Tue, 19 Mar 2013) | 1 line

initial checkin of Base64 Decoder test case, which clearly demonstrate
the current Base64 implementation is broken
------------------------------------------------------------------------
r1458210 | simonetripodi | 2013-03-19 11:21:19 +0100 (Tue, 19 Mar 2013) | 1 line

extracted and documented constants that are used inside each algorithm iteration

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

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


Re: svn commit: r1458266 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java

Posted by sebb <se...@gmail.com>.
On 19 March 2013 13:08,  <si...@apache.org> wrote:
> Author: simonetripodi
> Date: Tue Mar 19 13:08:50 2013
> New Revision: 1458266
>
> URL: http://svn.apache.org/r1458266
> Log:
> added a test where the encoded input string has the padding char in the middle; contrary to commons-codec, it doesn't halt and continues translating
>
> Modified:
>     commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
>
> Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
> URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java?rev=1458266&r1=1458265&r2=1458266&view=diff
> ==============================================================================
> Files commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java (original) and commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Tue Mar 19 13:08:50 2013 differ
>

No difference is shown here, odd.

There were 3 commits like this from you - did you do anything
different for those 3?
Or maybe someone was playing with the difference generation script and
you were just unlucky.

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