Re: [OpenJDK 2D-Dev] RFR: 8264428: Cleanup usages of StringBuffer in java.desktop [v3]
On Wed, 7 Apr 2021 15:21:40 GMT, Alexey Ivanov wrote: >> Andrey Turbanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop >> >> fix copyright year > > src/java.desktop/unix/classes/sun/awt/X11/XCreateWindowParams.java line 88: > >> 86: while (eIter.hasNext()) { >> 87: Map.Entry entry = eIter.next(); >> 88: buf.append(entry.getKey()).append(": >> ").append(entry.getValue()).append("\n"); > > Would it be clearer if each append was on its own line? > Suggestion: > > buf.append(entry.getKey()) >.append(": ") >.append(entry.getValue()) >.append("\n"); done - PR: https://git.openjdk.java.net/jdk/pull/3251
Re: [OpenJDK 2D-Dev] RFR: 8264428: Cleanup usages of StringBuffer in java.desktop [v3]
On Wed, 7 Apr 2021 06:39:48 GMT, Andrey Turbanov wrote: >> There are few possible cleanups in java.desktop related to legacy >> StringBuffer usages: >> 1. In few places StringBuffer can be replaced with plain String >> concatenation. >> 2. StringBuffer can be replaced with StringBuilder. StringBuilder has better >> performance as it is not thread-safe. >> 3. There are few places where result of string concatenation is passed to >> StringBuffer.append method. Using separate `.append` calls is more clear. >> 4. In few places primitives are unnecessary converted to String before >> `.append` call. They can be replaced with specialized methods (like >> `.append(int)` calls. > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop > > fix copyright year Marked as reviewed by aivanov (Reviewer). src/java.desktop/unix/classes/sun/awt/X11/XCreateWindowParams.java line 88: > 86: while (eIter.hasNext()) { > 87: Map.Entry entry = eIter.next(); > 88: buf.append(entry.getKey()).append(": > ").append(entry.getValue()).append("\n"); Would it be clearer if each append was on its own line? Suggestion: buf.append(entry.getKey()) .append(": ") .append(entry.getValue()) .append("\n"); - PR: https://git.openjdk.java.net/jdk/pull/3251
Re: [OpenJDK 2D-Dev] RFR: 8264428: Cleanup usages of StringBuffer in java.desktop [v3]
On Wed, 7 Apr 2021 06:39:48 GMT, Andrey Turbanov wrote: >> There are few possible cleanups in java.desktop related to legacy >> StringBuffer usages: >> 1. In few places StringBuffer can be replaced with plain String >> concatenation. >> 2. StringBuffer can be replaced with StringBuilder. StringBuilder has better >> performance as it is not thread-safe. >> 3. There are few places where result of string concatenation is passed to >> StringBuffer.append method. Using separate `.append` calls is more clear. >> 4. In few places primitives are unnecessary converted to String before >> `.append` call. They can be replaced with specialized methods (like >> `.append(int)` calls. > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop > > fix copyright year Marked as reviewed by azvegint (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/3251
Re: [OpenJDK 2D-Dev] RFR: 8264428: Cleanup usages of StringBuffer in java.desktop [v3]
> There are few possible cleanups in java.desktop related to legacy > StringBuffer usages: > 1. In few places StringBuffer can be replaced with plain String concatenation. > 2. StringBuffer can be replaced with StringBuilder. StringBuilder has better > performance as it is not thread-safe. > 3. There are few places where result of string concatenation is passed to > StringBuffer.append method. Using separate `.append` calls is more clear. > 4. In few places primitives are unnecessary converted to String before > `.append` call. They can be replaced with specialized methods (like > `.append(int)` calls. Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop fix copyright year - Changes: - all: https://git.openjdk.java.net/jdk/pull/3251/files - new: https://git.openjdk.java.net/jdk/pull/3251/files/80bff1db..963dc56e Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk=3251=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk=3251=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/3251.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/3251/head:pull/3251 PR: https://git.openjdk.java.net/jdk/pull/3251
Re: [OpenJDK 2D-Dev] RFR: 8264428: Cleanup usages of StringBuffer in java.desktop [v3]
On Tue, 30 Mar 2021 15:46:56 GMT, Alexander Zvegintsev wrote: >> Andrey Turbanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop >> >> fix copyright year > > src/java.desktop/windows/classes/sun/java2d/d3d/D3DContext.java line 139: > >> 137: @Override >> 138: public String toString() { >> 139: StringBuilder buf = new StringBuilder(super.toString()); > > Looks like this is the only file where copyright year is not updated. Thanks. Fixed. - PR: https://git.openjdk.java.net/jdk/pull/3251