{"action":"opened","issue":{"url":"https://api.github.com/repos/alibaba/fastjson/issues/662","repository_url":"https://api.github.com/repos/alibaba/fastjson","labels_url":"https://api.github.com/repos/alibaba/fastjson/issues/662/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/fastjson/issues/662/comments","events_url":"https://api.github.com/repos/alibaba/fastjson/issues/662/events","html_url":"https://github.com/alibaba/fastjson/issues/662","id":158584372,"number":662,"title":"float和double类型的字段，出现负值，解析出错","user":{"login":"lwlzpn84","id":13761540,"avatar_url":"https://avatars.githubusercontent.com/u/13761540?v=3","gravatar_id":"","url":"https://api.github.com/users/lwlzpn84","html_url":"https://github.com/lwlzpn84","followers_url":"https://api.github.com/users/lwlzpn84/followers","following_url":"https://api.github.com/users/lwlzpn84/following{/other_user}","gists_url":"https://api.github.com/users/lwlzpn84/gists{/gist_id}","starred_url":"https://api.github.com/users/lwlzpn84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwlzpn84/subscriptions","organizations_url":"https://api.github.com/users/lwlzpn84/orgs","repos_url":"https://api.github.com/users/lwlzpn84/repos","events_url":"https://api.github.com/users/lwlzpn84/events{/privacy}","received_events_url":"https://api.github.com/users/lwlzpn84/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-06T00:50:45Z","updated_at":"2016-06-06T00:50:45Z","closed_at":null,"body":"float和double类型的字段，出现负值，使用SerializerFeature.BeanToArray序列化，然后使用Feature.SupportArrayToBean反序列化出错\r\n\r\npackage com.tuniu.protobuf;\r\n\r\nimport java.util.List;\r\nimport java.util.Map;\r\n\r\npublic class Model {\r\n  \r\n  private int id;\r\n  \r\n  private String name;\r\n  \r\n  private String modelName;\r\n  \r\n  private boolean isFlay;\r\n  \r\n  private float val;\r\n  \r\n  private double dval;\r\n  \r\n  public int getId() {\r\n    return id;\r\n  }\r\n\r\n  public void setId(int id) {\r\n    this.id = id;\r\n  }\r\n\r\n  public String getName() {\r\n    return name;\r\n  }\r\n\r\n  public void setName(String name) {\r\n    this.name = name;\r\n  }\r\n\r\n  public String getModelName() {\r\n    return modelName;\r\n  }\r\n\r\n  public void setModelName(String modelName) {\r\n    this.modelName = modelName;\r\n  }\r\n\r\n  public boolean isIsFlay() {\r\n    return isFlay;\r\n  }\r\n\r\n  public void setIsFlay(boolean isFlay) {\r\n    this.isFlay = isFlay;\r\n  }\r\n\r\n\tpublic float getVal() {\r\n\t\treturn val;\r\n\t}\r\n\t\r\n\tpublic void setVal(float val) {\r\n\t\tthis.val = val;\r\n\t}\r\n\t\r\n\tpublic double getDval() {\r\n\t\treturn dval;\r\n\t}\r\n\t\r\n\tpublic void setDval(double dval) {\r\n\t\tthis.dval = dval;\r\n\t}\r\n\t\r\n}\r\n\r\n\r\n   Model model = new Model();\r\n    model.setId(123);\r\n    model.setName(null);\r\n    model.setModelName(null);\r\n    model.setIsFlay(false);\r\n    model.setVal(1999);\r\n    model.setDval(-10.099);\r\n    \r\n    String str = JSON.toJSONString(model, SerializerFeature.BeanToArray);\r\n    JSON.parseObject(str, Model.class, Feature.SupportArrayToBean);"}}
{"actor":{"display_login":"lwlzpn84"}}