Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive subcommand could give better error #2293

Open
battery-staple opened this issue May 30, 2024 · 1 comment
Open

Recursive subcommand could give better error #2293

battery-staple opened this issue May 30, 2024 · 1 comment

Comments

@battery-staple
Copy link

This is a very minor issue. I accidentally created a command that has itself as a subcommand, like this:

import picocli.CommandLine.Command;

@Command(name = "bad", subcommands = BadCommand.class)
public class BadCommand {

}

While this is of course incorrect, it gives a fairly opaque error:
error: FATAL ERROR: java.util.regex.PatternSyntaxException: Stack overflow during pattern compilation near index 9.

It might save someone else in the future a bit of trouble if this gave a more descriptive error. :-)

@remkop
Copy link
Owner

remkop commented Jun 25, 2024

@battery-staple Thank you for raising this.
Is this something that happens in picocli's annotation processor during compilation, or in picocli's reflection code at runtime?
Is there a full stack trace you can provide?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants