RFR: 8370368: Apply java.io.Serial annotations in java.security.jgss [v3]

Sean Mullan mullan at openjdk.org
Thu Oct 23 22:55:02 UTC 2025


On Thu, 23 Oct 2025 22:47:56 GMT, Sean Mullan <mullan at openjdk.org> wrote:

>>> `errorCode` should have `@Serial` too.
>> 
>> I think you may have confused it with the `@serial` tag in Javadoc. This annotation can be applied to these methods/fields.
>>   * 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
>
> Yes, you are right, easy to mistake those two since they have the same name!

Since these are internal classes, I guess it is ok if the fields don't have the serial javadoc tag.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27925#discussion_r2457759976


More information about the security-dev mailing list