Closed wborn closed 4 years ago
I will check if it still does the other checks, e.g. warning when @NonNull
is used. If it no longer does that we need to modify the check to only skip the @NonNullByDefault
check on inner classes.
The checkInnerUnits
seems to work as advertised in the JavaDocs and only enables/disables checking for @NonNullByDefault
on inner classes:
Looks like Eclipse also checks and warns for such issues nowadays :+1: :
This change will also reduce the number of SAT NullAnnotationsCheck
findings since it will only warn about missing @NonNullByDefault
at most once per file.
The NullAnnotationsCheck findings are:
Project | Before | After | Delta |
---|---|---|---|
openhab-core | 1162 | 997 | 165 |
openhab-addons | 4209 | 3712 | 497 |
As a result there will still be a warning for annotating the outer class when @NonNullByDefault is missing. It is redundant to annotate inner classes when outer classes are annotated. The compiler generates warnings when both outer and inner classes are annotated.
Fixes #351
Example: