protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Remove unnecessary cast to Builder in generated Java lite code.

Open 1e0ng opened this issue 3 years ago • 12 comments

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.

1e0ng avatar Oct 16 '22 12:10 1e0ng

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.

google-cla[bot] avatar Oct 16 '22 12:10 google-cla[bot]

@googleberg Hi Jerry, could you help take a look at this PR?

1e0ng avatar Oct 16 '22 14:10 1e0ng

Hello @1e0ng, please sign the CLA and then I'll be happy to take a look.

googleberg avatar Oct 16 '22 16:10 googleberg

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 avatar Oct 17 '22 12:10 1e0ng

@1e0ng I think the tests are repeating failures from an earlier breakage. Can you rebase your PR and we can try again?

googleberg avatar Dec 12 '22 17:12 googleberg

Thanks for taking a look, @googleberg I have rebased my PR. Could you trigger the CI again?

1e0ng avatar Dec 13 '22 00:12 1e0ng

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.

1e0ng avatar Dec 13 '22 15:12 1e0ng

@googleberg could you help approve running workflows again? I just now rebased once more. Hopefully this time it works.

1e0ng avatar Dec 14 '22 13:12 1e0ng

running

googleberg avatar Dec 14 '22 17:12 googleberg

All the checks have passed now except one called "Mergeable", I'm out of clue why it fails now.

1e0ng avatar Dec 15 '22 02:12 1e0ng

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.

googleberg avatar Dec 15 '22 06:12 googleberg

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?

1e0ng avatar Dec 19 '22 01:12 1e0ng

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.

haberman avatar Feb 16 '23 22:02 haberman

Hi @haberman PR rebased.

1e0ng avatar Mar 08 '23 05:03 1e0ng

Someone helps approve the workflow?

1e0ng avatar Apr 05 '23 13:04 1e0ng

kicked the workflow, it looks like you are synced to a bad point. Can you rebase again? (sorry)

fowles avatar Apr 25 '23 18:04 fowles

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.

1e0ng avatar Apr 29 '23 11:04 1e0ng

Hi @haberman did it work this time?

1e0ng avatar May 17 '23 09:05 1e0ng