Skip to content

Auto add nullable beans to auto-requires/Fix Proxy not writing @Nullable #311

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

Merged
merged 3 commits into from
Mar 6, 2023

Conversation

SentryMan
Copy link
Collaborator

So after all this autoRequires stuff, wouldn't it be easier to have avaje auto add nullable types to auto requires instead of
needing to manually define @InjectModule(requires={X,Y,Z}) for every single nullable bean?

  • Adds a static set to ProcessingContext that we can use to keep track of nullable/optional types
  • Update Field and Method Readers to add the bean type to the set when nullable or Optional Type is detected
  • Fixes Proxy Writer not writing @Nullable annotations when needed

Fixes #244

@SentryMan SentryMan changed the title Auto add nullable bean to auto-requires/Fix Proxy not writing @Nullable Auto add nullable beans to auto-requires/Fix Proxy not writing @Nullable Mar 5, 2023
@rbygrave rbygrave added this to the 9.0 milestone Mar 6, 2023
@rbygrave rbygrave merged commit 3a47f87 into avaje:master Mar 6, 2023
rbygrave added a commit that referenced this pull request Mar 6, 2023
Fix getMaybe() as parent.get() isn't maybe/optional and we need to use parent.getOptional() here
@rbygrave
Copy link
Contributor

rbygrave commented Mar 6, 2023

I think this is going to be a nice improvement / less confusing for folks using nullable / optional. Good stuff!!

@SentryMan SentryMan deleted the nullable2 branch March 6, 2023 13:15
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

Successfully merging this pull request may close these issues.

@Nullable not working?
2 participants