mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull
This commit is contained in:
@@ -18,6 +18,7 @@ package com.jetbrains.rest;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.reference.SoftReference;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.PropertyKey;
|
||||
|
||||
import java.lang.ref.Reference;
|
||||
@@ -29,18 +30,18 @@ import java.util.ResourceBundle;
|
||||
* User : catherine
|
||||
*/
|
||||
public class RestBundle {
|
||||
private static Reference<ResourceBundle> ourBundle;
|
||||
|
||||
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 = "com.jetbrains.rest.RestBundle";
|
||||
|
||||
private RestBundle() {
|
||||
}
|
||||
|
||||
public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) {
|
||||
return CommonBundle.message(getBundle(), key, params);
|
||||
}
|
||||
|
||||
// Cached loading
|
||||
private static ResourceBundle getBundle() {
|
||||
ResourceBundle bundle = SoftReference.dereference(ourBundle);
|
||||
|
||||
Reference in New Issue
Block a user