From e5f18798cace4a52fd769e92af58190e9a5b744a Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 13 Sep 2023 15:57:50 +0200 Subject: [PATCH] Revert deprecation of [Simple]CommandLinePropertySource This commit reverts the deprecation of CommandLinePropertySource and SimpleCommandLinePropertySource, since we have discovered that Spring Boot actively uses SimpleCommandLinePropertySource in org.springframework.boot.SpringApplication. Closes gh-31207 --- .../springframework/context/support/BeanDefinitionDslTests.kt | 1 - .../org/springframework/core/env/CommandLinePropertySource.java | 2 -- .../core/env/SimpleCommandLinePropertySource.java | 2 -- .../core/env/SimpleCommandLinePropertySourceTests.java | 1 - 4 files changed, 6 deletions(-) diff --git a/spring-context/src/test/kotlin/org/springframework/context/support/BeanDefinitionDslTests.kt b/spring-context/src/test/kotlin/org/springframework/context/support/BeanDefinitionDslTests.kt index 5716ab8156..e2bb589f80 100644 --- a/spring-context/src/test/kotlin/org/springframework/context/support/BeanDefinitionDslTests.kt +++ b/spring-context/src/test/kotlin/org/springframework/context/support/BeanDefinitionDslTests.kt @@ -76,7 +76,6 @@ class BeanDefinitionDslTests { } @Test - @Suppress("DEPRECATION") fun `Declare beans using environment condition with the functional Kotlin DSL`() { val beans = beans { bean() diff --git a/spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java b/spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java index 7819e7146f..c317f5e2dc 100644 --- a/spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java +++ b/spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java @@ -204,9 +204,7 @@ import org.springframework.util.StringUtils; * @see PropertySource * @see SimpleCommandLinePropertySource * @see JOptCommandLinePropertySource - * @deprecated since 6.1 with no plans for a replacement */ -@Deprecated(since = "6.1") public abstract class CommandLinePropertySource extends EnumerablePropertySource { /** The default name given to {@link CommandLinePropertySource} instances: {@value}. */ diff --git a/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java b/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java index 154fc9cf66..48015092c1 100644 --- a/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java +++ b/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java @@ -83,9 +83,7 @@ import org.springframework.util.StringUtils; * @since 3.1 * @see CommandLinePropertySource * @see JOptCommandLinePropertySource - * @deprecated since 6.1 with no plans for a replacement */ -@Deprecated(since = "6.1") public class SimpleCommandLinePropertySource extends CommandLinePropertySource { /** diff --git a/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java b/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java index c936558ff3..a4404332b7 100644 --- a/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java @@ -29,7 +29,6 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Sam Brannen * @since 3.1 */ -@SuppressWarnings("deprecation") class SimpleCommandLinePropertySourceTests { @Test