Skip to content

Commit 801e4fc

Browse files
committed
Fix wrong writing method for numbers
1 parent aa90a28 commit 801e4fc

File tree

1 file changed

+3
-2
lines changed
  • common-utils/src/main/java/net/anweisen/utilities/common/config/document

1 file changed

+3
-2
lines changed

common-utils/src/main/java/net/anweisen/utilities/common/config/document/GsonDocument.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ public class GsonDocument extends AbstractDocument {
4747
// Not implemented in some versions of gson
4848
TypeAdapter<Number> NUMBER = new TypeAdapter<Number>() {
4949
@Override
50-
public void write(JsonWriter jsonWriter, Number number) throws IOException {
51-
TypeAdapters.STRING.write(jsonWriter, String.valueOf(number));
50+
public void write(JsonWriter out, Number value) throws IOException {
51+
out.value(value);
5252
}
53+
@Override
5354
public Number read(JsonReader in) throws IOException {
5455
JsonToken jsonToken = in.peek();
5556
switch (jsonToken) {

0 commit comments

Comments
 (0)