| package org.jetbrains.jps.android; |
| |
| import com.intellij.CommonBundle; |
| 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; |
| |
| /** |
| * @author Eugene.Kudelevsky |
| */ |
| public class AndroidJpsBundle { |
| @NonNls private static final String BUNDLE_NAME = "messages.AndroidJpsBundle"; |
| private static Reference<ResourceBundle> ourBundle; |
| |
| private static ResourceBundle getBundle() { |
| ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); |
| if (bundle == null) { |
| bundle = ResourceBundle.getBundle(BUNDLE_NAME); |
| ourBundle = new SoftReference<ResourceBundle>(bundle); |
| } |
| return bundle; |
| } |
| |
| private AndroidJpsBundle() { |
| } |
| |
| public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) { |
| return CommonBundle.message(getBundle(), key, params); |
| } |
| } |