Skip to content

Commit c5e95c2

Browse files
Follow API changes in Spring Framework.
Closes: #2698 See: spring-projects/spring-data-build#1809
1 parent 9e9ddbf commit c5e95c2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/main/java/org/springframework/data/aot/ManagedTypesRegistrationAotContribution.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222

2323
import javax.lang.model.element.Modifier;
2424

25-
import org.springframework.aot.generate.AccessVisibility;
25+
import org.springframework.aot.generate.AccessControl;
2626
import org.springframework.aot.generate.GeneratedMethod;
2727
import org.springframework.aot.generate.GenerationContext;
2828
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
2929
import org.springframework.beans.factory.aot.BeanRegistrationCode;
3030
import org.springframework.beans.factory.aot.BeanRegistrationCodeFragments;
31+
import org.springframework.beans.factory.aot.BeanRegistrationCodeFragmentsDecorator;
3132
import org.springframework.beans.factory.support.InstanceSupplier;
3233
import org.springframework.beans.factory.support.RegisteredBean;
3334
import org.springframework.core.ResolvableType;
@@ -114,7 +115,7 @@ public RegisteredBean getSource() {
114115
* Class used to generate the fragment of code needed to define a {@link ManagedTypes} bean from previously discovered
115116
* managed types.
116117
*/
117-
static class ManagedTypesInstanceCodeFragment extends BeanRegistrationCodeFragments {
118+
static class ManagedTypesInstanceCodeFragment extends BeanRegistrationCodeFragmentsDecorator {
118119

119120
public static final ResolvableType LIST_TYPE = ResolvableType.forType(List.class);
120121
public static final ResolvableType MANAGED_TYPES_TYPE = ResolvableType.forType(ManagedTypes.class);
@@ -157,7 +158,7 @@ boolean canGenerateCode() {
157158
void generateInstanceFactory(Builder method) {
158159

159160
boolean allSourceTypesVisible = sourceTypes.stream()
160-
.allMatch(it -> AccessVisibility.PUBLIC.equals(AccessVisibility.forClass(it)));
161+
.allMatch(it -> AccessControl.forClass(it).isPublic());
161162

162163
ParameterizedTypeName targetTypeName = ParameterizedTypeName.get(InstanceSupplier.class, source.getBeanClass());
163164

src/test/java/org/springframework/data/aot/AotTestCodeContributionBuilder.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222
import org.mockito.Mockito;
2323
import org.springframework.aot.test.generate.TestGenerationContext;
24-
import org.springframework.aot.test.generate.compile.Compiled;
25-
import org.springframework.aot.test.generate.compile.TestCompiler;
2624
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
2725
import org.springframework.beans.factory.aot.BeanRegistrationCodeFragments;
2826
import org.springframework.beans.factory.support.InstanceSupplier;
27+
import org.springframework.core.test.tools.Compiled;
28+
import org.springframework.core.test.tools.TestCompiler;
2929
import org.springframework.javapoet.CodeBlock;
3030
import org.springframework.javapoet.MethodSpec;
3131
import org.springframework.javapoet.ParameterizedTypeName;
@@ -89,6 +89,6 @@ public void compile() {
8989

9090
public void compile(Consumer<Compiled> compiled) {
9191
generationContext.writeGeneratedContent();
92-
TestCompiler.forSystem().withFiles(generationContext.getGeneratedFiles()).compile(compiled);
92+
TestCompiler.forSystem().with(generationContext).compile(compiled);
9393
}
9494
}

0 commit comments

Comments
 (0)