j2ee+friends

GitOrigin-RevId: 87311a766a0c9365c0c0e6eedbb4a5ec7d7c323a
This commit is contained in:
Sergey Ignatov
2019-12-18 19:31:34 +00:00
committed by intellij-monorepo-bot
parent 4da249a31a
commit 20fff61d3a
@@ -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<ResourceBundle> 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);
}
}