Skip to content

Commit 6ad1448

Browse files
committed
Use null as default value for options when no default value is present
Resolves #1273
1 parent fe806a0 commit 6ad1448

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spring-shell-core/src/main/java/org/springframework/shell/core/command/adapter/MethodInvokerCommandAdapter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ private List<Object> prepareArguments(CommandContext commandContext) {
165165
Object value = this.conversionService.convert(defaultValue, parameterType);
166166
args.add(value);
167167
}
168+
else {
169+
// for non-primitive types, add null
170+
args.add(null);
171+
}
168172
}
169173
else {
170174
// for primitive types, add default value of the primitive

0 commit comments

Comments
 (0)