You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Matt Ryall (JIRA)" <ji...@apache.org> on 2010/02/26 06:16:27 UTC

[jira] Created: (CODEC-97) Base64 default constructor behaviour changed to enable chunking in 1.4

Base64 default constructor behaviour changed to enable chunking in 1.4
----------------------------------------------------------------------

                 Key: CODEC-97
                 URL: https://issues.apache.org/jira/browse/CODEC-97
             Project: Commons Codec
          Issue Type: Bug
    Affects Versions: 1.4
            Reporter: Matt Ryall
         Attachments: Base64Test-mryall-1.patch

The following test passes in commons-codec 1.3 but fails in 1.4:

{code}
public void testObjectEncode() throws Exception {
    Base64 b64 = new Base64();
    assertEquals("SGVsbG8gV29ybGQ=", new String(b64.encode("Hello World".getBytes())));
}
{code}

Commons-codec 1.3 returns "SGVsbG8gV29ybGQ=".

Commons-codec 1.4 returns "SGVsbG8gV29ybGQ=\r\n".

I'd understand if you want to close this as "Won't Fix", since the behaviour wasn't documented before (the constructor wasn't even present!) and now it is. 

However, there is still no test for this behaviour on trunk as far as I can tell, so it would be good to add one so it doesn't change again in the future. I'll attach a patch for Base64Test which you can apply on trunk which will do so.


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


[jira] Resolved: (CODEC-97) Base64 default constructor behaviour changed to enable chunking in 1.4

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-97?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved CODEC-97.
-----------------------

    Resolution: Fixed

Applied patch with minor change (used UTF-8 encoding for getBytes() to avoid any possible problems on different charsets)

> Base64 default constructor behaviour changed to enable chunking in 1.4
> ----------------------------------------------------------------------
>
>                 Key: CODEC-97
>                 URL: https://issues.apache.org/jira/browse/CODEC-97
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Matt Ryall
>         Attachments: Base64Test-mryall-1.patch
>
>
> The following test passes in commons-codec 1.3 but fails in 1.4:
> {code}
> public void testObjectEncode() throws Exception {
>     Base64 b64 = new Base64();
>     assertEquals("SGVsbG8gV29ybGQ=", new String(b64.encode("Hello World".getBytes())));
> }
> {code}
> Commons-codec 1.3 returns "SGVsbG8gV29ybGQ=".
> Commons-codec 1.4 returns "SGVsbG8gV29ybGQ=\r\n".
> I'd understand if you want to close this as "Won't Fix", since the behaviour wasn't documented before (the constructor wasn't even present!) and now it is. 
> However, there is still no test for this behaviour on trunk as far as I can tell, so it would be good to add one so it doesn't change again in the future. I'll attach a patch for Base64Test which you can apply on trunk which will do so.

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


[jira] Updated: (CODEC-97) Base64 default constructor behaviour changed to enable chunking in 1.4

Posted by "Matt Ryall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-97?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Ryall updated CODEC-97:
----------------------------

    Attachment: Base64Test-mryall-1.patch

> Base64 default constructor behaviour changed to enable chunking in 1.4
> ----------------------------------------------------------------------
>
>                 Key: CODEC-97
>                 URL: https://issues.apache.org/jira/browse/CODEC-97
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Matt Ryall
>         Attachments: Base64Test-mryall-1.patch
>
>
> The following test passes in commons-codec 1.3 but fails in 1.4:
> {code}
> public void testObjectEncode() throws Exception {
>     Base64 b64 = new Base64();
>     assertEquals("SGVsbG8gV29ybGQ=", new String(b64.encode("Hello World".getBytes())));
> }
> {code}
> Commons-codec 1.3 returns "SGVsbG8gV29ybGQ=".
> Commons-codec 1.4 returns "SGVsbG8gV29ybGQ=\r\n".
> I'd understand if you want to close this as "Won't Fix", since the behaviour wasn't documented before (the constructor wasn't even present!) and now it is. 
> However, there is still no test for this behaviour on trunk as far as I can tell, so it would be good to add one so it doesn't change again in the future. I'll attach a patch for Base64Test which you can apply on trunk which will do so.

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


[jira] Commented: (CODEC-97) Base64 default constructor behaviour changed to enable chunking in 1.4

Posted by "Matt Ryall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850768#action_12850768 ] 

Matt Ryall commented on CODEC-97:
---------------------------------

You may want to update the other tests in the same file, Sebb, which also call getBytes() without an encoding. I drew my inspiration from them. :)

See, for example, testObjectEncodeWithValidParameter() which is just above the new test.

> Base64 default constructor behaviour changed to enable chunking in 1.4
> ----------------------------------------------------------------------
>
>                 Key: CODEC-97
>                 URL: https://issues.apache.org/jira/browse/CODEC-97
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Matt Ryall
>         Attachments: Base64Test-mryall-1.patch
>
>
> The following test passes in commons-codec 1.3 but fails in 1.4:
> {code}
> public void testObjectEncode() throws Exception {
>     Base64 b64 = new Base64();
>     assertEquals("SGVsbG8gV29ybGQ=", new String(b64.encode("Hello World".getBytes())));
> }
> {code}
> Commons-codec 1.3 returns "SGVsbG8gV29ybGQ=".
> Commons-codec 1.4 returns "SGVsbG8gV29ybGQ=\r\n".
> I'd understand if you want to close this as "Won't Fix", since the behaviour wasn't documented before (the constructor wasn't even present!) and now it is. 
> However, there is still no test for this behaviour on trunk as far as I can tell, so it would be good to add one so it doesn't change again in the future. I'll attach a patch for Base64Test which you can apply on trunk which will do so.

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