Open rw12306 opened 3 years ago
import com.alibaba.fastjson.JSON;
import org.junit.Test;
public class Issue3634 {
private static final String willUse = "{\n" +
" \"font\": {\n" +
" \"@type\": \"java.awt.Font\",\n" +
" \"name\": \"宋体\",\n" +
" \"style\": 0,\n" +
" \"size\": 10\n" +
" }\n" +
"}";
@Test
public void test1() {
JSON.parseObject(willUse);
JSON.parse(willUse);
}
}
1.2.75,openjdk8. 没复现成功,@rw12306,能提供复现demo吗?
原参数: "font": { "@type": "java.awt.Font", "name": "宋体", "style": 0, "size": 10 }
} else if (key.equalsIgnoreCase("size")) { if (lexer.token() == JSONToken.LITERAL_INT) { size = lexer.intValue(); lexer.nextToken(); } else { throw new JSONException("syntax error"); } } else { --此处会报错 throw new JSONException("syntax error, " + key); } 这里会报错syntax error, @type