Java 5: Unnecessary boxing

This commit is contained in:
Lars Grefer
2019-08-27 02:07:44 +02:00
committed by Rossen Stoyanchev
parent 7caa67f302
commit ab69df656d
5 changed files with 6 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ public class StringToCharacter extends StringToObject {
}
protected Object toObject(String string, Class<?> targetClass) {
return new Character(string.charAt(0));
return string.charAt(0);
}
protected String toString(Object object) {

View File

@@ -82,7 +82,7 @@ public class FacesFlowBuilderServicesBeanDefinitionParser extends AbstractSingle
private boolean parseEnableManagedBeans(Element element, BeanDefinitionBuilder definitionBuilder) {
String enableManagedBeans = element.getAttribute(ENABLE_MANAGED_BEANS_ATTR);
if (StringUtils.hasText(enableManagedBeans)) {
return Boolean.valueOf(enableManagedBeans);
return Boolean.parseBoolean(enableManagedBeans);
} else {
return false;
}

View File

@@ -370,7 +370,7 @@ public class MockExternalContext implements ExternalContext {
* @param responseAllowed true or false
*/
public void setResponseAllowed(boolean responseAllowed) {
this.responseAllowed = Boolean.valueOf(responseAllowed);
this.responseAllowed = responseAllowed;
}
/**

View File

@@ -45,8 +45,8 @@ public class LocalAttributeMapTests {
attributeMap.put("integer", 12345);
attributeMap.put("boolean", true);
attributeMap.put("long", 12345L);
attributeMap.put("double", new Double(12345));
attributeMap.put("float", new Float(12345));
attributeMap.put("double", 12345d);
attributeMap.put("float", 12345f);
attributeMap.put("bigDecimal", new BigDecimal("12345.67"));
attributeMap.put("bean", new TestBean());
attributeMap.put("stringArray", new String[] { "1", "2", "3" });

View File

@@ -37,7 +37,7 @@ public class TestBean {
}
public TestBean(long id, String name) {
this.entityId = new Long(id);
this.entityId = id;
this.name = name;
}