Skip to content

Commit 7df2e2a

Browse files
committed
Remove APIs deprecated for removal in 6.1
This is the first commit that removes deprecated APIs. Subsequent commits will remove additional deprecated APIs. See gh-29449
1 parent d446de6 commit 7df2e2a

File tree

13 files changed

+58
-508
lines changed

13 files changed

+58
-508
lines changed

Diff for: spring-core/src/main/java/org/springframework/core/task/support/ConcurrentExecutorAdapter.java

-61
This file was deleted.

Diff for: spring-core/src/main/java/org/springframework/util/Assert.java

+1-122
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -98,17 +98,6 @@ public static void state(boolean expression, Supplier<String> messageSupplier) {
9898
}
9999
}
100100

101-
/**
102-
* Assert a boolean expression, throwing an {@code IllegalStateException}
103-
* if the expression evaluates to {@code false}.
104-
* @deprecated as of 4.3.7, in favor of {@link #state(boolean, String)};
105-
* to be removed in 6.1
106-
*/
107-
@Deprecated(forRemoval = true)
108-
public static void state(boolean expression) {
109-
state(expression, "[Assertion failed] - this state invariant must be true");
110-
}
111-
112101
/**
113102
* Assert a boolean expression, throwing an {@code IllegalArgumentException}
114103
* if the expression evaluates to {@code false}.
@@ -141,17 +130,6 @@ public static void isTrue(boolean expression, Supplier<String> messageSupplier)
141130
}
142131
}
143132

144-
/**
145-
* Assert a boolean expression, throwing an {@code IllegalArgumentException}
146-
* if the expression evaluates to {@code false}.
147-
* @deprecated as of 4.3.7, in favor of {@link #isTrue(boolean, String)};
148-
* to be removed in 6.1
149-
*/
150-
@Deprecated(forRemoval = true)
151-
public static void isTrue(boolean expression) {
152-
isTrue(expression, "[Assertion failed] - this expression must be true");
153-
}
154-
155133
/**
156134
* Assert that an object is {@code null}.
157135
* <pre class="code">Assert.isNull(value, "The value must be null");</pre>
@@ -182,16 +160,6 @@ public static void isNull(@Nullable Object object, Supplier<String> messageSuppl
182160
}
183161
}
184162

185-
/**
186-
* Assert that an object is {@code null}.
187-
* @deprecated as of 4.3.7, in favor of {@link #isNull(Object, String)};
188-
* to be removed in 6.1
189-
*/
190-
@Deprecated(forRemoval = true)
191-
public static void isNull(@Nullable Object object) {
192-
isNull(object, "[Assertion failed] - the object argument must be null");
193-
}
194-
195163
/**
196164
* Assert that an object is not {@code null}.
197165
* <pre class="code">Assert.notNull(clazz, "The class must not be null");</pre>
@@ -223,16 +191,6 @@ public static void notNull(@Nullable Object object, Supplier<String> messageSupp
223191
}
224192
}
225193

226-
/**
227-
* Assert that an object is not {@code null}.
228-
* @deprecated as of 4.3.7, in favor of {@link #notNull(Object, String)};
229-
* to be removed in 6.1
230-
*/
231-
@Deprecated(forRemoval = true)
232-
public static void notNull(@Nullable Object object) {
233-
notNull(object, "[Assertion failed] - this argument is required; it must not be null");
234-
}
235-
236194
/**
237195
* Assert that the given String is not empty; that is,
238196
* it must not be {@code null} and not the empty String.
@@ -268,18 +226,6 @@ public static void hasLength(@Nullable String text, Supplier<String> messageSupp
268226
}
269227
}
270228

271-
/**
272-
* Assert that the given String is not empty; that is,
273-
* it must not be {@code null} and not the empty String.
274-
* @deprecated as of 4.3.7, in favor of {@link #hasLength(String, String)};
275-
* to be removed in 6.1
276-
*/
277-
@Deprecated(forRemoval = true)
278-
public static void hasLength(@Nullable String text) {
279-
hasLength(text,
280-
"[Assertion failed] - this String argument must have length; it must not be null or empty");
281-
}
282-
283229
/**
284230
* Assert that the given String contains valid text content; that is, it must not
285231
* be {@code null} and must contain at least one non-whitespace character.
@@ -315,18 +261,6 @@ public static void hasText(@Nullable String text, Supplier<String> messageSuppli
315261
}
316262
}
317263

318-
/**
319-
* Assert that the given String contains valid text content; that is, it must not
320-
* be {@code null} and must contain at least one non-whitespace character.
321-
* @deprecated as of 4.3.7, in favor of {@link #hasText(String, String)};
322-
* to be removed in 6.1
323-
*/
324-
@Deprecated(forRemoval = true)
325-
public static void hasText(@Nullable String text) {
326-
hasText(text,
327-
"[Assertion failed] - this String argument must have text; it must not be null, empty, or blank");
328-
}
329-
330264
/**
331265
* Assert that the given text does not contain the given substring.
332266
* <pre class="code">Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");</pre>
@@ -361,17 +295,6 @@ public static void doesNotContain(@Nullable String textToSearch, String substrin
361295
}
362296
}
363297

364-
/**
365-
* Assert that the given text does not contain the given substring.
366-
* @deprecated as of 4.3.7, in favor of {@link #doesNotContain(String, String, String)};
367-
* to be removed in 6.1
368-
*/
369-
@Deprecated(forRemoval = true)
370-
public static void doesNotContain(@Nullable String textToSearch, String substring) {
371-
doesNotContain(textToSearch, substring,
372-
() -> "[Assertion failed] - this String argument must not contain the substring [" + substring + "]");
373-
}
374-
375298
/**
376299
* Assert that an array contains elements; that is, it must not be
377300
* {@code null} and must contain at least one element.
@@ -404,17 +327,6 @@ public static void notEmpty(@Nullable Object[] array, Supplier<String> messageSu
404327
}
405328
}
406329

407-
/**
408-
* Assert that an array contains elements; that is, it must not be
409-
* {@code null} and must contain at least one element.
410-
* @deprecated as of 4.3.7, in favor of {@link #notEmpty(Object[], String)};
411-
* to be removed in 6.1
412-
*/
413-
@Deprecated(forRemoval = true)
414-
public static void notEmpty(@Nullable Object[] array) {
415-
notEmpty(array, "[Assertion failed] - this array must not be empty: it must contain at least 1 element");
416-
}
417-
418330
/**
419331
* Assert that an array contains no {@code null} elements.
420332
* <p>Note: Does not complain if the array is empty!
@@ -455,16 +367,6 @@ public static void noNullElements(@Nullable Object[] array, Supplier<String> mes
455367
}
456368
}
457369

458-
/**
459-
* Assert that an array contains no {@code null} elements.
460-
* @deprecated as of 4.3.7, in favor of {@link #noNullElements(Object[], String)};
461-
* to be removed in 6.1
462-
*/
463-
@Deprecated(forRemoval = true)
464-
public static void noNullElements(@Nullable Object[] array) {
465-
noNullElements(array, "[Assertion failed] - this array must not contain any null elements");
466-
}
467-
468370
/**
469371
* Assert that a collection contains elements; that is, it must not be
470372
* {@code null} and must contain at least one element.
@@ -499,18 +401,6 @@ public static void notEmpty(@Nullable Collection<?> collection, Supplier<String>
499401
}
500402
}
501403

502-
/**
503-
* Assert that a collection contains elements; that is, it must not be
504-
* {@code null} and must contain at least one element.
505-
* @deprecated as of 4.3.7, in favor of {@link #notEmpty(Collection, String)};
506-
* to be removed in 6.1
507-
*/
508-
@Deprecated(forRemoval = true)
509-
public static void notEmpty(@Nullable Collection<?> collection) {
510-
notEmpty(collection,
511-
"[Assertion failed] - this collection must not be empty: it must contain at least 1 element");
512-
}
513-
514404
/**
515405
* Assert that a collection contains no {@code null} elements.
516406
* <p>Note: Does not complain if the collection is empty!
@@ -584,17 +474,6 @@ public static void notEmpty(@Nullable Map<?, ?> map, Supplier<String> messageSup
584474
}
585475
}
586476

587-
/**
588-
* Assert that a Map contains entries; that is, it must not be {@code null}
589-
* and must contain at least one entry.
590-
* @deprecated as of 4.3.7, in favor of {@link #notEmpty(Map, String)};
591-
* to be removed in 6.1
592-
*/
593-
@Deprecated(forRemoval = true)
594-
public static void notEmpty(@Nullable Map<?, ?> map) {
595-
notEmpty(map, "[Assertion failed] - this map must not be empty; it must contain at least one entry");
596-
}
597-
598477
/**
599478
* Assert that the provided object is an instance of the provided class.
600479
* <pre class="code">Assert.instanceOf(Foo.class, foo, "Foo expected");</pre>

0 commit comments

Comments
 (0)