From herrick at openjdk.java.net Mon Jan 11 01:56:56 2021 From: herrick at openjdk.java.net (Andy Herrick) Date: Mon, 11 Jan 2021 01:56:56 GMT Subject: Withdrawn: JDK-8189198: Add "forRemoval = true" to Applet APIs In-Reply-To: References: Message-ID: On Mon, 9 Nov 2020 13:56:33 GMT, Andy Herrick wrote: > JDK-8189198: Add "forRemoval = true" to Applet APIs This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From serb at openjdk.java.net Mon Jan 11 08:19:19 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 11 Jan 2021 08:19:19 GMT Subject: RFR: 8259522: Apply java.io.Serial annotations in java.desktop Message-ID: Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. This annotation can be applied to these methods in the module: private void writeObject(java.io.ObjectOutputStream stream) throws IOException private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException private void readObjectNoData() throws ObjectStreamException ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException private static final ObjectStreamField[] serialPersistentFields private static final long serialVersionUID Notes: - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. A similar fix was implemented for java.base module as well: http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html ------------- Commit messages: - Update TextAttribute.java - Update readResolve - Update writeReplace - Update readObject - Update writeObject - Update serialPersistentFields - Update serialVersionUID Changes: https://git.openjdk.java.net/jdk/pull/2020/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2020&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8259522 Stats: 3426 lines in 343 files changed: 2268 ins; 287 del; 871 mod Patch: https://git.openjdk.java.net/jdk/pull/2020.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2020/head:pull/2020 PR: https://git.openjdk.java.net/jdk/pull/2020 From aivanov at openjdk.java.net Tue Jan 12 20:25:56 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 12 Jan 2021 20:25:56 GMT Subject: RFR: 8259522: Apply java.io.Serial annotations in java.desktop In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 06:21:52 GMT, Sergey Bylokhov wrote: > Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. > > This annotation can be applied to these methods in the module: > > private void writeObject(java.io.ObjectOutputStream stream) throws IOException > private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException > private void readObjectNoData() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException > private static final ObjectStreamField[] serialPersistentFields > private static final long serialVersionUID > > Notes: > - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added > - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. > > A similar fix was implemented for java.base module as well: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html Marked as reviewed by aivanov (Reviewer). src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java line 42: > 40: */ > 41: @Serial > 42: private static final long serialVersionUID = 1L; This is the standard wording, yet should it mention the serialization is between the same versions only because the value of serialVersionUID is not unique? src/java.desktop/share/classes/java/awt/image/RasterFormatException.java line 28: > 26: package java.awt.image; > 27: > 28: Suggestion: In the majority of classes, there's only one empty line between package declaration and the first import statement. src/java.desktop/share/classes/java/awt/image/ImagingOpException.java line 28: > 26: package java.awt.image; > 27: > 28: Suggestion: ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Tue Jan 12 20:42:18 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 20:42:18 GMT Subject: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: References: Message-ID: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> > Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. > > This annotation can be applied to these methods in the module: > > private void writeObject(java.io.ObjectOutputStream stream) throws IOException > private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException > private void readObjectNoData() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException > private static final ObjectStreamField[] serialPersistentFields > private static final long serialVersionUID > > Notes: > - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added > - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. > > A similar fix was implemented for java.base module as well: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html Sergey Bylokhov has updated the pull request incrementally with two additional commits since the last revision: - Update src/java.desktop/share/classes/java/awt/image/ImagingOpException.java Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> - Update src/java.desktop/share/classes/java/awt/image/RasterFormatException.java Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2020/files - new: https://git.openjdk.java.net/jdk/pull/2020/files/2e50a258..502c1a40 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2020&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2020&range=00-01 Stats: 4 lines in 2 files changed: 0 ins; 4 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/2020.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2020/head:pull/2020 PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Tue Jan 12 20:42:19 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Tue, 12 Jan 2021 20:42:19 GMT Subject: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: References: Message-ID: On Tue, 12 Jan 2021 11:29:24 GMT, Alexey Ivanov wrote: >> Sergey Bylokhov has updated the pull request incrementally with two additional commits since the last revision: >> >> - Update src/java.desktop/share/classes/java/awt/image/ImagingOpException.java >> >> Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> >> - Update src/java.desktop/share/classes/java/awt/image/RasterFormatException.java >> >> Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> > > src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java line 42: > >> 40: */ >> 41: @Serial >> 42: private static final long serialVersionUID = 1L; > > This is the standard wording, yet should it mention the serialization is between the same versions only because the value of serialVersionUID is not unique? I think it is "quite" unique, the "1L" is used from the beginning. It is just different from the value which could be generated by the "serialver" but still should work fine. ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From aivanov at openjdk.java.net Tue Jan 12 21:58:14 2021 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Tue, 12 Jan 2021 21:58:14 GMT Subject: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: References: Message-ID: On Tue, 12 Jan 2021 20:36:21 GMT, Sergey Bylokhov wrote: >> src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java line 42: >> >>> 40: */ >>> 41: @Serial >>> 42: private static final long serialVersionUID = 1L; >> >> This is the standard wording, yet should it mention the serialization is between the same versions only because the value of serialVersionUID is not unique? > > I think it is "quite" unique, the "1L" is used from the beginning. It is just different from the value which could be generated by the "serialver" but still should work fine. Okay. There are several classes which extend this one, all of them use the same 1L value which makes it not "quite" unique. Changing the values at this time presents more risks than benefits. ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From psadhukhan at openjdk.java.net Wed Jan 13 06:13:57 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 13 Jan 2021 06:13:57 GMT Subject: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> References: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> Message-ID: <0BeCSRlVfit-78buTvO8-tci6rZDhwsML4JXKzujLM8=.ff5ba622-5c99-4925-b690-5b348d0d0e18@github.com> On Tue, 12 Jan 2021 20:42:18 GMT, Sergey Bylokhov wrote: >> Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. >> >> This annotation can be applied to these methods in the module: >> >> private void writeObject(java.io.ObjectOutputStream stream) throws IOException >> private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException >> private void readObjectNoData() throws ObjectStreamException >> ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException >> ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException >> private static final ObjectStreamField[] serialPersistentFields >> private static final long serialVersionUID >> >> Notes: >> - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added >> - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. >> >> A similar fix was implemented for java.base module as well: >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html > > Sergey Bylokhov has updated the pull request incrementally with two additional commits since the last revision: > > - Update src/java.desktop/share/classes/java/awt/image/ImagingOpException.java > > Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> > - Update src/java.desktop/share/classes/java/awt/image/RasterFormatException.java > > Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> Why do we add serialVersionUID in some classes like DefaultMutableTreeNode.java but not in other swing classes? Also, if this change is for stricter compile-time checking, shouldn't we remove @SuppressWarnings("serial") check? ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Wed Jan 13 07:07:54 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Wed, 13 Jan 2021 07:07:54 GMT Subject: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: <0BeCSRlVfit-78buTvO8-tci6rZDhwsML4JXKzujLM8=.ff5ba622-5c99-4925-b690-5b348d0d0e18@github.com> References: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> <0BeCSRlVfit-78buTvO8-tci6rZDhwsML4JXKzujLM8=.ff5ba622-5c99-4925-b690-5b348d0d0e18@github.com> Message-ID: On Wed, 13 Jan 2021 06:10:53 GMT, Prasanta Sadhukhan wrote: > Why do we add serialVersionUID in some classes like DefaultMutableTreeNode.java but not in other swing classes? Most Swing classes are marked by the specific "Warning" that "Same-version serialization only" is supported. (I think such a warning is missed in a few classes). So generally the serialVersionUID field is not needed in such classes, but if present this provides a small benefit -> this UID is not generated at runtime. For example, the DefaultMutableTreeNode was updated by the JDK-5017904 fix, which was unrelated to serialization but was targeted for the performance issue. > Also, if this change is for stricter compile-time checking, shouldn't we remove @SuppressWarnings("serial") check? At some point, we probably can remove it but will need to fix all serialization warnings which were disabled. ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From psadhukhan at openjdk.java.net Wed Jan 13 07:34:56 2021 From: psadhukhan at openjdk.java.net (Prasanta Sadhukhan) Date: Wed, 13 Jan 2021 07:34:56 GMT Subject: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2] In-Reply-To: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> References: <7X46pwNuTDGbEN3-jFa2QY2qUtMCK2dAu-BiPdoMK14=.19bc926b-62ba-4f79-8f32-be27898077a8@github.com> Message-ID: On Tue, 12 Jan 2021 20:42:18 GMT, Sergey Bylokhov wrote: >> Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. >> >> This annotation can be applied to these methods in the module: >> >> private void writeObject(java.io.ObjectOutputStream stream) throws IOException >> private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException >> private void readObjectNoData() throws ObjectStreamException >> ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException >> ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException >> private static final ObjectStreamField[] serialPersistentFields >> private static final long serialVersionUID >> >> Notes: >> - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added >> - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. >> >> A similar fix was implemented for java.base module as well: >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html > > Sergey Bylokhov has updated the pull request incrementally with two additional commits since the last revision: > > - Update src/java.desktop/share/classes/java/awt/image/ImagingOpException.java > > Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> > - Update src/java.desktop/share/classes/java/awt/image/RasterFormatException.java > > Co-authored-by: Aleksei Ivanov <70774172+aivanov-jdk at users.noreply.github.com> Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/2020 From serb at openjdk.java.net Fri Jan 15 00:31:01 2021 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 15 Jan 2021 00:31:01 GMT Subject: Integrated: 8259522: Apply java.io.Serial annotations in java.desktop In-Reply-To: References: Message-ID: On Mon, 11 Jan 2021 06:21:52 GMT, Sergey Bylokhov wrote: > Please review the application of @java.io.Serial annotation (JDK-8202385) to types in the desktop module to enable stricter compile-time checking of serialization-related declarations. > > This annotation can be applied to these methods in the module: > > private void writeObject(java.io.ObjectOutputStream stream) throws IOException > private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException > private void readObjectNoData() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException > ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException > private static final ObjectStreamField[] serialPersistentFields > private static final long serialVersionUID > > Notes: > - I have tried to update the comments for serialVersionUID as accurately as possible, but mostly based on the source code history and bugs in JBS where that field was added > - Some of the readObject/writeObject methods in the javax.swing package does not have a spec, because this package and some others are excluded from the serialization specification. > > A similar fix was implemented for java.base module as well: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html This pull request has now been integrated. Changeset: 978bed6c Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/978bed6c Stats: 3424 lines in 343 files changed: 2264 ins; 287 del; 873 mod 8259522: Apply java.io.Serial annotations in java.desktop Reviewed-by: aivanov, psadhukhan ------------- PR: https://git.openjdk.java.net/jdk/pull/2020