-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Kang Baek-Kyu opened SPR-12386 and commented
The java.lang.Character.valueOf(char c) returns a Character instance representing the specified char value. If a new Character instance is not required, this method should generally be used in preference to the constructor Character(char), as this method is likely to yield significantly better space and time performance by caching frequently requested values.
This method will always cache values in the range '\u0000' to '\u007F', inclusive, and may cache other values outside of this range.
So I changed source like this
setValue(new Character(text.charAt(0)));
-> setValue(Character.valueOf(text.charAt(0)));
setValue(new Character((char)code));
-> setValue(Character.valueOf((char) code));
Affects: 4.1.1
Reference URL: #683
Referenced from: commits 1e9ab53