array. Whether the array is empty during the call of
foo.f() however in my analysis depends on whether
foo.g() was called or not. Hence I think this is a false positive.
Note that while this reproduction scenario based on the original implementation is the whole file, the Sonar analysis still runs in the context of the whole application. I don’t quite know how I would be able to isolate it if the reproduction was dependent on “something” in the rest of the application anyways, as the rule does not provide any reasoning on why the array couldn’t have been populated.