Open Bananeweizen opened 1 month ago
Hi! I'ts been developed to scratch an internal itch, and to that end makes some assumptions indeed. We have an convention of annotating the package with NonNullApi
in package-info.java
, which is why there's no equivalent handling of NonNull
. Similarly, we consistently use our internal Nullable
annotation, which is why you don't see other annotations handled.
We could make the recipe more broadly applicable by giving it an @Option
of which annotation to match, such that folks can override the default with a declarative recipe. Would that be an acceptable solution for both of the cases you've mentioned?
Such an option should be sufficient for both cases. Is there a general convention on whether such an option should be multi-valued (which would depend on the recipe author), or whether the recipe should be listed multiple times with single values by the user? Just wondering if that makes a difference for performance...
I've just reviewed the new NullableOnMethodReturnType recipe after receiving the latest release locally. To me it seems incomplete:
Please be aware I only read the code and didn't run any test. So I might be completely wrong with this analysis.