Skip to content

Commit 316d1e4

Browse files
committed
Deprecate ConditionOutcome.inverse()
1. It's not used anywhere. 2. The condition message is not applicable for reusing if match is reversed in practice. 3. The method is not doing much, we should call the constructor directly since it is public. 4. It's better to define it as instance method if it indeed required. Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
1 parent b48ce96 commit 316d1e4

File tree

1 file changed

+3
-0
lines changed
  • spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition

1 file changed

+3
-0
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java

+3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ public String toString() {
153153
* @param outcome the outcome to inverse
154154
* @return the inverse of the condition outcome
155155
* @since 1.3.0
156+
* @deprecated since 3.5.0 for removal in 3.6.0 in favor of
157+
* {@link #ConditionOutcome(boolean, ConditionMessage)}
156158
*/
159+
@Deprecated(since = "3.5.0", forRemoval = true)
157160
public static ConditionOutcome inverse(ConditionOutcome outcome) {
158161
return new ConditionOutcome(!outcome.isMatch(), outcome.getConditionMessage());
159162
}

0 commit comments

Comments
 (0)