Repository navigation
Conversation
…ll#697) captureInitialValue skipped primitive fields, so resetField set them to the type default: boolean global = true became false and int port = -1 became 0 when the option was not given. Object fields already kept their initializer (aeshell#392). Capture primitives too, in the reflection and the generated path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
This was referenced Nov 1, 2026
Member
|
Bah, really sorry @davsclaus. I did not notice this pr before I had worked and pushed a fix myself. Really sorry! |
Contributor
Author
|
No problem @stalep - just glad you are are active on this project and are willing to look into reports and do releases. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #697
ProcessedOption.captureInitialValue(and itsGeneratedProcessedOptionoverride) skipped primitive fields.resetFieldthen fell back to the type default, so a primitive field lost its initializer whenever the option was not given:Object fields already keep their initializer (#392). This change captures primitive values as well, so they are restored in the same way. The reflection path, the generated path and
@Mixinfields are all covered. A primitive whose initializer equals the type default (false,0) still gets that same value.Tests:
AeshCommandRuntimeTest.testInitializedPrimitivesResetToInitialValuecoversboolean,int,longand a mixinint: first parse without options, then with them, then without them again.ProcessorTest.testPrimitiveInitializerscovers the generated (annotation processor) path.Both tests fail without the fix. The full
aeshandaesh-processorsuites pass (1597 + 97 tests).Found while porting the Apache Camel CLI from picocli to aesh (CAMEL-23810), tracked in #709.
Claude Code on behalf of davsclaus (Claus Ibsen)
🤖 Generated with Claude Code