Browse Source

Merge pull request #42901 from ngocnhan-tran1996

* pr/42901:
  Update copyright year of changed files
  Remove redundant null check

Closes gh-42901
pull/42986/head
Stéphane Nicoll 1 year ago
parent
commit
0aff403234
  1. 4
      spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/QualifierDefinition.java
  2. 4
      spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptor.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -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);

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -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