eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
864 stars 782 forks source link

@NonNull check on Map.get through ThingType.getProperties().get() #4915

Open cdjackson opened 6 years ago

cdjackson commented 6 years ago

I'm not sure why this is showing up, but as can be seen below, I get a warning in Eclipse saying that the return from ThingType.getProperties().get() can not be null. This is just backed by a Map, which can return null if there is no key. I do a null check from the response, and as can be seen, there's a warning under the "associations" variable which states Null comparison always yields false: The variable associations cannot be null at this location.

image

I can't follow where the @NonNull is coming from here - maybe the @NonNullByDefault in ThingType? Feel free to close if it's not in ESH but it's annoying as it's giving incorrect warnings.

maggu2810 commented 6 years ago

That is caused because we are still missing external annotations for the JDK. So as long as the support is not added, you have to ignore the "cannot be null" warning.

sjsf commented 6 years ago

see #4513