Skip to content

Commit

Permalink
fix replace readInt32Value with readInt64Value for ObjectReaderImplFr…
Browse files Browse the repository at this point in the history
…omLong, for issue #2615
  • Loading branch information
yanxutao89 authored and wenshao committed May 22, 2024
1 parent d106c42 commit e0a1a80
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public T readJSONBObject(JSONReader jsonReader, Type fieldType, Object fieldName
}

return creator.apply(
jsonReader.readInt32Value()
jsonReader.readInt64Value()
);
}

Expand All @@ -32,7 +32,7 @@ public T readObject(JSONReader jsonReader, Type fieldType, Object fieldName, lon
}

return creator.apply(
jsonReader.readInt32Value()
jsonReader.readInt64Value()
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.alibaba.fastjson2.issues_2600;

import com.alibaba.fastjson2.JSON;
import org.junit.jupiter.api.Test;

import java.util.concurrent.atomic.AtomicLong;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class Issue2615 {
@Test
public void test() {
AtomicLong atomicLong = JSON.parseObject("8924992445", AtomicLong.class);
assertEquals(8924992445L, atomicLong.get());
}
}

0 comments on commit e0a1a80

Please sign in to comment.