Skip to content

Commit 168d82e

Browse files
committed
Polish
1 parent d953978 commit 168d82e

File tree

13 files changed

+32
-33
lines changed

13 files changed

+32
-33
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public final Validator getTarget() {
5858
}
5959

6060
@Override
61-
public boolean supports(Class<?> clazz) {
62-
return this.target.supports(clazz);
61+
public boolean supports(Class<?> type) {
62+
return this.target.supports(type);
6363
}
6464

6565
@Override

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public boolean isClosed() {
178178
}
179179

180180
@Override
181-
public <T> T unwrap(Class<T> clazz) {
181+
public <T> T unwrap(Class<T> type) {
182182
throw new UnsupportedOperationException();
183183
}
184184

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapterTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ static class Wrapper implements SmartValidator {
157157
}
158158

159159
@Override
160-
public boolean supports(Class<?> clazz) {
161-
return this.delegate.supports(clazz);
160+
public boolean supports(Class<?> type) {
161+
return this.delegate.supports(type);
162162
}
163163

164164
@Override

spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/messageconverters/AdditionalHttpMessageConverter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
class AdditionalHttpMessageConverter extends AbstractHttpMessageConverter<Object> {
2828

2929
@Override
30-
protected boolean supports(Class<?> clazz) {
30+
protected boolean supports(Class<?> type) {
3131
return false;
3232
}
3333

3434
@Override
35-
protected Object readInternal(Class<?> clazz, HttpInputMessage inputMessage)
35+
protected Object readInternal(Class<?> type, HttpInputMessage inputMessage)
3636
throws IOException, HttpMessageNotReadableException {
3737
return null;
3838
}
3939

4040
@Override
41-
protected void writeInternal(Object t, HttpOutputMessage outputMessage)
41+
protected void writeInternal(Object instance, HttpOutputMessage outputMessage)
4242
throws IOException, HttpMessageNotWritableException {
4343
}
4444

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/messageconverters/AdditionalHttpMessageConverter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ import java.io.IOException
2525

2626
open class AdditionalHttpMessageConverter : AbstractHttpMessageConverter<Any>() {
2727

28-
override fun supports(clazz: Class<*>): Boolean {
28+
override fun supports(type: Class<*>): Boolean {
2929
return false
3030
}
3131

3232
@Throws(IOException::class, HttpMessageNotReadableException::class)
33-
override fun readInternal(clazz: Class<*>, inputMessage: HttpInputMessage): Any {
33+
override fun readInternal(type: Class<*>, inputMessage: HttpInputMessage): Any {
3434
return Any()
3535
}
3636

3737
@Throws(IOException::class, HttpMessageNotWritableException::class)
38-
override fun writeInternal(t: Any, outputMessage: HttpOutputMessage) {
38+
override fun writeInternal(instance: Any, outputMessage: HttpOutputMessage) {
3939
}
4040

4141
}

spring-boot-project/spring-boot-test-autoconfigure/src/dockerTest/java/org/springframework/boot/test/autoconfigure/data/neo4j/ExampleService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public ExampleService(Neo4jTemplate neo4jTemplate) {
3434
this.neo4jTemplate = neo4jTemplate;
3535
}
3636

37-
public boolean hasNode(Class<?> clazz) {
38-
return this.neo4jTemplate.count(clazz) == 1;
37+
public boolean hasNode(Class<?> type) {
38+
return this.neo4jTemplate.count(type) == 1;
3939
}
4040

4141
}

spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ private void addDefinition(AnnotatedElement element, Definition definition, Stri
115115

116116
private Set<ResolvableType> getOrDeduceTypes(AnnotatedElement element, Class<?>[] value, Class<?> source) {
117117
Set<ResolvableType> types = new LinkedHashSet<>();
118-
for (Class<?> clazz : value) {
119-
types.add(ResolvableType.forClass(clazz));
118+
for (Class<?> type : value) {
119+
types.add(ResolvableType.forClass(type));
120120
}
121121
if (types.isEmpty() && element instanceof Field field) {
122122
types.add((field.getGenericType() instanceof TypeVariable) ? ResolvableType.forField(field, source)

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ void load() {
132132

133133
private void load(Object source) {
134134
Assert.notNull(source, "Source must not be null");
135-
if (source instanceof Class<?> clazz) {
136-
load(clazz);
135+
if (source instanceof Class<?> type) {
136+
load(type);
137137
return;
138138
}
139139
if (source instanceof Resource resource) {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonMixinModuleEntries.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,11 @@ private static void registerMixinClass(Builder builder, Class<?> mixinClass) {
9191
.from(mixinClass, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY)
9292
.get(JsonMixin.class);
9393
Class<?>[] types = annotation.getClassArray("type");
94-
Assert.notEmpty(types,
95-
"@JsonMixin annotation on class '" + mixinClass.getName() + "' does not specify any types");
96-
for (Class<?> targetType : types) {
97-
builder.and(targetType, mixinClass);
94+
Assert.state(!ObjectUtils.isEmpty(types),
95+
() -> "@JsonMixin annotation on class '" + mixinClass.getName() + "' does not specify any types");
96+
for (Class<?> type : types) {
97+
builder.and(type, mixinClass);
9898
}
99-
10099
}
101100

102101
/**
@@ -110,8 +109,8 @@ public void doWithEntry(ClassLoader classLoader, BiConsumer<Class<?>, Class<?>>
110109
resolveClassNameIfNecessary(mixin, classLoader)));
111110
}
112111

113-
private Class<?> resolveClassNameIfNecessary(Object type, ClassLoader classLoader) {
114-
return (type instanceof Class<?> clazz) ? clazz : ClassUtils.resolveClassName((String) type, classLoader);
112+
private Class<?> resolveClassNameIfNecessary(Object nameOrType, ClassLoader classLoader) {
113+
return (nameOrType instanceof Class<?> type) ? type : ClassUtils.resolveClassName((String) nameOrType, classLoader);
115114
}
116115

117116
/**

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/JavaVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ public enum JavaVersion {
8383

8484
private final boolean available;
8585

86-
JavaVersion(String name, Class<?> clazz, String methodName) {
86+
JavaVersion(String name, Class<?> versionSpecificClass, String versionSpecificMethod) {
8787
this.name = name;
88-
this.available = ClassUtils.hasMethod(clazz, methodName);
88+
this.available = ClassUtils.hasMethod(versionSpecificClass, versionSpecificMethod);
8989
}
9090

9191
@Override

0 commit comments

Comments
 (0)