Polish
This commit is contained in:
@@ -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