kvm: remove unnecessary new String#4870
Conversation
There was a problem hiding this comment.
Thanks for this PR, @ustcweizhou. I am +1 on removing the String constructors, they should be avoided indeed.
I would also suggest externalizing them to constants, what do you think?
In terms of performance, I think that it does not change much being a constant or not. The way you are doing the String object is created only once. Java will detect the duplicated Strings in runtime and reuse them from the String's constant pool.
However, constants help code maintainability and readability. Especially on the duplicated Strings where a developer can easily change all occurrences by simply altering the constant.
@GabrielBrascher |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ centos7 ✔️ centos8 ✖️ debian. SL-JID 280 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-285)
|
|
pl wait with merging @rhtyd , I think @weizhouapache wants to externalise those strings to constants as well. |
|
@blueorangutan package |
|
@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ centos7 ✖️ centos8 ✔️ debian. SL-JID 295 |
GabrielBrascher
left a comment
There was a problem hiding this comment.
Thanks for the updates, @ustcweizhou.
Code LGTM.
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-324)
|
|
great work once a gain @weizhouapache. ok to merge @rhtyd / @shwstppr ? |
Description
Thanks @rubieHess to point it out.
see #4800 (comment)
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?