jasonzue / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Cannot parse {' ':''} #253

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. new JsonParser().parse(new StringReader("{' ':''}"));

What is the expected output? What do you see instead?
Either return a valid object, or throw a JsonParseException.  Instead I get a 
precondition failure in the javacc-generated code.

What version of the product are you using? On what operating system?
Head, as of 10/10/18.  On Ubuntu Lucid.

Original issue reported on code.google.com by d...@google.com on 19 Oct 2010 at 1:22

GoogleCodeExporter commented 9 years ago
Broken in 1.5, but already fixed in SVN. "Head" is disingenuous.

Original comment by limpbizkit on 19 Oct 2010 at 3:56

GoogleCodeExporter commented 9 years ago
By head, I meant that I ran svn checkout 
http://google-gson.googlecode.com/svn/trunk/ google-gson-read-only yesterday, 
and the problem was there.  It seems to be current to r602.
How do I get the "fixed" version?  Is there an issue tracked for the fix?

Original comment by d...@google.com on 19 Oct 2010 at 7:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The bug is fixed in head. Did you rebuild?

mkdir issue253
cd issue253/
svn checkout http://google-gson.googlecode.com/svn/trunk/ google-gson-read-only 
cd google-gson-read-only/gson/
mvn
vi Issue253.java
  import com.google.gson.JsonParser;
  import java.io.StringReader;
  public class Issue253  {
    public static void main(String[] args) {
      System.out.println(new JsonParser().parse(new StringReader("{' ':''}")));
    }
  }
javac -cp target/classes/ Issue253.java
java -cp target/classes/:. Issue253

(Comment 3 was edited to add a mvn command)

Original comment by limpbizkit on 20 Oct 2010 at 1:39