Skip to content

Commit

Permalink
bugfix: fix type error when fastjson deserialize long type (apache#2234)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjinlei committed Feb 12, 2020
1 parent b95b850 commit 9981b7c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ private static void convertType(Field f0, Field f1) {
if (f1Type == Types.DECIMAL && f1.getValue().getClass().equals(Integer.class)) {
f1.setValue(new BigDecimal(f1.getValue().toString()));
}
if (f0Type == Types.BIGINT && f0.getValue().getClass().equals(Integer.class)) {
f0.setValue(Long.parseLong(f0.getValue().toString()));
}
if (f1Type == Types.BIGINT && f1.getValue().getClass().equals(Integer.class)) {
f1.setValue(Long.parseLong(f1.getValue().toString()));
}
}

/**
Expand Down

0 comments on commit 9981b7c

Please sign in to comment.