When editing an old application, I see code like this:
As you can see, this is a Comparator subclass. It is used to sort Collection that could have thousands of MyClass objects.
In order to compare 2 MyClass objects, it makes use of their IDs, retrieved by the getId() method.
I just don't understand why it uses StringBuffer, then call StringBuffer.toString() to get another
String instance with same content as the original one......
Does String has any synchronization or concurrency issue, so that using a separate instance gives better performance??
(The original programmer is unknown so I can't ask him why.......)