feat: Optional resolver#67
Conversation
Implemented JavaOptionalResolver to provide first-class support for java.util.Optional<T> in fixture generation. The resolver respects the configured NullableStrategy: - AlwaysNull: returns Optional.empty() - NeverNull: returns Optional.of(value) - Random: returns Optional.empty() based on probability - NullOnCircularReference: returns Optional.empty() when a circular reference is detected The resolver is registered in SomeConfig and includes comprehensive unit tests. Closes # [issue number if provided] Co-authored-by: MessiasLima <10220064+MessiasLima@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request introduces JavaOptionalResolver to support resolving Java Optional types based on the configured NullableStrategy, along with comprehensive unit tests. The review feedback suggests improving robustness by falling back to Any instead of throwing an exception for star projections or raw Optional types, and removing an unnecessary cast to KClass<*> to support generic type parameters and preserve annotations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Added JavaOptionalResolver to support java.util.Optional types in fixture generation. This ensures Optional fields are correctly handled according to the active NullableStrategy and avoids instantiation failures due to Optional's private constructor. Added comprehensive unit tests and verified with detekt and full test suite.
Fixes #54
PR created automatically by Jules for task 16690802065028185447 started by @MessiasLima