Skip to content

feat: Optional resolver#67

Merged
MessiasLima merged 3 commits into
mainfrom
add-java-optional-resolver-16690802065028185447
Jun 15, 2026
Merged

feat: Optional resolver#67
MessiasLima merged 3 commits into
mainfrom
add-java-optional-resolver-16690802065028185447

Conversation

@MessiasLima

Copy link
Copy Markdown
Owner

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

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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-project-automation github-project-automation Bot moved this to Ready in Some Jun 15, 2026
@google-labs-jules google-labs-jules Bot mentioned this pull request Jun 15, 2026
6 tasks

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/main/kotlin/dev/appoutlet/some/resolver/OptionalResolver.kt
Comment thread src/main/kotlin/dev/appoutlet/some/resolver/JavaOptionalResolver.kt Outdated
@MessiasLima MessiasLima changed the title Add Java Optional resolver feat: Optional resolver Jun 15, 2026
@MessiasLima MessiasLima merged commit 1e41791 into main Jun 15, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in Some Jun 15, 2026
@MessiasLima MessiasLima deleted the add-java-optional-resolver-16690802065028185447 branch June 15, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add Java Optional resolver

1 participant