Browse Source

Fix null assignment to non-nullable field

Update `BeanRegistrationCodeFragments` package-private constructor
to set `codeFragments` to `this` rather than `null`. The field
is never actually read by `DefaultBeanRegistrationCodeFragments` since
all methods are overridden.

Closes gh-28578
pull/28583/head
Phillip Webb 4 years ago
parent
commit
c01a2e897d
  1. 5
      spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeFragments.java

5
spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationCodeFragments.java

@ -60,10 +60,11 @@ public abstract class BeanRegistrationCodeFragments {
/** /**
* Package-private constructor exclusively for * Package-private constructor exclusively for
* {@link DefaultBeanRegistrationCodeFragments}. * {@link DefaultBeanRegistrationCodeFragments}. All methods are overridden
* so {@code this.codeFragments} is never actually used.
*/ */
BeanRegistrationCodeFragments() { BeanRegistrationCodeFragments() {
this.codeFragments = null; this.codeFragments = this;
} }
/** /**

Loading…
Cancel
Save