Skip to content
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

Library used for nullable, etc. annotations #30

Open
zeroeightysix opened this issue Apr 10, 2020 · 10 comments
Open

Library used for nullable, etc. annotations #30

zeroeightysix opened this issue Apr 10, 2020 · 10 comments
Labels
good first issue Good for newcomers

Comments

@zeroeightysix
Copy link
Member

In FabricMC/fabric#499 the library used for the @Deprecated is being discussed. I'd like to use the same library for the @Nullable annotations (and variants).

Note IDEA currently provides the following warning for all usages of javax annotations:

Not 'javax.annotation.Nullable' but 'org.jetbrains.annotations.Nullable' would be used for code generation. 

This issue serves as a tracker until FabricMC/fabric#499 is solved.

@liach
Copy link

liach commented Apr 10, 2020

Should we use jetbrains or javax? javax annotations imo are not sustainable in long term as we might have things like nested nullable types

@zeroeightysix
Copy link
Member Author

I prefer jetbrains annotations as well. Fiber currently uses javax solely because it's in the standard lib.

@liach
Copy link

liach commented Apr 10, 2020

With jetbrain annotations/other type annotations and some tweaks to

, it will be able to handle the nullability of nested types properly

@Pyrofab
Copy link
Member

Pyrofab commented Apr 10, 2020

I've been dying to use Jetbrains annotations everywhere in my PRs. With that said, would Fabric Loader accept a compile-time dependency on those ?

@liach
Copy link

liach commented Apr 10, 2020

Yep, but a problem with jetbrain annotations is that they are class-level retention (i.e. aren't exposed at runtime so config's type resolution cannot perform nullable checks unless using asm to grab those annotations)

@i509VCB
Copy link

i509VCB commented Apr 10, 2020

Does checker preserve annotations into runtime?

@Pyrofab
Copy link
Member

Pyrofab commented Apr 10, 2020

I did not consider using nullness annotations for runtime checks. That is an excellent idea, it could use a new NonNullConstraint.

@zeroeightysix zeroeightysix added the good first issue Good for newcomers label Apr 19, 2020
@ghost
Copy link

ghost commented Sep 11, 2020

I'd vote for Jetbrains. The Javax annotations cause build problems when I'm using CurseGradle on Github Actions (and the error log leads to this project). I've had to manually add the Javax annotations as an implementation even though I personally use Jetbrains.

@dG9hc3Q
Copy link

dG9hc3Q commented Sep 19, 2020

Jetbrains ftw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants