Skip to content

Conversation

phraktle
Copy link
Contributor

@phraktle phraktle commented Sep 9, 2014

Use the cleaner and slightly faster getBytes on Strings.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Sep 9, 2014

Please sign this Google Individual Contributor License Agreement:
https://developers.google.com/open-source/cla/individual?csw=1

and let me know when you are done. It's required for us to use your code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a public method. Removing it will break existing clients. Please keep the old one and add a new method instead.

@phraktle
Copy link
Contributor Author

Filled out the CLA as requested. Will look into re-adding the method w/ the original signature shortly.

@phraktle
Copy link
Contributor Author

Do you think the original method should be marked @deprecated ?

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Sep 10, 2014

No. The original method is used widely in our internal code base. Unless we are willing to do a global clean-up and replace all call-sites (which will take weeks or months and isn't worthwhile in this case), we shouldn't mark the old method as deprecated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove use of this StandardCharsets.

This StandardCharsets is introduced only since jdk 1.7. Our library supports back to jdk 1.5. We probably can drop 1.5 support soon but I believe jdk 1.6 will be supported for quite some time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed use of StandardCharsets. Since String#getBytes(Charset) was introduced in jdk 1.6 (which is the whole point of this change), support for jdk 1.5 cannot be provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test both ByteString.toString(String) and ByteString.toString(Charset) here (you added a test case for the latter but removed the test case for the former).

@xfxyjwf xfxyjwf closed this in #264 Apr 2, 2015
TeBoring pushed a commit to TeBoring/protobuf that referenced this pull request Jan 19, 2019
yordis pushed a commit to yordis/protobuf that referenced this pull request Dec 8, 2024
…in-oneof

Fix scalar types in oneof for proto3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants