Skip to content

Commit c4a1ab4

Browse files
protogenesremkop
authored andcommitted
fix factory used for repeatable subcommands
the factory should be passed when creating a CommandSpec copy
1 parent 61a0227 commit c4a1ab4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/picocli/CommandLine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5753,7 +5753,7 @@ private CommandSpec(CommandUserObject userObject) {
57535753

57545754
private CommandSpec copy() {
57555755
Object obj = userObject.type == null ? userObject.instance : userObject.type;
5756-
CommandSpec result = obj == null ? CommandSpec.create() : CommandSpec.forAnnotatedObject(obj);
5756+
CommandSpec result = obj == null ? CommandSpec.create() : CommandSpec.forAnnotatedObject(obj, userObject.factory);
57575757
result.commandLine = commandLine;
57585758
result.parent = parent;
57595759
result.methodParams = methodParams;

0 commit comments

Comments
 (0)