From f50b230fb3fc9b423a047f3f67d5461db06efbae Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 6 Jul 2023 17:28:24 +0200 Subject: [PATCH] Emphasize that a ContextCustomizer must implement equals() and hashCode() --- .../org/springframework/test/context/ContextCustomizer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/context/ContextCustomizer.java b/spring-test/src/main/java/org/springframework/test/context/ContextCustomizer.java index 3f3d1c2bc7c..0f9ac0a5661 100644 --- a/spring-test/src/main/java/org/springframework/test/context/ContextCustomizer.java +++ b/spring-test/src/main/java/org/springframework/test/context/ContextCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2023 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. @@ -25,7 +25,8 @@ import org.springframework.context.ConfigurableApplicationContext; * *

Customizers are created by {@link ContextCustomizerFactory} implementations. * - *

Implementations must implement correct {@code equals} and {@code hashCode} + *

WARNING: implementations must implement correct + * {@link Object#equals(Object) equals} and {@link Object#hashCode() hashCode} * methods since customizers form part of the {@link MergedContextConfiguration} * which is used as a cache key. *