You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package test;
import picocli.CommandLine;
import picocli.CommandLine.ArgGroup;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
public class ArgGroupsTest {
public static void main(String[] args) {
CommandLine cmd = new CommandLine(new TestCommand());
cmd.parseArgs("-a=Foo");
cmd.parseWithHandler(new CommandLine.RunAll(), args);
}
@Command(name = "ArgGroupsTest")
static class TestCommand implements Runnable {
@ArgGroup( exclusive = true)
DataSource datasource;
static class DataSource {
@Option(names = "-a", required = true, defaultValue = "Strings.gxl")
static String aString;
}
@Override
public void run() {
// nothing to do here
}
}
}
If I remove defaultValue = "Strings.gxl"from the annotation of option -a, the error goes away.
Stack trace:
Exception in thread "main" java.lang.StackOverflowError
at picocli.CommandLine$Help$Ansi.apply(CommandLine.java:12026)
at picocli.CommandLine$Help$ColorScheme.optionText(CommandLine.java:11737)
at picocli.CommandLine$Model$ArgGroupSpec.concatOptionText(CommandLine.java:6630)
at picocli.CommandLine$Model$ArgGroupSpec.synopsisText(CommandLine.java:6602)
at picocli.CommandLine$Model$ArgGroupSpec.synopsis(CommandLine.java:6593)
at picocli.CommandLine$ParseResult$MatchedGroup.addMultiple(CommandLine.java:8438)
at picocli.CommandLine$ParseResult$MatchedGroup.<init>(CommandLine.java:8422)
...
quite a few lines here
The text was updated successfully, but these errors were encountered:
@mitamr Yes the fix for the above issue was included in picocli-4.0.0-alpha-2 and all following releases. I just tried the above example with picocli 4.0.4 and it works fine: no StackOverflowError.
If you are still seeing this with picocli 4.0.4 you found a new similar issue. Can you please raise a new ticket with an example of how to reproduce the issue?
How to reproduce:
Minimal working example:
If I remove
defaultValue = "Strings.gxl"
from the annotation of option-a
, the error goes away.Stack trace:
The text was updated successfully, but these errors were encountered: