Polishing Optional usage

This commit is contained in:
Yanming Zhou
2024-03-11 15:58:31 +08:00
committed by Juergen Hoeller
parent 4e5723ca9e
commit 246e4977a2
4 changed files with 8 additions and 10 deletions

View File

@@ -277,7 +277,7 @@ class AutowiredConfigurationTests {
@Bean
public TestBean testBean(Optional<Colour> colour, Optional<List<Colour>> colours) {
if (!colour.isPresent() && !colours.isPresent()) {
if (colour.isEmpty() && colours.isEmpty()) {
return new TestBean("");
}
else {