Re: RFR: 8275106: Cleanup Iterator usages in java.desktop

2021-10-12 Thread Sergey Bylokhov
On Fri, 8 Oct 2021 19:37:35 GMT, Andrey Turbanov wrote: > Cycles with 'Iterator' are error-prone. It's better to use more high-level > code, which easier to read. > We can use enhanced-for or Collection.removeIf src/java.desktop/share/classes/javax/swing/JDesktopPane.java line 330: > 328:

RFR: 8275106: Cleanup Iterator usages in java.desktop

2021-10-12 Thread Andrey Turbanov
Cycles with 'Iterator' are error-prone. It's better to use more high-level code, which easier to read. We can use enhanced-for or Collection.removeIf - Commit messages: - [PATCH] Cleanup Iterator usages in java.desktop - [PATCH] Cleanup Iterator usages in java.desktop Changes: htt

Re: RFR: 8275106: Cleanup Iterator usages in java.desktop

2021-10-12 Thread Andrey Turbanov
On Tue, 12 Oct 2021 05:49:17 GMT, Sergey Bylokhov wrote: >> Cycles with 'Iterator' are error-prone. It's better to use more high-level >> code, which easier to read. >> We can use enhanced-for or Collection.removeIf > > src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java line 569: > >> 56

Re: RFR: 8269698: Specification for methods of java.awt.im.InputContext should mention that they do nothing [v3]

2021-10-12 Thread Alexander Zvegintsev
> This fix simply describes that the `java.awt.im.InputContext` is a dummy > implementation, which may not conform its spec. Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: use Objects.requireNonNull - Changes:

Re: RFR: 8269698: Specification for methods of java.awt.im.InputContext should mention that they do nothing [v2]

2021-10-12 Thread Alexander Zvegintsev
On Tue, 12 Oct 2021 06:07:53 GMT, Sergey Bylokhov wrote: >> Alexander Zvegintsev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> throw exceptions instead of doc change > > src/java.desktop/share/classes/java/awt/im/InputContext.java line

Re: RFR: 8269698: Specification for methods of java.awt.im.InputContext should mention that they do nothing [v3]

2021-10-12 Thread Sergey Bylokhov
On Tue, 12 Oct 2021 13:39:21 GMT, Alexander Zvegintsev wrote: >> This fix simply describes that the `java.awt.im.InputContext` is a dummy >> implementation, which may not conform its spec. > > Alexander Zvegintsev has updated the pull request incrementally with one > additional commit since th

Re: RFR: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes [v2]

2021-10-12 Thread Naoto Sato
On Mon, 11 Oct 2021 21:05:46 GMT, Andrey Turbanov wrote: >> src/java.base/share/classes/java/lang/Character.java line 123: >> >>> 121: * than U+ are called supplementary characters. The Java >>> 122: * platform uses the UTF-16 representation in {@code char} arrays and >>> 123: * in the {

Re: RFR: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes [v2]

2021-10-12 Thread Andrey Turbanov
> StringBuffer is a legacy synchronized class. There are more modern > alternatives which perform better: > 1. Plain String concatenation should be preferred > 2. StringBuilder is a direct replacement to StringBuffer which generally have > better performance > > In [JDK-8264029](https://bugs.ope

Re: RFR: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes [v2]

2021-10-12 Thread Andrey Turbanov
On Tue, 12 Oct 2021 20:33:20 GMT, Naoto Sato wrote: >> reverted changes in this spec. > > Did you modify the PR? I am unable to locate the revert. Oops. Forgot to push - PR: https://git.openjdk.java.net/jdk/pull/5432

Re: RFR: 8275106: Cleanup Iterator usages in java.desktop

2021-10-12 Thread Sergey Bylokhov
On Fri, 8 Oct 2021 19:37:35 GMT, Andrey Turbanov wrote: > Cycles with 'Iterator' are error-prone. It's better to use more high-level > code, which easier to read. > We can use enhanced-for or Collection.removeIf Marked as reviewed by serb (Reviewer). - PR: https://git.openjdk.java

Re: RFR: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes [v2]

2021-10-12 Thread Naoto Sato
On Tue, 12 Oct 2021 20:39:13 GMT, Andrey Turbanov wrote: >> StringBuffer is a legacy synchronized class. There are more modern >> alternatives which perform better: >> 1. Plain String concatenation should be preferred >> 2. StringBuilder is a direct replacement to StringBuffer which generally >