|
22 | 22 |
|
23 | 23 | import javax.lang.model.element.Modifier;
|
24 | 24 |
|
25 |
| -import org.springframework.aot.generate.AccessVisibility; |
| 25 | +import org.springframework.aot.generate.AccessControl; |
26 | 26 | import org.springframework.aot.generate.GeneratedMethod;
|
27 | 27 | import org.springframework.aot.generate.GenerationContext;
|
28 | 28 | import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
|
29 | 29 | import org.springframework.beans.factory.aot.BeanRegistrationCode;
|
30 | 30 | import org.springframework.beans.factory.aot.BeanRegistrationCodeFragments;
|
| 31 | +import org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator; |
31 | 32 | import org.springframework.beans.factory.support.InstanceSupplier;
|
32 | 33 | import org.springframework.beans.factory.support.RegisteredBean;
|
33 | 34 | import org.springframework.core.ResolvableType;
|
@@ -114,7 +115,7 @@ public RegisteredBean getSource() {
|
114 | 115 | * Class used to generate the fragment of code needed to define a {@link ManagedTypes} bean from previously discovered
|
115 | 116 | * managed types.
|
116 | 117 | */
|
117 |
| - static class ManagedTypesInstanceCodeFragment extends BeanRegistrationCodeFragments { |
| 118 | + static class ManagedTypesInstanceCodeFragment extends BeanRegistrationCodeFragmentsDecorator { |
118 | 119 |
|
119 | 120 | public static final ResolvableType LIST_TYPE = ResolvableType.forType(List.class);
|
120 | 121 | public static final ResolvableType MANAGED_TYPES_TYPE = ResolvableType.forType(ManagedTypes.class);
|
@@ -157,7 +158,7 @@ boolean canGenerateCode() {
|
157 | 158 | void generateInstanceFactory(Builder method) {
|
158 | 159 |
|
159 | 160 | boolean allSourceTypesVisible = sourceTypes.stream()
|
160 |
| - .allMatch(it -> AccessVisibility.PUBLIC.equals(AccessVisibility.forClass(it))); |
| 161 | + .allMatch(it -> AccessControl.forClass(it).isPublic()); |
161 | 162 |
|
162 | 163 | ParameterizedTypeName targetTypeName = ParameterizedTypeName.get(InstanceSupplier.class, source.getBeanClass());
|
163 | 164 |
|
|
0 commit comments