Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.google.gson.internal.Streams.AppendableWriter.CurrentWrite does not override toString() #527

Closed
GoogleCodeExporter opened this issue Mar 19, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Run this code:

    final Appendable appendable = new org.apache.commons.lang3.text.StrBuilder();
    new Gson().toJson("foo", appendable);
    System.out.println(appendable.toString());

The StrBuilder class is defined by the Apache Commons Lang3 library 
(commons-lang3-3.1.jar).

What is the expected output? What do you see instead?

Expected:
"foo"

Actual:
ccomc

What version of the product are you using? On what operating system?

I am using 2.2.4 on Windows XP Professional x64.

Please provide any additional information below.

The com.google.gson.internal.Streams.AppendableWriter.CurrentWrite class (see 
http://google-gson.googlecode.com/svn/trunk/gson/src/main/java/com/google/gson/i
nternal/Streams.java) implements java.lang.CharSequence, but does not override 
the toString() method. CharSequence.toString() is required to return "a string 
consisting of exactly this sequence of characters", but CurrentWrite.toString() 
does not adhere to this contract.

Original issue reported on code.google.com by schneega...@gmail.com on 5 Jul 2013 at 6:06

@eamonnmcmanus
Copy link
Member

Closing as a duplicate of #1702 (which includes a detailed repro).

@eamonnmcmanus eamonnmcmanus closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants