Avoid unnecessary boxing/unboxing of primitives

Closes gh-25080
This commit is contained in:
Сергей Цыпанов
2020-05-14 16:39:04 +03:00
committed by Sam Brannen
parent 567265123b
commit 703d54677e
4 changed files with 7 additions and 7 deletions

View File

@@ -82,7 +82,7 @@ public class CharacterEditor extends PropertyEditorSupport {
setAsUnicode(text);
}
else if (text.length() == 1) {
setValue(Character.valueOf(text.charAt(0)));
setValue(text.charAt(0));
}
else {
throw new IllegalArgumentException("String [" + text + "] with length " +
@@ -103,7 +103,7 @@ public class CharacterEditor extends PropertyEditorSupport {
private void setAsUnicode(String text) {
int code = Integer.parseInt(text.substring(UNICODE_PREFIX.length()), 16);
setValue(Character.valueOf((char) code));
setValue((char) code);
}
}