You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Peter Oxenham (JIRA)" <ji...@apache.org> on 2008/02/13 05:24:08 UTC

[jira] Created: (LANG-412) StrBuilder appendFixedWidth does not handle nulls

StrBuilder appendFixedWidth does not handle nulls
-------------------------------------------------

                 Key: LANG-412
                 URL: https://issues.apache.org/jira/browse/LANG-412
             Project: Commons Lang
          Issue Type: Bug
    Affects Versions: 2.3
         Environment: Java  1.5
            Reporter: Peter Oxenham


Appending a null value with fixed width causes a null pointer exception if getNullText() has not been set.

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


[jira] Closed: (LANG-412) StrBuilder appendFixedWidth does not handle nulls

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

Henri Yandell closed LANG-412.
------------------------------

    Resolution: Fixed

svn ci -m "Applying my patch from LANG-412; fixing Peter Oxenham's report that the appendFixedWidthPadRight and appendFixedWidthPadLeft are not null safe if the nullText has not been set" src

Sending        src/java/org/apache/commons/lang/text/StrBuilder.java
Sending        src/test/org/apache/commons/lang/text/StrBuilderTest.java
Transmitting file data ..
Committed revision 627248.

> StrBuilder appendFixedWidth does not handle nulls
> -------------------------------------------------
>
>                 Key: LANG-412
>                 URL: https://issues.apache.org/jira/browse/LANG-412
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: Java  1.5
>            Reporter: Peter Oxenham
>             Fix For: 2.4
>
>         Attachments: LANG-412.patch
>
>
> Appending a null value with fixed width causes a null pointer exception if getNullText() has not been set.

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


[jira] Commented: (LANG-412) StrBuilder appendFixedWidth does not handle nulls

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568433#action_12568433 ] 

Henri Yandell commented on LANG-412:
------------------------------------

Confirmed (visually). As appendNull's effect is to do nothing if it is set to null, my assumption is that having nullText be null is merely an optmization for the empty String.

So I think the solution will be to make the fixed width methods use an empty string if they get back a null nullText.

> StrBuilder appendFixedWidth does not handle nulls
> -------------------------------------------------
>
>                 Key: LANG-412
>                 URL: https://issues.apache.org/jira/browse/LANG-412
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: Java  1.5
>            Reporter: Peter Oxenham
>             Fix For: 2.4
>
>
> Appending a null value with fixed width causes a null pointer exception if getNullText() has not been set.

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


[jira] Updated: (LANG-412) StrBuilder appendFixedWidth does not handle nulls

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

Henri Yandell updated LANG-412:
-------------------------------

    Attachment: LANG-412.patch

Attaching tests and a fix (null -> "").

> StrBuilder appendFixedWidth does not handle nulls
> -------------------------------------------------
>
>                 Key: LANG-412
>                 URL: https://issues.apache.org/jira/browse/LANG-412
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: Java  1.5
>            Reporter: Peter Oxenham
>             Fix For: 2.4
>
>         Attachments: LANG-412.patch
>
>
> Appending a null value with fixed width causes a null pointer exception if getNullText() has not been set.

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


[jira] Updated: (LANG-412) StrBuilder appendFixedWidth does not handle nulls

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

Henri Yandell updated LANG-412:
-------------------------------

    Fix Version/s: 2.4

> StrBuilder appendFixedWidth does not handle nulls
> -------------------------------------------------
>
>                 Key: LANG-412
>                 URL: https://issues.apache.org/jira/browse/LANG-412
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: Java  1.5
>            Reporter: Peter Oxenham
>             Fix For: 2.4
>
>
> Appending a null value with fixed width causes a null pointer exception if getNullText() has not been set.

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