On Tue, 24 May 2022 16:23:52 GMT, Paul Sandoz <psan...@openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Tweak javadoc for ValueLayout::arrayElementVarHandle > > src/java.base/share/classes/java/lang/foreign/MemoryLayout.java line 374: > >> 372: * >> 373: * Additionally, the provided dynamic values must conform to some >> bound which is derived from the layout path, that is, >> 374: * {@code 0 <= x_i <= b_i}, where {@code 0 <= i <= n}, or {@link >> IndexOutOfBoundsException} is thrown. > > Suggestion: > > * {@code 0 <= x_i < b_i}, where {@code 1 <= i <= n}, or {@link > IndexOutOfBoundsException} is thrown. > > We refer later to `B` being an exclusive upper bound (computed using > `ceilDiv`). Indices start at zero. The ceilDiv operation is needed so that the operation returns the first index outisde the range (it's a bit subtle, sorry, but I don't know how else to express). ------------- PR: https://git.openjdk.java.net/jdk/pull/8868