Skip to content

Instantly share code, notes, and snippets.

@greenlaw110
Last active August 19, 2017 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenlaw110/3d0fc68a569565bdf1c9056ef25ab1fb to your computer and use it in GitHub Desktop.
Save greenlaw110/3d0fc68a569565bdf1c9056ef25ab1fb to your computer and use it in GitHub Desktop.
package testapp;
import com.alibaba.fastjson.JSON;
public class FastJson37Issue {
public static class Foo {
private boolean v;
public void setV(boolean v) {
this.v = v;
}
@Override
public String toString() {
return String.valueOf(v);
}
}
public static void main(String[] args) {
String fastJsonVersion = JSON.VERSION;
System.out.println("fastjson version: " + fastJsonVersion);
String strOk = "{\"v\": 111}";
Foo ok = JSON.parseObject(strOk, Foo.class);
System.out.println("ok:" + ok);
String strBad = "{\"v\":111}";
Foo bad = JSON.parseObject(strBad, Foo.class);
System.out.println("bad" + bad);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment