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

JSR 305 annotations don't play nice with Java 9+ modules #1160

Closed
dbwiddis opened this issue Apr 3, 2020 · 5 comments · Fixed by #1161
Closed

JSR 305 annotations don't play nice with Java 9+ modules #1160

dbwiddis opened this issue Apr 3, 2020 · 5 comments · Fixed by #1161
Labels
compatibility Extending OSHI compatibility to OSs or versions documentation Improve javadocs or project documentation

Comments

@dbwiddis
Copy link
Member

dbwiddis commented Apr 3, 2020

Frustratingly, after spending a few hours looking at what package to include for the @ThreadSafe, @Immutable, and @NotThreadSafe annotations I just added (and released in 4.6.0 earlier today), it seems I made the wrong choice. The Java Platform Module System doesn’t like it when two modules contain types in the same package..

Also, it seems the javax.* packaging runs afoul of the Oracle binary code license section F.

I'm not sure how critical this is since I only used provided scope, but it seems a good idea to find another replacement soon. Open to suggestions for the "best" alternative... including possibly just defining them within OSHI.

@dbwiddis dbwiddis added up for grabs Issues the maintainers want community help with documentation Improve javadocs or project documentation labels Apr 3, 2020
@dbwiddis
Copy link
Member Author

dbwiddis commented Apr 3, 2020

Relevant discussion here

@hazendaz
Copy link
Member

hazendaz commented Apr 3, 2020

@dbwiddis I would not use JSR305 right now or any of the numerous duplicate solutions. After 'jakarta' is officially released in June and sometime after when all containers fully support it, the JSR305 is likely to be consumed into jakarta annotations. I'm on the spotbugs team which technically more or less owned JSR305, but the spec lead just went AWOL originally at Oracle per java tech lead and that just never got consumed at that time thus the mess out there. Internally spotbugs has been moved off JSR305 to use it's own annotations which just complicates it even more.

See here

@hazendaz
Copy link
Member

hazendaz commented Apr 3, 2020

by 'jakarta', i'm referring to the entire repackaging effort where 'javax' is going to 'jakarta'. JSR305 isn't allowed to be consumed now due to oracle licensing restrictions on their trademark even though that has existed for many years but wasn't directly in their apis.

@dbwiddis
Copy link
Member Author

dbwiddis commented Apr 3, 2020

Wow, @hazendaz, thanks for the input...

I would not use JSR305 right now or any of the numerous duplicate solutions

I think I've come to the same conclusion after following the numerous threads on the topic. Since I've only gone so far as the 3 quoted above, I can probably just define those within OSHI (to preserve their presence in the javadocs) and hold off on any more expansive use of the null-related, or check-return, or similar until JSR305 is in Jakarta. Or, better, since I'm looking at an API switch, perhaps just start making use of Optional.

oracle licensing restrictions on their trademark even though that has existed for many years but wasn't directly in their apis

Wouldn't the same logic apply to the use of com.sun.* in the JNA project's packaging?

@hazendaz
Copy link
Member

hazendaz commented Apr 3, 2020 via email

@dbwiddis dbwiddis added compatibility Extending OSHI compatibility to OSs or versions and removed up for grabs Issues the maintainers want community help with labels Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Extending OSHI compatibility to OSs or versions documentation Improve javadocs or project documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants