Skip to content

Conversation

@mrserb
Copy link
Member

@mrserb mrserb commented Jan 9, 2026

Please review the application of the @Serial annotation (JDK-8202385) to types in the java.management.* modules. The goal is to enable stricter compile-time checking of serialization-related declarations.

The change is not small. I could split it, but I decided to do it as a single change since covering the module in one shot is easier than managing a bunch of separate PRs.

Example of a similar change #24891.

Note: this annotation can be applied to these methods and 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

Additional changes:

  • Copyright years were updated
  • Imports were not touched much (no sorting or cleanup); the new import was added in a reasonable place
  • In several places static final long serialVersionUID = was changed to
    private static final long serialVersionUID =

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8374838: Apply java.io.Serial annotations in java.management.* (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29145/head:pull/29145
$ git checkout pull/29145

Update a local copy of the PR:
$ git checkout pull/29145
$ git pull https://git.openjdk.org/jdk.git pull/29145/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 29145

View PR using the GUI difftool:
$ git pr show -t 29145

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29145.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 9, 2026

👋 Welcome back serb! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 9, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org jmx jmx-dev@openjdk.org labels Jan 9, 2026
@openjdk
Copy link

openjdk bot commented Jan 9, 2026

@mrserb The following labels will be automatically applied to this pull request:

  • jmx
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@mrserb mrserb changed the title 8374838: Apply java.io.Serial annotations in javax.management.* 8374838: Apply java.io.Serial annotations in java.management.* Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jmx jmx-dev@openjdk.org serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

1 participant