Use auto boxing and unboxing where feasible

See gh-31916
This commit is contained in:
Yanming Zhou 2023-12-28 15:19:33 +08:00 committed by Stéphane Nicoll
parent 4a450c6fab
commit db2c532c07
7 changed files with 8 additions and 8 deletions

View File

@ -581,7 +581,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
*/ */
@Override @Override
public boolean isLazyInit() { public boolean isLazyInit() {
return (this.lazyInit != null && this.lazyInit.booleanValue()); return (this.lazyInit != null && this.lazyInit);
} }
/** /**

View File

@ -59,7 +59,7 @@ public class BeanDefinitionDefaults {
* @return whether to apply lazy-init semantics ({@code false} by default) * @return whether to apply lazy-init semantics ({@code false} by default)
*/ */
public boolean isLazyInit() { public boolean isLazyInit() {
return (this.lazyInit != null && this.lazyInit.booleanValue()); return (this.lazyInit != null && this.lazyInit);
} }
/** /**

View File

@ -2043,7 +2043,7 @@ class DataBinderTests {
binder.bind(pvs); binder.bind(pvs);
assertThat(tb.getIntegerList()).hasSize(257); assertThat(tb.getIntegerList()).hasSize(257);
assertThat(tb.getIntegerList()).element(256).isEqualTo(Integer.valueOf(1)); assertThat(tb.getIntegerList()).element(256).isEqualTo(1);
assertThat(binder.getBindingResult().getFieldValue("integerList[256]")).isEqualTo(1); assertThat(binder.getBindingResult().getFieldValue("integerList[256]")).isEqualTo(1);
} }

View File

@ -164,7 +164,7 @@ public class RequestContext {
* no explicit default given. * no explicit default given.
*/ */
public boolean isDefaultHtmlEscape() { public boolean isDefaultHtmlEscape() {
return (this.defaultHtmlEscape != null && this.defaultHtmlEscape.booleanValue()); return (this.defaultHtmlEscape != null && this.defaultHtmlEscape);
} }
/** /**

View File

@ -474,7 +474,7 @@ public class RequestContext {
* Is default HTML escaping active? Falls back to {@code false} in case of no explicit default given. * Is default HTML escaping active? Falls back to {@code false} in case of no explicit default given.
*/ */
public boolean isDefaultHtmlEscape() { public boolean isDefaultHtmlEscape() {
return (this.defaultHtmlEscape != null && this.defaultHtmlEscape.booleanValue()); return (this.defaultHtmlEscape != null && this.defaultHtmlEscape);
} }
/** /**
@ -493,7 +493,7 @@ public class RequestContext {
* @since 4.1.2 * @since 4.1.2
*/ */
public boolean isResponseEncodedHtmlEscape() { public boolean isResponseEncodedHtmlEscape() {
return (this.responseEncodedHtmlEscape == null || this.responseEncodedHtmlEscape.booleanValue()); return (this.responseEncodedHtmlEscape == null || this.responseEncodedHtmlEscape);
} }
/** /**

View File

@ -61,7 +61,7 @@ public abstract class HtmlEscapingAwareTag extends RequestContextAwareTag {
*/ */
protected boolean isHtmlEscape() { protected boolean isHtmlEscape() {
if (this.htmlEscape != null) { if (this.htmlEscape != null) {
return this.htmlEscape.booleanValue(); return this.htmlEscape;
} }
else { else {
return isDefaultHtmlEscape(); return isDefaultHtmlEscape();

View File

@ -111,7 +111,7 @@ public abstract class AbstractFormTag extends HtmlEscapingAwareTag {
@Override @Override
protected boolean isDefaultHtmlEscape() { protected boolean isDefaultHtmlEscape() {
Boolean defaultHtmlEscape = getRequestContext().getDefaultHtmlEscape(); Boolean defaultHtmlEscape = getRequestContext().getDefaultHtmlEscape();
return (defaultHtmlEscape == null || defaultHtmlEscape.booleanValue()); return (defaultHtmlEscape == null || defaultHtmlEscape);
} }