From b7691795b2d62dff12f221f4a493f56a1bc7105c Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Sat, 21 Dec 2019 14:18:45 +0300 Subject: [PATCH] add a contract GitOrigin-RevId: 39e8c09ae20d0fa8d0ad2c3dfc1957991c962b55 --- platform/util/src/com/intellij/CommonBundle.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/platform/util/src/com/intellij/CommonBundle.java b/platform/util/src/com/intellij/CommonBundle.java index 3b22c6f8d713..749d391f4d7a 100644 --- a/platform/util/src/com/intellij/CommonBundle.java +++ b/platform/util/src/com/intellij/CommonBundle.java @@ -2,10 +2,7 @@ package com.intellij; import com.intellij.openapi.util.SystemInfo; -import org.jetbrains.annotations.Nls; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.PropertyKey; +import org.jetbrains.annotations.*; import java.lang.ref.Reference; import java.lang.ref.SoftReference; @@ -37,6 +34,7 @@ public final class CommonBundle extends BundleBase { return bundle; } + @Contract("null, _, _, _ -> param3") public static String messageOrDefault(@Nullable ResourceBundle bundle, @NotNull String key, @Nullable String defaultValue, @NotNull Object... params) { if (bundle == null) { return defaultValue; @@ -44,9 +42,7 @@ public final class CommonBundle extends BundleBase { else if (!bundle.containsKey(key)) { return postprocessValue(bundle, useDefaultValue(bundle, key, defaultValue), params); } - else { - return BundleBase.messageOrDefault(bundle, key, defaultValue, params); - } + return BundleBase.messageOrDefault(bundle, key, defaultValue, params); } @Nls