Skip to content

api: remove unused equals/hashCode from TemplateOVFPropertyResponse - #14049

Open
rootnomad wants to merge 1 commit into
apache:4.20from
rootnomad:fix/ovf-property-hashcode-npe
Open

rootnomad wants to merge 1 commit into
apache:4.20from
rootnomad:fix/ovf-property-hashcode-npe

Conversation

@rootnomad

Copy link
Copy Markdown
Collaborator

equals() tolerates a null key but hashCode() dereferenced it directly, so hashing an instance whose key was never set threw NullPointerException. These responses define equals/hashCode precisely so they can be collected in hash-based sets, making a null key a reachable state. Return 0 for a null key to match the null-safe equals().

Tested: new unit test TemplateOVFPropertyResponseTest (fails before, passes after)

@codecov

codecov Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.46%. Comparing base (2cd8c5e) to head (b67bac5).
⚠️ Report is 30 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #14049      +/-   ##
============================================
+ Coverage     16.34%   16.46%   +0.11%     
- Complexity    13574    13714     +140     
============================================
  Files          5669     5670       +1     
  Lines        501368   501763     +395     
  Branches      60903    60964      +61     
============================================
+ Hits          81964    82610     +646     
+ Misses       410219   409897     -322     
- Partials       9185     9256      +71     
Flag Coverage Δ
uitests 4.16% <ø> (+0.01%) ⬆️
unittests 17.33% <ø> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

TemplateOVFPropertyResponse is not referenced anywhere outside its own class: nothing keys it in a set or map or compares instances, so its equals()/hashCode() pair has no callers. hashCode() also dereferenced key without a null guard. Remove both methods rather than harden dead code, which also drops the NPE path.
@rootnomad
rootnomad force-pushed the fix/ovf-property-hashcode-npe branch from 7801830 to fa7e114 Compare September 5, 2026 11:08
@rootnomad rootnomad changed the title api: null-safe hashCode in TemplateOVFPropertyResponse api: remove unused equals/hashCode from TemplateOVFPropertyResponse Sep 5, 2026
@DaanHoogland DaanHoogland added this to the 4.20.4 milestone Sep 5, 2026
@rootnomad
rootnomad force-pushed the fix/ovf-property-hashcode-npe branch from fa7e114 to b67bac5 Compare December 2, 2026 16:12

This branch has not been deployed

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

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants