<i18n dev> RFR: 8302664: Fix several incorrect usages of Preconditions.checkFromIndexSize

Jaikiran Pai jpai at openjdk.org
Fri Feb 17 12:03:54 UTC 2023


Can I please get a review of this change which fixes the usage of `Preconditions.checkFromIndexSize`? This addresses https://bugs.openjdk.org/browse/JDK-8302664.

There was an oversight when these changes were introduced in https://github.com/openjdk/jdk/pull/4507. I have now gone through that patch again to make sure the relevant places where this fix is needed has been addressed in this current PR.

I have also looked into other changes in that PR, just to be sure that there aren't any similar fixes needed for other method calls that were introduced in it - they all look fine.

tier1,tier2 and tier3 testing with this change passed successfully. I thought (and experimented a bit) to add new tests for Deflater/Inflater to catch these byte array indexing issues, but it wasn't straight forward and I would have to write the entire inflate/deflate test just to verify this issue. So I decided to leave out new tests for now in this PR.

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

Commit messages:
 - 8302664: Fix several incorrect usages of Preconditions.checkFromIndexSize

Changes: https://git.openjdk.org/jdk/pull/12595/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12595&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8302664
  Stats: 19 lines in 8 files changed: 0 ins; 0 del; 19 mod
  Patch: https://git.openjdk.org/jdk/pull/12595.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12595/head:pull/12595

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


More information about the i18n-dev mailing list