MaxFreedomPollard commented on PR #762: URL: https://github.com/apache/datasketches-java/pull/762#issuecomment-5671602978
Done, pushed as accfafb. Before the check runs again, one thing worth knowing: the alert was raised against `n > 0`, not against `n < Long.MAX_VALUE`. CodeQL's range analysis does not model signed overflow, so from `long n = 1` and `n *= 10` it concludes n never drops below 1 and calls `n > 0` always true. It has no upper bound for n, which is why it said nothing about `n < Long.MAX_VALUE`. This version keeps `n > 0` as the only condition, so I expect alert 971 to come back once the workflow is approved on this commit. The loop behaves exactly as you described: 19 iterations, last positive value 1E18, and 1E18 * 10 wraps to -8446744073709551616, which ends it. The generated sequence matches the one you wrote out, and the test passes. I kept `public void` to match every other @Test in UtilTest and left `final` on checkN's parameter. TestNG 7.12 does run a package-private static @Test, so say the word if you would rather have the exact shape you wrote. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
