Skip to content

Improvement of CharacterEditor.setAsText() and setAsUnicode() [SPR-12386] #16994

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions