diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2018-08-08 17:00:41 -0700 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2018-08-08 17:00:41 -0700 |
commit | 6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 (patch) | |
tree | e575738adf52d24b883cca5e8928a5ded31caba1 /java/core/src/main/java/com/google/protobuf/Utf8.java | |
parent | e7746f487cb9cca685ffb1b3d7dccc5554b618a4 (diff) | |
download | protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.gz protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.bz2 protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.zip |
Down-integrate from google3.
Diffstat (limited to 'java/core/src/main/java/com/google/protobuf/Utf8.java')
-rw-r--r-- | java/core/src/main/java/com/google/protobuf/Utf8.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/core/src/main/java/com/google/protobuf/Utf8.java b/java/core/src/main/java/com/google/protobuf/Utf8.java index de75fe6b..b4a81ca3 100644 --- a/java/core/src/main/java/com/google/protobuf/Utf8.java +++ b/java/core/src/main/java/com/google/protobuf/Utf8.java @@ -42,7 +42,6 @@ import static java.lang.Character.isSurrogatePair; import static java.lang.Character.toCodePoint; import java.nio.ByteBuffer; -import java.util.Arrays; /** * A set of low-level, high-performance static utility methods related @@ -87,7 +86,9 @@ final class Utf8 { * delegate for which all methods are delegated directly to. */ private static final Processor processor = - UnsafeProcessor.isAvailable() ? new UnsafeProcessor() : new SafeProcessor(); + (UnsafeProcessor.isAvailable() && !Android.isOnAndroidDevice()) + ? new UnsafeProcessor() + : new SafeProcessor(); /** * A mask used when performing unsafe reads to determine if a long value contains any non-ASCII |