Annotation-based null analysis query

Hi all,

Im confused so could do with a second set of eye’s and someone to point out my mistake here, or what is switched on / off between 3.4 / 4.

Okay so long story short I did my first binding years ago now it feel’s like - for VeSync / Levoit branded devices.

I pulled the version 4 snapshot of the repo, and am building the updated version against:

openjdk 17 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)

No issues at all, no complaints from the compiler all looks good.

So I need test evidence and someone has a 3.4 system. So on a different machine as my wife’s using my desk, I install Zulu 11 and pull the 3.4 bindings branch, copy my source code cover, and update the copyrights. I run the build for my binding. It compiles, but appears to give a load of new warnings about null checks not being valid when they are … e.g. pulling a value from a Map (if its not there it can be null obviously).

What am I missing here, should 3.4 be using the openJdk? As far as I can see the errors are incorrect, as null values are possible where its saying to remove null checks (always keep the code defensive :)).

Now I’ve put a MR on draft in case my primary system on the OpenJDK building against v4.0.0 isn’t showing me errors people will raise during the PR - I’d rather not waste time, but I do want to understand this key differences.

Any help much appreciated.

It’s exactly as described here on zulu 11 with the 3.4 repo: Null Annotations warnings driving me nuts. How to get rid of them? - #4 by marcel_verpaalen

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.