Re: Bug in Text.append(String)

Rolf Lear <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Hi Jack.

I already found this issue, the fix is in github on both the 1.x and 2.x 
branches, but not in any official jars yet.

https://github.com/hunterhacker/jdom/issues/23

Rolf

On 29/09/2011 3:30 AM, Jack Punt wrote:
> This does the wrong thing when str = EMPTY_STRING
> (dubious: should be str.equals("") since new String() != "")
> but the real bug is that value=str; clears the old value instead of 
> appending...
>     public void append(String str) {
>         String reason;
>         if (str == null) {
>             return;
>         }
>         if ((reason = Verifier.checkCharacterData(str)) != null) {
>             throw new IllegalDataException(str, "character content", 
> reason);
>         }
>         if (str == EMPTY_STRING)
>              value = str;
>         else value += str;
>     }
>
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/[email protected]

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.