Remove unnecessary cast to Builder in generated Java lite code.
Fixes #5139
Previously the fix https://github.com/protocolbuffers/protobuf/pull/5247 has removed unnecessary cast to Builder in generated Java code, and the current PR is doing a similar one for Java lite code.
After this PR, both Java and Java lite code won't have an unnecessary cast to Builder, thus #5139 will be fixed.
This change simply removed those casts to Builder for 2 methods, and the reason it will work is:
DEFAULT_INSTANCE.createBuilder method is defined in the superclass, and the return value is a generic value which is exactly the Builder class passed in.
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.
@googleberg Hi Jerry, could you help take a look at this PR?
Hello @1e0ng, please sign the CLA and then I'll be happy to take a look.
Hello @1e0ng, please sign the CLA and then I'll be happy to take a look.
Yes, I have signed the CLA. I think it's the Mergeable check that fails but not sure why it mentions CLA check though.
@1e0ng I think the tests are repeating failures from an earlier breakage. Can you rebase your PR and we can try again?
Thanks for taking a look, @googleberg I have rebased my PR. Could you trigger the CI again?
It looks like the label java-lite is not an acceptable label. We might need to either add java-lite into the language list or just use java tag.
@googleberg could you help approve running workflows again? I just now rebased once more. Hopefully this time it works.
running
All the checks have passed now except one called "Mergeable", I'm out of clue why it fails now.
I think we are in good shape. We have an automated process to merge now and I think this is to prevent me from accidentally merging manually.
I see why now. It shows At least 2 approving reviews are required by reviewers with write access. Could you get one more approval from a reviewer with write access?
Please rebase this PR on main and we can move it forward.
Sorry for the trouble, you caught us in the middle of a migration to GitHub Actions.
Hi @haberman PR rebased.
Someone helps approve the workflow?
kicked the workflow, it looks like you are synced to a bad point. Can you rebase again? (sorry)
kicked the workflow, it looks like you are synced to a bad point. Can you rebase again? (sorry)
Ok, rebased again. Hopefully this time it works.
Hi @haberman did it work this time?