Polish
This commit is contained in:
@@ -133,6 +133,7 @@ class ScopedProxyBeanRegistrationCodeFragmentsCustomizerTests {
|
||||
private void testCompile(BiConsumer<DefaultListableBeanFactory, Compiled> result) {
|
||||
BeanFactoryInitializationAotContribution contribution = this.processor
|
||||
.processAheadOfTime(this.beanFactory);
|
||||
assertThat(contribution).isNotNull();
|
||||
contribution.applyTo(this.generationContext, this.beanFactoryInitializationCode);
|
||||
this.generationContext.writeGeneratedContent();
|
||||
TestCompiler.forSystem().withFiles(this.generatedFiles).printFiles(System.out)
|
||||
@@ -151,7 +152,7 @@ class ScopedProxyBeanRegistrationCodeFragmentsCustomizerTests {
|
||||
}
|
||||
|
||||
|
||||
class MockBeanFactoryInitializationCode implements BeanFactoryInitializationCode {
|
||||
static class MockBeanFactoryInitializationCode implements BeanFactoryInitializationCode {
|
||||
|
||||
private final GeneratedMethods generatedMethods = new GeneratedMethods();
|
||||
|
||||
@@ -168,7 +169,7 @@ class ScopedProxyBeanRegistrationCodeFragmentsCustomizerTests {
|
||||
}
|
||||
|
||||
List<MethodReference> getInitializers() {
|
||||
return initializers;
|
||||
return this.initializers;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 6.0
|
||||
* @see GeneratedClassName
|
||||
*/
|
||||
public final class ClassNameGenerator {
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.function.Consumer;
|
||||
|
||||
import org.springframework.javapoet.MethodSpec;
|
||||
import org.springframework.javapoet.MethodSpec.Builder;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -34,6 +35,7 @@ public final class GeneratedMethod {
|
||||
|
||||
private final String name;
|
||||
|
||||
@Nullable
|
||||
private MethodSpec spec;
|
||||
|
||||
|
||||
@@ -84,7 +86,7 @@ public final class GeneratedMethod {
|
||||
}
|
||||
|
||||
private void assertNameHasNotBeenChanged(MethodSpec spec) {
|
||||
Assert.isTrue(this.name.toString().equals(spec.name), () -> String
|
||||
Assert.isTrue(this.name.equals(spec.name), () -> String
|
||||
.format("'spec' must use the generated name \"%s\"", this.name));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ public final class MethodReference {
|
||||
|
||||
private final Kind kind;
|
||||
|
||||
@Nullable
|
||||
private final ClassName declaringClass;
|
||||
|
||||
private final String methodName;
|
||||
@@ -109,6 +110,7 @@ public final class MethodReference {
|
||||
* Return the referenced declaring class.
|
||||
* @return the declaring class
|
||||
*/
|
||||
@Nullable
|
||||
public ClassName getDeclaringClass() {
|
||||
return this.declaringClass;
|
||||
}
|
||||
@@ -147,7 +149,7 @@ public final class MethodReference {
|
||||
};
|
||||
}
|
||||
|
||||
private CodeBlock toCodeBlockForInstance(String instanceVariable) {
|
||||
private CodeBlock toCodeBlockForInstance(@Nullable String instanceVariable) {
|
||||
instanceVariable = (instanceVariable != null) ? instanceVariable : "this";
|
||||
return CodeBlock.of("$L::$L", instanceVariable, this.methodName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user