From 9911d91f088a7e9e36ff4a9fbeec0a303c0dcea2 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 21 Aug 2023 15:16:49 +0200 Subject: [PATCH 1/2] Add implementation note See gh-31083 --- .../support/DynamicPropertiesContextCustomizerFactory.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spring-test/src/main/java/org/springframework/test/context/support/DynamicPropertiesContextCustomizerFactory.java b/spring-test/src/main/java/org/springframework/test/context/support/DynamicPropertiesContextCustomizerFactory.java index 1f8e531a76d..7f9e3da7798 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/DynamicPropertiesContextCustomizerFactory.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/DynamicPropertiesContextCustomizerFactory.java @@ -55,6 +55,11 @@ class DynamicPropertiesContextCustomizerFactory implements ContextCustomizerFact } private void findMethods(Class testClass, Set methods) { + // Beginning with Java 16, inner classes may contain static members. + // We therefore need to search for @DynamicPropertySource methods in the + // current class after searching enclosing classes so that a local + // @DynamicPropertySource method can override properties registered in + // an enclosing class. if (TestContextAnnotationUtils.searchEnclosingClass(testClass)) { findMethods(testClass.getEnclosingClass(), methods); } From d0d0ed05788d8b0134fd0ffc9f6f6957add42239 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 21 Aug 2023 15:17:04 +0200 Subject: [PATCH 2/2] Update copyright headers --- .../main/java/org/springframework/aop/support/ClassFilters.java | 2 +- .../springframework/aop/support/NameMatchMethodPointcut.java | 2 +- .../web/servlet/mvc/method/annotation/ResponseBodyEmitter.java | 2 +- .../servlet/mvc/method/annotation/ReactiveTypeHandlerTests.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java b/spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java index 97e07ee91e6..7b2b4cc32de 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java index 5e930660540..753a16d7db5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java index fe845f274ce..b6f534a380d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 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. diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandlerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandlerTests.java index 793c77493bf..9d4f15bfb63 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandlerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 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.