-
Notifications
You must be signed in to change notification settings - Fork 425
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
[picocli WARN] Could not set initial value for field boolean #1300
Comments
@codexetreme Thank you for raising this. |
Sure, let me know if can help out in anyway |
I don't have a fix yet, but it can be reproduced when:
There are two workarounds: 1. Initialize the arg groupCurrently the If the application initializes the field, the problem will go away. For example: public class ListSignals implements Callable<Integer> {
@ArgGroup(exclusive = true, multiplicity = "1")
SearchFilterArgs searchFilterArgs = new SearchFilterArgs(); // <--- initialize at declaration
... 2. Create new
|
The underlying cause is that with options in an ArgGroups where the group has not been instantiated, the initial value of these options is cached. The bug is that the initial value is marked as "cached", even though it could not be determined and still The fix is to only mark the initial value as "cached" when it could be determined successfully. This has been fixed in master, and the fix will be included in the next release. |
…alue for field boolean"
…nitial value for field boolean"" This reverts commit ff6d808.
…nitial value for field boolean"" This reverts commit ff6d808.
Hello all, loving picocli so far, its quite simple and above and beyond my expectations, but as all things human, I have reached a point where I am getting into a very complicated cli setup, and need some
ArgGroup
magic, but I am facing the following issue:assume I have a simple example like this:
and my test is as so
I am getting the following warning:
[picocli WARN] Could not set initial value for field boolean com.example.ListSignals$SearchFilterArgs.getAllSignals of type boolean to null: ....
can someone please tell me if this is intentional, and if so, how do I suppress the warning ?
PS: I tried the
defaultValue
in the option annotation , didn't workThe text was updated successfully, but these errors were encountered: