Skip to content

Commit

Permalink
[Java] Handle Long in enum correctly (#6342)
Browse files Browse the repository at this point in the history
Resolves #6338
  • Loading branch information
dariota authored and wing328 committed Sep 6, 2017
1 parent 5658445 commit 29a3a4b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,11 @@ public String toEnumVarName(String value, String datatype) {

@Override
public String toEnumValue(String value, String datatype) {
if ("Integer".equals(datatype) || "Long".equals(datatype) ||
"Double".equals(datatype)) {
if ("Integer".equals(datatype) || "Double".equals(datatype)) {
return value;
} else if ("Long".equals(datatype)) {
// add l to number, e.g. 2048 => 2048l
return value + "l";
} else if ("Float".equals(datatype)) {
// add f to number, e.g. 3.14 => 3.14f
return value + "f";
Expand Down

0 comments on commit 29a3a4b

Please sign in to comment.