From 5a86162ff30433b8f54851842e0432a479719fd5 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 1 Sep 2020 10:06:17 +0200 Subject: [PATCH] Polish "Simplify code" See gh-23111 --- .../filter/AnnotationCustomizableTypeExcludeFilter.java | 2 +- .../web/servlet/WebDriverContextCustomizerFactory.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java index 1e4c7aeffe..94640ff18f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizerFactory.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizerFactory.java index e0b0b1d52c..2c2daad574 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizerFactory.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizerFactory.java @@ -53,7 +53,10 @@ class WebDriverContextCustomizerFactory implements ContextCustomizerFactory { if (obj == this) { return true; } - return obj != null && obj.getClass() == getClass(); + if (obj == null || obj.getClass() != getClass()) { + return false; + } + return true; } @Override