Hello! I managed to push the change by myself: http://hg.openjdk.java.net/jdk/jdk/rev/cfceb4df2499 This is my first push in a committer role. Hopefully I did not mess anything up.
With best regards, Tagir Valeev. On Thu, Dec 13, 2018 at 12:33 PM Tagir Valeev <amae...@gmail.com> wrote: > > Hello, Zheka! > > I'm not sure whether it's possible to commit a patch which is > partially contributed by another person. Probably you should submit it > separately? Also for complete patch a testcase would be necessary. > > With best regards, > Tagir Valeev. > On Thu, Dec 13, 2018 at 11:48 AM Zheka Kozlov <orionllm...@gmail.com> wrote: > > > > OK, this is a fixed version: > > > > @Override > > public void forEach(Consumer<? super E> action) { > > Objects.requireNonNull(action); > > final int n = this.n; > > final E e = this.element; > > for (int i = 0; i < n; i++) { > > action.accept(e); > > } > > } > > > > Tagir, can you add this to your patch? I signed the OCA. > > > > > > ср, 12 дек. 2018 г. в 11:25, Martin Buchholz <marti...@google.com>: > >> > >> I used to believe that, but apparently I was wrong. > >> https://openjdk.markmail.org/thread/rfqfultw35i2az45 > >> > >> On Tue, Dec 11, 2018 at 8:14 PM Zheka Kozlov <orionllm...@gmail.com> wrote: > >>> > >>> Would be better to add @Stable to the fields instead? (`n` and `element` > >>> are final, so @Stable is OK here) > >>> > >>> ср, 12 дек. 2018 г. в 11:02, Martin Buchholz <marti...@google.com>: > >>>>> > >>>>> In performance critical code, we don't trust hotspot to not reload > >>>>> final fields. Other forEach methods do this, e.g. > >>>> > >>>> > >>>> final Object[] es = queue; > >>>> for (int i = 0, n = size; i < n; i++) > >>>> action.accept((E) es[i]); > >>>>