Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

[serde generate] java runtime: improve Bytes class #63

Merged
merged 1 commit into from
Sep 24, 2020
Merged

[serde generate] java runtime: improve Bytes class #63

merged 1 commit into from
Sep 24, 2020

Conversation

ma2bd
Copy link
Contributor

@ma2bd ma2bd commented Sep 23, 2020

Summary

  • Make the default constructor non-copying (does not prevent sharing but faster)
  • Create convenient safe APIs Bytes.empty() and Bytes.valueOf(content)

Test Plan

CI

@ma2bd ma2bd requested a review from xli September 23, 2020 19:08
@thefallentree
Copy link

can we consider use guava instead ?

https://guava.dev/releases/27.1-jre/api/docs/index.html?com/google/common/primitives/Bytes.html

in general this is the defacto standard for java these days

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 23, 2020
@ma2bd
Copy link
Contributor Author

ma2bd commented Sep 23, 2020

@thefallentree Good question. So far, we've managed to keep the LCS runtimes mostly dependency-free (the only exception I can remember is numpy in python). It seems a bit vexing to pull guava just for Bytes. (FWIW protobuf does not)

@ma2bd ma2bd merged commit 2392371 into novifinancial:master Sep 24, 2020
@ma2bd ma2bd deleted the serde_java_nits branch September 24, 2020 21:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants