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
This commit is contained in:
Phillip Webb 2022-06-07 10:06:50 -07:00
parent 22ef3ec783
commit c01a2e897d
1 changed files with 3 additions and 2 deletions

View File

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