Gson version
2.10.1
Java / Android version
21
Description
I try to get a JsonElement by toJsonTree method. but i found that when i use integer object as input, i will get a long object with method JsonElement.getAsNumber()
I think this commit caused this problem:3e3266c
Is this a bug or a feature?
Expected behavior
use integer type as input, get integer type as output
Actual behavior
use integer type as input, get long type as output
Reproduction steps
@Test
public void test(){
Integer testNum = 1;
JsonElement jsonTree = new Gson().toJsonTree(testNum);
System.out.println(jsonTree.getAsNumber().getClass());
}