diff options
author | Chalard Jean <jchalard@google.com> | 2019-06-24 08:58:21 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-06-24 08:58:21 -0700 |
commit | 9bed101b79a64a2a7944e29c48700b3ac27b746d (patch) | |
tree | 9fadb3ab0206361d0626097645d0d18af3948a8f | |
parent | 91ab684a917e7da90c5ec113c5d8f3779d5bca77 (diff) | |
parent | af5cd6464057906f0b965a124fb2e9834bfd9abb (diff) |
Reword a comment am: 91ef22f947
am: af5cd64640
Change-Id: I638c539e25529d37d1d3d1f5aa56966dd12d5a33
-rw-r--r-- | tests/unit/src/android/net/testutils/HandlerUtilsTest.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/unit/src/android/net/testutils/HandlerUtilsTest.kt b/tests/unit/src/android/net/testutils/HandlerUtilsTest.kt index 910831f..c885874 100644 --- a/tests/unit/src/android/net/testutils/HandlerUtilsTest.kt +++ b/tests/unit/src/android/net/testutils/HandlerUtilsTest.kt @@ -42,9 +42,10 @@ class HandlerUtilsTest { // inline runnable that's instantiated at each loop run and a runnable that's instantiated // once for all. val tempRunnable = object : Runnable { - // StringBuilder is NOT thread-safe, and that's the point ; here it's part of the point - // that both runnables run on the same thread so if anything is wrong in that space - // it's better to use a class where things go wrong + // Use StringBuilder preferentially to StringBuffer because StringBuilder is NOT + // thread-safe. It's part of the point that both runnables run on the same thread + // so if anything is wrong in that space it's better to opportunistically use a class + // where things might go wrong, even if there is no guarantee of failure. var memory = StringBuilder() override fun run() { memory.append("b") |