RFR: 8288515: (ch) Unnecessary use of Math.addExact() in java.nio.channels.FileLock.overlaps()

Brian Burkhalter bpb at openjdk.org
Wed Jun 22 00:23:14 UTC 2022


`FileLock` checks the immutable `position` and `size` parameters in its constructor hence using `Math.addExact()` on these instance variables in `overlaps()` is needless.

-------------

Commit messages:
 - 8288515: (ch) Unnecessary use of Math.addExact() in java.nio.channels.FileLock.overlaps()

Changes: https://git.openjdk.org/jdk/pull/9229/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9229&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8288515
  Stats: 7 lines in 1 file changed: 0 ins; 3 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/9229.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9229/head:pull/9229

PR: https://git.openjdk.org/jdk/pull/9229


More information about the nio-dev mailing list