From 4682cf1ecc3a82fa4c895512d31ee456a0c0c06f Mon Sep 17 00:00:00 2001 From: alwaysgaurav1 Date: Mon, 31 Aug 2026 11:41:12 +0530 Subject: [PATCH] fix(core): remove unreachable and bug-prone null guards in Attribute.equals Remove unreachable null checks on this.attributeName and this.attributeType in Attribute.equals(), since the constructor enforces non-null for both fields via checkNotNull. This also removes the latent bug in the second guard where attributeName was ignored during comparison. Closes #8149 --- .../org/apache/texera/amber/core/tuple/Attribute.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/Attribute.java b/common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/Attribute.java index fb434e08752..0d87ba9911f 100644 --- a/common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/Attribute.java +++ b/common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/Attribute.java @@ -80,13 +80,6 @@ public boolean equals(Object toCompare) { Attribute that = (Attribute) toCompare; - if (this.attributeName == null) { - return that.attributeName == null; - } - if (this.attributeType == null) { - return that.attributeType == null; - } - return this.attributeName.equalsIgnoreCase(that.attributeName) && this.attributeType.equals(that.attributeType); }