Remove unnecessary cast to Builder in generated Java lite code. (#10781)
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.
Closes #10781
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/10781 from 1e0ng:main e8f9c982fe
PiperOrigin-RevId: 532813058
pull/12843/head
parent
e285d3e307
commit
1662245963
1 changed files with 1 additions and 1 deletions
Loading…
Reference in new issue