From 1a7ab390cec962c942f1e79c80e3bce1785e8ca2 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 30 May 2014 15:25:18 +0200 Subject: [PATCH] restore (wrong) Logger.assertTrue contracts --- platform/util/src/com/intellij/openapi/diagnostic/Logger.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/util/src/com/intellij/openapi/diagnostic/Logger.java b/platform/util/src/com/intellij/openapi/diagnostic/Logger.java index 9a255cba7692..4fbfccd55e0d 100644 --- a/platform/util/src/com/intellij/openapi/diagnostic/Logger.java +++ b/platform/util/src/com/intellij/openapi/diagnostic/Logger.java @@ -18,6 +18,7 @@ package com.intellij.openapi.diagnostic; import com.intellij.util.ArrayUtil; import com.intellij.util.ExceptionUtil; import org.apache.log4j.Level; +import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -134,6 +135,7 @@ public abstract class Logger { public abstract void error(@NonNls String message, @Nullable Throwable t, @NonNls @NotNull String... details); + @Contract("false,_->fail") // wrong, but avoid quite a few warnings in the code public boolean assertTrue(boolean value, @Nullable @NonNls Object message) { if (!value) { @NonNls String resultMessage = "Assertion failed"; @@ -144,6 +146,7 @@ public abstract class Logger { return value; } + @Contract("false->fail") // wrong, but avoid quite a few warnings in the code public boolean assertTrue(boolean value) { return value || assertTrue(false, null); }