diff --git a/lang/java/avro/src/main/java/org/apache/avro/Schema.java b/lang/java/avro/src/main/java/org/apache/avro/Schema.java index e86ae3e5b83..5434f18f852 100644 --- a/lang/java/avro/src/main/java/org/apache/avro/Schema.java +++ b/lang/java/avro/src/main/java/org/apache/avro/Schema.java @@ -717,7 +717,7 @@ public Name(String name, String space) { space = name.substring(0, lastDot); // get space from name this.name = validateName(name.substring(lastDot + 1)); } - this.space = "".equals(space) || space == null ? null : validateSpace(space); + this.space = space.isEmpty() || space == null ? null : validateSpace(space); this.full = (this.space == null) ? this.name : this.space + "." + this.name; }