-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Make animal sniffer annotations optional #3649
Conversation
Per https://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations/ this should not be inherited by dependents
I think the case for this is a little better than the case for AutoValue's annotations, but I still have my doubts. I think the overall consensus that annotation-only packages should be
So I think that including annotations is still the right thing to do by default. The typical guidance I've seen to make them I assume that the goal here is to avoid version conflicts. Is this a case in which the Linkage Checker can detect that it's harmless to have different but identical versions of the class file present? edit: an additional concern:
|
The purpose of animal sniffer is for compile time checking of the project with animal sniffer. That's it. These annotations don't have any use post-compile. |
I also think it's important that a fundamental library such as Guava minimize its dependency tree, ideally to the JDK, full stop. However between animal sniffer, error prone, and others Guava has slowly been accumulating a lot of additional dependencies that are transitively appearing in other projects. Every dependency is a liability. |
They have class retention, though, so they'll be in the output. Maybe they shouldn't be, but arbitrary tools don't know that :( Maybe file a bug against Animal Sniffer? |
Good idea. Done: mojohaus/animal-sniffer#73 We'll see what the animal sniffer devs say, but I'm guessing the plugin is analyzing the .class files rather than the .java files, which would explain why they want class retention with an optional dependency. The linkage checker operates similarly. We read .class files, not .java files. |
Ah, you're probably right. I found the following in some docs (the same ones as you linked above):
So maybe we can provide our own. |
I think that the impact of annotation-only packages is fairly small as liabilities go. Or at the very least, if it's safe to omit the packages entirely, then it's likely to be safe to have the wrong version present. Still, I think it would be fine to migrate our one usage of |
Should that approach (moving to a package private custom implementation) start in google3 or here? |
google3 is marginally easier for us, but I'm fine with whatever you prefer. |
It seems the pom.xml only lives here so probably easier to work from github. |
A search like |
Closing this in favor of #3652 |
Per https://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations/ this should not be inherited by dependents
@cpovirk