Quality gate mark old code issue as new

SonarCloud java 8 repo, all of the sudden quality failing on a problem that was not identified (or even related) in the PR which was just merged…

Focusing on the 2 “new code” bugs, it looks as if the code is new (23 minutes ago):

But drilling-in, this is old code:

Top part is from December 2019:

Bottom part the same:

Also both issues are false positives as we do check for null, but this is less relevant for the timing issue:

Hi,

Your issue has multiple locations. What are the dates on these other locations? For an issue like this, it’s quite possible that a “new” NPE is raised on old code because something leading up to the issue (those 2ndary locations) has changed.

 
HTH,
Ann

First issue only had 3 locations, all listed in the screenshots I provided and none is new as can be seen.

Second issue has 5 locations, again none are new:

Specifically the first two:

The third:

Last two:

Hi,

Then the other option is that what the analyzer was considering the null-check was recently removed. Unfortunately, we have no way of indicating this. It can also be a problem in PR analysis that contains deletions. Hopefully this makes sense…

 
Ann

The thing is, the PR merge that lead for this build did not even relate to this file:

Also the PR itself passed the quality gate just before the merge:

And in any case, this file was last touched 3 days ago (no deletion):

So I don’t see any reason for this file to suddenly produce issues…

Any update? I’m asking as I just saw a similar issue on another repository.

Again Sonar is marking a code issue as new:

But it’s really not - new new code mark:

And specifically for these lines:

And specifically for these lines:

Needless to say, these issues just appeared out of nowhere, they were not listed 4 days ago in the previous build and this file is not even related to the content that invoked this build.

BTW, just like last time - these two issues are false positive… same rule and same error as before.