Replace Hashtable with LinkedHashMap in createIsoResponse#7844
Conversation
This change replaces the use of Hashtable with LinkedHashMap in the `createIsoResponse` method of `ViewResponseHelper`. The reason for this modification is to maintain the insertion order of entries, which isn't the case with Hashtable. This could lead to more predictable results and behaviors in calling methods.
|
thanks @CharlesQueiroz for the fix Hashtable is used many times in same class. can you fix the others as well ? @kiranchavala can you please verify it ? |
|
@blueorangutan package |
|
@kiranchavala a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6738 |
|
thanks @CharlesQueiroz for the update |
Changed Hashtable to LinkedHashMap in various response creation methods within ViewResponseHelper class. This modification ensures an ordered iteration which is beneficial for scenarios where the insertion order of responses needs to be maintained consistently.
2e4f724 to
5400927
Compare
Codecov Report
@@ Coverage Diff @@
## 4.18 #7844 +/- ##
============================================
- Coverage 13.02% 13.02% -0.01%
+ Complexity 9040 9039 -1
============================================
Files 2720 2720
Lines 257094 257094
Branches 40092 40092
============================================
- Hits 33491 33489 -2
- Misses 219398 219401 +3
+ Partials 4205 4204 -1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@blueorangutan package |
|
@weizhouapache a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6741 |
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM , Tested manually, the order of the ISO is maintained, able to move to the top/bottom and move one row up/down
|
@blueorangutan test rocky8 kvm-rocky8 |
|
@weizhouapache a [SF] Trillian-Jenkins test job (rocky8 mgmt + kvm-rocky8) has been kicked to run smoke tests |
yadvr
left a comment
There was a problem hiding this comment.
LGTM, didn't test it myself but changes and description makes sense.
I'm not sure if manual testing is needed, but any integration/marvin test would be great. Also I'm not sure of any consequences/side effects of this.
|
[SF] Trillian test result (tid-7374)
|
|
@blueorangutan test matrix |
|
@DaanHoogland a [SF] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7391)
|
|
[SF] Trillian test result (tid-7393)
|
|
[SF] Trillian test result (tid-7392)
|
|
@blueorangutan test matrix |
|
@weizhouapache a [SF] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
[SF] Trillian test result (tid-7410)
|
|
[SF] Trillian test result (tid-7412)
|
|
@blueorangutan package |
|
@soreana a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6787 |
|
[SF] Trillian test result (tid-7411)
|
|
Awesome work, congrats on your first merged pull request! |
Description
This change replaces Hashtable with LinkedHashMap in the
createIsoResponsemethod ofViewResponseHelper.This modification is to maintain the insertion order of entries, which isn't the case with Hashtable.
This solves the problem described here:
#7278
Related to the ordering of the ISOs table in CloudStack.
Currently, the order is not maintained because, when using a Hashtable, the insertion order gets lost when it tries to create the list on the API side.
Types of changes
Bug Severity