mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
restore (wrong) Logger.assertTrue contracts
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user