On Wed, 6 Oct 2021 07:00:34 GMT, Andrey Turbanov <github.com+741251+turban...@openjdk.org> wrote:
>> There are few places in code where manual while loop is used with Iterator >> to iterate over Collection. >> Instead of manual while cycles it's preferred to use enhanced-for cycle >> instead: it's less verbose, makes code easier to read and it's less >> error-prone. >> It doesn't have any performance impact: java compiler generates similar code >> when compiling enhanced-for cycle. >> >> Similar cleanups: >> * https://bugs.openjdk.java.net/browse/JDK-8258006 >> * https://bugs.openjdk.java.net/browse/JDK-8257912 > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi > remove redundant spaces before casts There are still extra space in the file InvokableTypeImpl.java. src/jdk.jdi/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java line 144: > 142: List<InterfaceType> interfaces = interfaces(); > 143: for (InterfaceType interfaceType : interfaces) { > 144: InterfaceTypeImpl interfaze = (InterfaceTypeImpl) > interfaceType; There is still extra space at line 144. src/jdk.jdi/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java line 161: > 159: */ > 160: for (InterfaceType interfaceType : interfaces()) { > 161: InterfaceTypeImpl interfaze = (InterfaceTypeImpl) > interfaceType; Extra space at line 163. src/jdk.jdi/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java line 178: > 176: list.addAll(interfaces()); > 177: for (InterfaceType interfaceType : immediate) { > 178: InterfaceTypeImpl interfaze = (InterfaceTypeImpl) > interfaceType; Extra space at line 163. ------------- Marked as reviewed by sspitsyn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/5577