Skip to content

fix(core): remove unreachable and bug-prone null guards in Attribute.equals - #8267

Open
Alwaysgaurav1 wants to merge 2 commits into
apache:mainfrom
Alwaysgaurav1:fix-attribute-equals-guards
Open

fix(core): remove unreachable and bug-prone null guards in Attribute.equals#8267
Alwaysgaurav1 wants to merge 2 commits into
apache:mainfrom
Alwaysgaurav1:fix-attribute-equals-guards

Conversation

@Alwaysgaurav1

Copy link
Copy Markdown

What changes were proposed in this PR?

In Attribute.java (common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/Attribute.java), Attribute.equals() contained two unreachable null guards:

if (this.attributeName == null) {
    return that.attributeName == null;
}
if (this.attributeType == null) {
    return that.attributeType == null; // ignores attribute name comparison!
}

…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 apache#8149
@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your first contribution to Texera, @Alwaysgaurav1!

If you're looking for a good place to start, browse issues labeled starter-task; they're scoped to be approachable for newcomers.

You can drive common housekeeping yourself by commenting one of these commands on its own line:

  • Issues. Comment /take to assign an open issue to yourself, or /untake to release it. You can find unclaimed work with the search filter is:issue is:open no:assignee.
  • Sub-issues. To link issues into a parent/child hierarchy, comment /sub-issue #5166 #5222 on the parent to attach those children (or /unsub-issue #5166 #5222 to detach them). From a child issue, comment /parent-issue #5166 to set its parent, or /unparent-issue to clear it (the current parent is detected automatically). References may be written as #5166 or as a bare 5166; cross-repository references are not supported.
  • Pull requests (author only). Comment /request-review @user to request a review from someone, or /unrequest-review @user to withdraw that request.

Each command must match exactly: /take this will not work, only /take does. For the full contribution flow, see CONTRIBUTING.md.

@github-actions
github-actions Bot requested a review from xuang7 August 31, 2026 06:13
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for opening this pull request, @Alwaysgaurav1!

It looks like the pull request description doesn't quite follow our template yet:

  • The How was this PR tested? section is missing; please keep the template's headings.
  • The Was this PR authored or co-authored using generative AI tooling? section is missing; please keep the template's headings.

Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.

You can find the template prompts by editing the description, or see CONTRIBUTING.md for the full contribution flow.

@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
⚠️ release/v1.3 Not labeled automatically — none of the files this PR modifies exist on this branch (common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/Attribute.java). The fix may target code that isn't on this release, or the files were moved/renamed after the branch was cut. Please check and add release/v1.3 by hand if this fix should be backported here.
release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @carloea2
    You can notify them by mentioning @carloea2 in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common fix release/v1.2 back porting to release/v1.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants