Skip to content

Commit 63a938f

Browse files
committed
Fix default value for double/float types
1 parent 040c0b3 commit 63a938f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • spring-shell-core/src/main/java/org/springframework/shell/core/utils

spring-shell-core/src/main/java/org/springframework/shell/core/utils/Utils.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,13 @@ else if (type == char.class) {
131131
}
132132
else if (type == byte.class || type == short.class || type == int.class || type == long.class) {
133133
return 0;
134-
} // otherwise it's float or double
135-
return 0.0;
134+
}
135+
else if (type == float.class) {
136+
return 0f;
137+
}
138+
else {
139+
return 0d;
140+
}
136141
}
137142

138143
private static Set<Command> getCommands(CommandRegistry commandRegistry) {

0 commit comments

Comments
 (0)