Last active
August 19, 2017 23:33
-
-
Save greenlaw110/3d0fc68a569565bdf1c9056ef25ab1fb to your computer and use it in GitHub Desktop.
The source code to reproduce https://github.com/alibaba/fastjson/issues/1422
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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