mwiede / jsch

fork of the popular jsch library
Other
765 stars 144 forks source link

Replace old Hashtable with modern data structures. #624

Closed dbeliakov-r7 closed 3 months ago

dbeliakov-r7 commented 3 months ago

This PR replaces the old Hashtable with modern data structures. Hashtable is no longer maintained and is not optimised for better performance.

I replaced type declaration with the interface. Since Hashtable is-a Map, this is seamless. I replaced Hashtable with ConcurrentHashMap where multiple threads is expected to access the map, but ConcurrentHashMap handles it better (this could be improved further, but one step at a time). I replaced Hashtable with HashMap where synchronisation was unnecessary.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

norrisjeremy commented 3 months ago

I'm not sure I approve of this: it's not fixing any sort of bug nor is it likely fixing any serious performance issue. All it is doing is potentially introducing new subtle bugs or incompatibilities.