Make animal sniffer annotations optional by elharo · Pull Request #3649 · google/guava (original) (raw)

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 optional or provided is wrong, as discussed in the AutoValue thread. There are two main cases:

So I think that including annotations is still the right thing to do by default. The typical guidance I've seen to make them provided or optional doesn't even consider these issues, so I don't think we should put much stock in it.

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: