This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/main by this push:
     new abf9b8805 AVRO-3982: Use `String.isEmpty()` instead (#2873)
abf9b8805 is described below

commit abf9b88052b29c541e354b56fe8c2b54c8b4dff8
Author: Fokko Driesprong <[email protected]>
AuthorDate: Tue Apr 30 15:10:40 2024 +0200

    AVRO-3982: Use `String.isEmpty()` instead (#2873)
---
 lang/java/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 22d032616..aacb83b88 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 abstract class BinaryEncoder extends Encoder {
 
   @Override
   public void writeString(String string) throws IOException {
-    if (0 == string.length()) {
+    if (string.isEmpty()) {
       writeZero();
       return;
     }

Reply via email to