weizhouapache commented on pull request #4870: URL: https://github.com/apache/cloudstack/pull/4870#issuecomment-808492944
> 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 agree. I will update this pr. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
