From abf9b88052b29c541e354b56fe8c2b54c8b4dff8 Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Tue, 30 Apr 2024 15:10:40 +0200 Subject: [PATCH] AVRO-3982: Use `String.isEmpty()` instead (#2873) --- .../avro/src/main/java/org/apache/avro/io/BinaryEncoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/avro/src/main/java/org/apache/avro/io/BinaryEncoder.java b/lang/java/avro/src/main/java/org/apache/avro/io/BinaryEncoder.java index 22d0326165c..aacb83b88f4 100644 --- a/lang/java/avro/src/main/java/org/apache/avro/io/BinaryEncoder.java +++ b/lang/java/avro/src/main/java/org/apache/avro/io/BinaryEncoder.java @@ -48,7 +48,7 @@ public void writeString(Utf8 utf8) throws IOException { @Override public void writeString(String string) throws IOException { - if (0 == string.length()) { + if (string.isEmpty()) { writeZero(); return; }