Browse Source

Remove redundant null check

See gh-42901
pull/42986/head
Tran Ngoc Nhan 1 year ago committed by Stéphane Nicoll
parent
commit
ff855d9421
  1. 2
      spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/QualifierDefinition.java
  2. 2
      spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptor.java

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

@ -78,7 +78,7 @@ class QualifierDefinition { @@ -78,7 +78,7 @@ class QualifierDefinition {
}
static QualifierDefinition forElement(AnnotatedElement element) {
if (element != null && element instanceof Field field) {
if (element instanceof Field field) {
Set<Annotation> annotations = getQualifierAnnotations(field);
if (!annotations.isEmpty()) {
return new QualifierDefinition(field, annotations);

2
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptor.java

@ -176,7 +176,7 @@ abstract class PropertyDescriptor<S extends Element> { @@ -176,7 +176,7 @@ abstract class PropertyDescriptor<S extends Element> {
}
returnType = getTopLevelType(returnType);
Element candidate = element;
while (candidate != null && candidate instanceof TypeElement) {
while (candidate instanceof TypeElement) {
if (returnType.equals(getTopLevelType(candidate))) {
return true;
}

Loading…
Cancel
Save