Commit f805e70
authored
fix: Avoid creating message string prematurely for streaming calls (#3622)
- Creating the string message prematurely puts a lot of strain on the
JVM and GC, switch to the format version of `Preconditions.checkState`
which only constructs the string if we throw the exception
- Issue: #3621
Thank you for opening a Pull Request! Before submitting your PR, please
read our [contributing
guidelines](https://github.com/googleapis/gapic-generator-java/blob/main/CONTRIBUTING.md).
There are a few things you can do to make sure it goes smoothly:
- [x] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/gapic-generator-java/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
Fixes #3621 ☕️1 parent c11360e commit f805e70
File tree
1 file changed
+4
-4
lines changed- gax-java/gax/src/main/java/com/google/api/gax/rpc
1 file changed
+4
-4
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
0 commit comments