protobuf
protobuf copied to clipboard
fix serialization warnings in generated code when compiling with Java 18 and above
Java 18 added additional linter checks as part of https://bugs.openjdk.java.net/browse/JDK-8274336 and https://bugs.openjdk.java.net/browse/JDK-8274335
These additional checks cause generated protobuf code to raise the following compiler warning: "non-transient instance field of a serializable class declared with a non-serializable type"
This change fixes the code generation to annotate the generated fields with the necessary suppressions to avoid false positives.
All the code generated from src/google/protobuf/*.proto now compiles successfully without serialization warnings in Java 18.
fixes #9673
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
@fowles any details on what the aarch64 failure might be?
@fowles any details on what the aarch64 failure might be?
Most likely a flake or bad sync point. Can you rebase onto tip of tree and I will rerun?
I kicked off a rerun of the failing test, let's see if maybe that will fix it. I believe the test infrastructure will run tests with the latest main
merged in, so there shouldn't be any need to do a rebase.
@googleberg I didn't see this change included in the latest release. Is there anything else we need to do? I'm not very familiar with the process.
@googleberg @acozzette @fowles I was hoping this would make it into one of the recent releases but I may not have followed the right process. Should I be submitting a new PR to cherry-pick this change into the 21.x branch to make sure it makes it into the next release?
@xvrl this would naturally end up in the next minor-version release (3.22). We don't typically merge non-critical changes into patch releases. We are hoping to establish a more regular cadence of minor releases this year.
👍 thanks for clarifying