- changed status to closed
StackOverflowError with StringOperand when trying to print the message of an exception
Issue #6
closed
Description
When using a string operand and an ambiguous syntax, printing the exception message leads to a StackOverflowError. The codesnippet below reproduces this behaviour when executed with no args.
Example
public static void main(String... args) {
Term syntax = cases(CliSugar.none("none"),
optional(helpFlag()), //ambiguous
stringOperand("operand", "description")); //needed for stack overflow to happen
ArgsParserProperties parser = new ArgsParserProperties()
.withArgsSyntax(syntax);
try {
parser.evalArgs(args);
} catch (ArgsSyntaxException e) {
System.out.println(e.toMessage()); //StackOverflowError happens in here
throw new RuntimeException(e);
}
}
Expected behavior
A nice exception message is printed instead of the StackOverflowError.
Comments (1)
-
- Log in to comment
Thanks for crating an issue! The bugfix is committed an will come in v3.2.5 :-)