修复Json中不带引号的n开头且长度大于3的字符串转成String时不能正常解析的BUG
This commit is contained in:
@@ -162,6 +162,7 @@ public class JsonReader extends Reader {
|
|||||||
* 判断下一个非空白字符是否为{
|
* 判断下一个非空白字符是否为{
|
||||||
*
|
*
|
||||||
* @param clazz 类名
|
* @param clazz 类名
|
||||||
|
*
|
||||||
* @return 返回 null 表示对象为null, 返回空字符串表示当前class与返回的class一致,返回非空字符串表示class是当前class的子类。
|
* @return 返回 null 表示对象为null, 返回空字符串表示当前class与返回的class一致,返回非空字符串表示class是当前class的子类。
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -475,7 +476,7 @@ public class JsonReader extends Reader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (expected != '"' && expected != '\'') {
|
if (expected != '"' && expected != '\'') {
|
||||||
if (expected == 'n' && text0.length > currpos + 3) {
|
if (expected == 'n' && text0.length > currpos + 3 && (text0[1 + currpos] == 'u' && text0[2 + currpos] == 'l' && text0[3 + currpos] == 'l')) {
|
||||||
if (text0[++currpos] == 'u' && text0[++currpos] == 'l' && text0[++currpos] == 'l') {
|
if (text0[++currpos] == 'u' && text0[++currpos] == 'l' && text0[++currpos] == 'l') {
|
||||||
this.position = currpos;
|
this.position = currpos;
|
||||||
if (text0.length > currpos + 4) {
|
if (text0.length > currpos + 4) {
|
||||||
|
|||||||
Reference in New Issue
Block a user