diff --git a/plugins/gradle/java/src/codeInspection/GradleInspectionBundle.java b/plugins/gradle/java/src/codeInspection/GradleInspectionBundle.java index 79c53319b712..33bb7451f912 100644 --- a/plugins/gradle/java/src/codeInspection/GradleInspectionBundle.java +++ b/plugins/gradle/java/src/codeInspection/GradleInspectionBundle.java @@ -15,35 +15,19 @@ */ package org.jetbrains.plugins.gradle.codeInspection; -import com.intellij.CommonBundle; +import com.intellij.DynamicBundle; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; -import java.lang.ref.Reference; -import java.lang.ref.SoftReference; -import java.util.ResourceBundle; +public class GradleInspectionBundle extends DynamicBundle { + @NonNls private static final String BUNDLE = "i18n.GradleInspectionBundle"; + private static final GradleInspectionBundle INSTANCE = new GradleInspectionBundle(); -/** - * @author Vladislav.Soroka - */ -public class GradleInspectionBundle { + private GradleInspectionBundle() { super(BUNDLE); } + @NotNull public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - - private static Reference ourBundle; - @NonNls - private static final String BUNDLE = "i18n.GradleInspectionBundle"; - - private static ResourceBundle getBundle() { - ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); - - if (bundle == null) { - bundle = ResourceBundle.getBundle(BUNDLE); - ourBundle = new SoftReference<>(bundle); - } - return bundle; + return INSTANCE.getMessage(key, params); } } \ No newline at end of file