On Sun, 12 Apr 2026 04:39:38 GMT, Phil Race <[email protected]> wrote:
>> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 606: >> >>> 604: ((offset + size) <= 0) || >>> 605: ((offset + size) > arrayLen) || >>> 606: ((offset > 0) && ((offset + size ) < size)); >> >> The last condition—`((offset > 0) && ((offset + size ) < size))`— can never >> be true because `((offset + size) <= 0)` would yield true if the sum >> overflows. By the time this third condition is reached, `offset >= 0` and >> `size > 0`, if the third condition yields false, then the last condition is >> bound to yield false too. > > I like more explicit verification if it isn't too costly but OK. Since that condition can never be true, it's better to remove it to avoid wondering when it can possibly be true. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3087451672
