I’m trying to make my binding free of spotbugs / compiler warnings… must say it is a painful journey.
After squishing hundreds of Potential null pointer access: this expression has a '@Nullable' type
issues where after a if (xxx!=null) xxx.whatever() it complains, the next challenge is the about 50 of whatever type does not seem to be designed with null type annotations in mind.
What is the suggested way to get rid of those. In the issue tracker nor in the documentation it seem to suggest a clear path to get rid of them. It comes in several flavours…
Unsafe interpretation of method return type as '@NonNull' based on the receiver type 'List<@NonNull JsonObject>'. Type 'List<E>' doesn't seem to be designed with null type annotations in mind
Unsafe interpretation of method return type as '@NonNull' based on the receiver type '@NonNull Map<@NonNull Integer,@NonNull ArrayList<Float @NonNull[]>>'. Type 'Map<K,V>' doesn't seem to be designed with null type annotations in mind
Unsafe interpretation of method return type as '@NonNull' based on the receiver type 'AbstractQueue<@NonNull MiIoSendCommand>'. Type 'AbstractQueue<E>' doesn't seem to be designed with null type annotations in mind
Unsafe interpretation of method return type as '@NonNull' based on substitution 'T=@NonNull MiIoBasicDevice'. Declaring type 'Gson' doesn't seem to be designed with null type annotations in mind
I’m also struggling with a Nullness default is redundant with a default specified for the enclosing type ....
issue, where if I add a @NotNullByDefault it gives this compiler error, and if I leave it out spotbugs is complaining it is missing…
The last one, though I’m not sure if that was not there before is a MiIoMessageListener.java:[18,613] The import org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication is never used
However, the imports are automatically maintained by Eclipse… If I remove it with the next save it is added again…