Re: RFR: 8272756: Remove unnecessary explicit initialization of volatile variables in java.desktop [v2]
> This is a continuation of > > - https://bugs.openjdk.java.net/browse/JDK-6736490 > - https://bugs.openjdk.java.net/browse/JDK-8035284 > - https://bugs.openjdk.java.net/browse/JDK-8145680 > - https://bugs.openjdk.java.net/browse/JDK-8251548 > > As mentioned in JDK-6736490: > > _An explicit initialization of a volatile class instance variable, such as > private volatile Object = null; or private volatile int scale = 0; is > unnecessary since the Java spec automatically initializes objects to null and > primitive type short, int, long, float and double to 0 and boolean to false. > Explicit initialization of volatile variable to a value the same as the > default implicit initialized value results in an unnecessary store and membar > operation._ Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: 8272756: Remove unnecessary explicit initialization of volatile fields in java.desktop - Changes: - all: https://git.openjdk.java.net/jdk/pull/5197/files - new: https://git.openjdk.java.net/jdk/pull/5197/files/d06aff5b..a3558d0a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5197&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5197&range=00-01 Stats: 4 lines in 3 files changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/5197.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5197/head:pull/5197 PR: https://git.openjdk.java.net/jdk/pull/5197
Re: RFR: 8272756: Remove unnecessary explicit initialization of volatile variables in java.desktop
On Mon, 20 Sep 2021 11:55:43 GMT, Andrey Turbanov wrote: >> This is a continuation of >> >> - https://bugs.openjdk.java.net/browse/JDK-6736490 >> - https://bugs.openjdk.java.net/browse/JDK-8035284 >> - https://bugs.openjdk.java.net/browse/JDK-8145680 >> - https://bugs.openjdk.java.net/browse/JDK-8251548 >> >> As mentioned in JDK-6736490: >> >> _An explicit initialization of a volatile class instance variable, such as >> private volatile Object = null; or private volatile int scale = 0; is >> unnecessary since the Java spec automatically initializes objects to null >> and primitive type short, int, long, float and double to 0 and boolean to >> false. Explicit initialization of volatile variable to a value the same as >> the default implicit initialized value results in an unnecessary store and >> membar operation._ > > As I can see there are a few more zero-initializations of volatiles. Are they > intentionally skipped? > 1. sun.lwawt.macosx.CPlatformEmbeddedFrame#screenX > 2. sun.lwawt.macosx.CPlatformEmbeddedFrame#screenY > 3. sun.lwawt.macosx.CWarningWindow#currentIcon > 4. com.sun.media.sound.SoftSynthesizer.WeakAudioStream#silent_samples @turbanoff nice catch! I've missed them in my original commit, no intention here. I've included them either. - PR: https://git.openjdk.java.net/jdk/pull/5197
Re: RFR: 8272756: Remove unnecessary explicit initialization of volatile variables in java.desktop [v2]
On Tue, 21 Sep 2021 11:37:42 GMT, Сергей Цыпанов wrote: >> This is a continuation of >> >> - https://bugs.openjdk.java.net/browse/JDK-6736490 >> - https://bugs.openjdk.java.net/browse/JDK-8035284 >> - https://bugs.openjdk.java.net/browse/JDK-8145680 >> - https://bugs.openjdk.java.net/browse/JDK-8251548 >> >> As mentioned in JDK-6736490: >> >> _An explicit initialization of a volatile class instance variable, such as >> private volatile Object = null; or private volatile int scale = 0; is >> unnecessary since the Java spec automatically initializes objects to null >> and primitive type short, int, long, float and double to 0 and boolean to >> false. Explicit initialization of volatile variable to a value the same as >> the default implicit initialized value results in an unnecessary store and >> membar operation._ > > Сергей Цыпанов has updated the pull request incrementally with one additional > commit since the last revision: > > 8272756: Remove unnecessary explicit initialization of volatile fields in > java.desktop Marked as reviewed by turban...@github.com (no known OpenJDK username). - PR: https://git.openjdk.java.net/jdk/pull/5197
RFR: 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add()
Fixing an AIOOBE on normalizing the month value. - Commit messages: - 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add() Changes: https://git.openjdk.java.net/jdk/pull/5611/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5611&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8273924 Stats: 26 lines in 3 files changed: 24 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/5611.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5611/head:pull/5611 PR: https://git.openjdk.java.net/jdk/pull/5611
Re: RFR: 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add()
On Tue, 21 Sep 2021 12:47:00 GMT, Naoto Sato wrote: > Fixing an AIOOBE on normalizing the month value. Marked as reviewed by rriggs (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5611
Re: RFR: 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add()
On Tue, 21 Sep 2021 12:47:00 GMT, Naoto Sato wrote: > Fixing an AIOOBE on normalizing the month value. Marked as reviewed by iris (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5611
RFR: 8273546: DecimalFormat documentation contains literal HTML character references
Simple doc fix. - Commit messages: - 8273546: DecimalFormat documentation contains literal HTML character references Changes: https://git.openjdk.java.net/jdk/pull/5620/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5620&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8273546 Stats: 14 lines in 3 files changed: 0 ins; 0 del; 14 mod Patch: https://git.openjdk.java.net/jdk/pull/5620.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5620/head:pull/5620 PR: https://git.openjdk.java.net/jdk/pull/5620
Re: RFR: 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add()
On Tue, 21 Sep 2021 12:47:00 GMT, Naoto Sato wrote: > Fixing an AIOOBE on normalizing the month value. Marked as reviewed by joehw (Reviewer). src/java.base/share/classes/sun/util/calendar/BaseCalendar.java line 281: > 279: month = 13 - (xm % 12); > 280: if (month == 13) { > 281: year ++; Not that it matters, just happen to see it ;-). Is it more common to have no space before the increment operator? Code convention seems to suggest no space before increment and their operands. No update needed should you decide to remove it. - PR: https://git.openjdk.java.net/jdk/pull/5611
Re: RFR: 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add() [v2]
On Tue, 21 Sep 2021 22:03:30 GMT, Joe Wang wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed the unnecessary space > > src/java.base/share/classes/sun/util/calendar/BaseCalendar.java line 281: > >> 279: month = 13 - (xm % 12); >> 280: if (month == 13) { >> 281: year ++; > > Not that it matters, just happen to see it ;-). Is it more common to have no > space before the increment operator? Code convention seems to suggest no > space before increment and their operands. > No update needed should you decide to remove it. Thanks. Indeed it was in the coding convention. Removed. - PR: https://git.openjdk.java.net/jdk/pull/5611
Re: RFR: 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add() [v2]
> Fixing an AIOOBE on normalizing the month value. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Removed the unnecessary space - Changes: - all: https://git.openjdk.java.net/jdk/pull/5611/files - new: https://git.openjdk.java.net/jdk/pull/5611/files/92f81963..98612bf5 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5611&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5611&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/5611.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5611/head:pull/5611 PR: https://git.openjdk.java.net/jdk/pull/5611
Re: RFR: 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add() [v2]
On Tue, 21 Sep 2021 22:18:07 GMT, Naoto Sato wrote: >> Fixing an AIOOBE on normalizing the month value. > > Naoto Sato has updated the pull request incrementally with one additional > commit since the last revision: > > Removed the unnecessary space Marked as reviewed by joehw (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5611
Re: RFR: 8273546: DecimalFormat documentation contains literal HTML character references
On Tue, 21 Sep 2021 21:45:40 GMT, Naoto Sato wrote: > Simple doc fix. Marked as reviewed by joehw (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5620
Re: RFR: 8273546: DecimalFormat documentation contains literal HTML character references
On Tue, 21 Sep 2021 21:45:40 GMT, Naoto Sato wrote: > Simple doc fix. Marked as reviewed by bpb (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5620
Re: RFR: 8273546: DecimalFormat documentation contains literal HTML character references
On Tue, 21 Sep 2021 21:45:40 GMT, Naoto Sato wrote: > Simple doc fix. Marked as reviewed by iris (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5620
Re: RFR: 8273924: ArrayIndexOutOfBoundsException thrown in java.util.JapaneseImperialCalendar.add() [v2]
On Tue, 21 Sep 2021 22:18:07 GMT, Naoto Sato wrote: >> Fixing an AIOOBE on normalizing the month value. > > Naoto Sato has updated the pull request incrementally with one additional > commit since the last revision: > > Removed the unnecessary space Marked as reviewed by iris (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5611
Re: RFR: 8273546: DecimalFormat documentation contains literal HTML character references
On Tue, 21 Sep 2021 21:45:40 GMT, Naoto Sato wrote: > Simple doc fix. Marked as reviewed by lancea (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5620