From d70cd0856c332a8cb1b47457ecb012865c487d0b Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Tue, 24 Dec 2013 19:25:40 +0400 Subject: [PATCH] notnull --- .../src/org/intellij/images/ImagesBundle.java | 11 ++++---- .../openapi/compiler/CompilerBundle.java | 11 ++++---- .../com/intellij/debugger/DebuggerBundle.java | 11 ++++---- .../completion/CompletionBundle.java | 11 ++++---- .../com/intellij/javadoc/JavadocBundle.java | 11 ++++---- .../intellij/refactoring/RefactorJBundle.java | 22 ++++++++-------- .../src/com/intellij/core/JavaCoreBundle.java | 11 ++++---- .../psi/infos/MethodCandidateInfo.java | 3 ++- .../codeInsight/daemon/JavaErrorMessages.java | 13 +++++----- .../lang/manifest/ManifestBundle.java | 11 ++++---- .../analysis/AnalysisScopeBundle.java | 3 ++- .../codeInsight/daemon/DaemonBundle.java | 3 ++- .../codeInspection/InspectionsBundle.java | 3 ++- .../codeInsight/daemon/QuickFixBundle.java | 3 ++- .../codeInsight/CodeInsightBundle.java | 11 ++++---- .../src/com/intellij/core/CoreBundle.java | 11 ++++---- .../src/com/intellij/ide/IdeBundle.java | 11 ++++---- .../intellij/openapi/editor/EditorBundle.java | 11 ++++---- .../com/intellij/openapi/vfs/VfsBundle.java | 13 +++++----- .../src/com/intellij/psi/PsiBundle.java | 10 ++++---- .../src/com/intellij/lang/LangBundle.java | 11 ++++---- .../openapi/fileTypes/FileTypesBundle.java | 11 ++++---- .../src/com/intellij/dvcs/ui/DvcsBundle.java | 11 ++++---- .../util/ExternalSystemBundle.java | 25 +++++++++++++++---- .../test/TestExternalSystemManager.groovy | 4 +-- .../test/TestExternalSystemSettings.groovy | 6 ++--- .../intellij/execution/ExecutionBundle.java | 12 +++++---- .../refactoring/RefactoringBundle.java | 13 +++++----- .../intellij/usageView/UsageViewBundle.java | 11 ++++---- .../codeEditor/printing/CodeEditorBundle.java | 11 ++++---- .../src/com/intellij/find/FindBundle.java | 11 ++++---- .../src/com/intellij/tools/ToolsBundle.java | 11 ++++---- .../integration/LocalHistoryBundle.java | 8 +++--- .../FeatureStatisticsBundle.java | 11 ++++---- .../src/com/intellij/idea/ActionsBundle.java | 11 ++++---- .../application/ApplicationBundle.java | 11 ++++---- .../com/intellij/openapi/diff/DiffBundle.java | 11 ++++---- .../intellij/openapi/keymap/KeyMapBundle.java | 11 ++++---- .../openapi/options/OptionsBundle.java | 11 ++++---- .../com/intellij/openapi/vcs/VcsBundle.java | 11 ++++---- .../intellij/diagnostic/DiagnosticBundle.java | 11 ++++---- .../internal/statistic/StatisticsBundle.java | 13 +++++----- .../openapi/project/ProjectBundle.java | 11 ++++---- .../testframework/sm/SMTestsRunnerBundle.java | 11 ++++---- .../util-rt/src/com/intellij/BundleBase.java | 6 ++--- .../util/src/com/intellij/AbstractBundle.java | 2 +- .../util/src/com/intellij/CommonBundle.java | 24 +++++++++--------- .../util/src/com/intellij/ui/UIBundle.java | 11 ++++---- .../intellij/xdebugger/XDebuggerBundle.java | 11 ++++---- .../com/siyeh/InspectionGadgetsBundle.java | 11 ++++---- .../com/siyeh/IntentionPowerPackBundle.java | 11 ++++---- .../src/com/intellij/lang/ant/AntBundle.java | 10 ++++---- .../lang/ant/resources/AntActionsBundle.java | 11 ++++---- .../cvs-core/src/com/intellij/CvsBundle.java | 15 ++++++----- .../lib/cvsclient/JavaCvsSrcBundle.java | 11 ++++---- .../lib/cvsclient/SmartCvsSrcBundle.java | 11 ++++---- plugins/devkit/src/DevKitBundle.java | 11 ++++---- .../jetbrains/idea/eclipse/EclipseBundle.java | 11 ++++---- .../jetbrains/git4idea/ssh/SSHMainBundle.java | 12 +++++---- .../git4idea/src/git4idea/i18n/GitBundle.java | 11 ++++---- .../GradleInspectionBundle.java | 13 +++++----- .../plugins/gradle/util/GradleBundle.java | 13 +++++----- .../util/GradleDocumentationBundle.java | 13 ++++++---- .../plugins/groovy/GroovyBundle.java | 13 ++++------ .../generate/GroovyCodeInsightBundle.java | 11 ++++---- .../GroovyInspectionBundle.java | 13 +++++----- .../plugins/groovy/doc/GroovyDocBundle.java | 13 +++++----- .../intentions/GroovyIntentionsBundle.java | 13 +++++----- .../refactoring/GroovyRefactoringBundle.java | 13 +++++----- .../src/org/zmlx/hg4idea/HgVcsMessages.java | 12 ++++----- .../idea/maven/dom/MavenDomBundle.java | 11 ++++---- .../idea/maven/execution/RunnerBundle.java | 12 +++++---- .../idea/maven/indices/IndicesBundle.java | 11 ++++---- .../idea/maven/project/ProjectBundle.java | 11 ++++---- .../idea/maven/tasks/TasksBundle.java | 11 ++++---- .../lang/properties/PropertiesBundle.java | 11 ++++---- .../src/org/jetbrains/idea/svn/SvnBundle.java | 13 +++++----- .../com/intellij/designer/DesignerBundle.java | 11 ++++---- .../intellij/uiDesigner/UIDesignerBundle.java | 11 ++++---- .../src/com/jetbrains/rest/RestBundle.java | 11 ++++---- python/src/com/jetbrains/python/PyBundle.java | 12 +++++---- .../spellchecker/util/SpellCheckerBundle.java | 21 ++++++++-------- .../src/com/intellij/util/xml/DomBundle.java | 11 ++++---- .../src/com/intellij/xml/XmlBundle.java | 11 ++++---- .../codeInsight/daemon/XmlErrorMessages.java | 11 ++++---- 85 files changed, 515 insertions(+), 432 deletions(-) diff --git a/images/src/org/intellij/images/ImagesBundle.java b/images/src/org/intellij/images/ImagesBundle.java index 056e4403546a..3472ab951061 100644 --- a/images/src/org/intellij/images/ImagesBundle.java +++ b/images/src/org/intellij/images/ImagesBundle.java @@ -17,6 +17,7 @@ package org.intellij.images; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class ImagesBundle { - private static Reference ourBundle; + 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 = "org.intellij.images.ImagesBundle"; private ImagesBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilerBundle.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilerBundle.java index 5e01ff64f604..ec70d8216261 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilerBundle.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilerBundle.java @@ -18,6 +18,7 @@ package com.intellij.openapi.compiler; import com.intellij.CommonBundle; import com.intellij.openapi.projectRoots.Sdk; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -29,8 +30,12 @@ import java.util.ResourceBundle; * Date: Sep 9, 2005 */ public class CompilerBundle { - private static Reference ourBundle; + 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 = "messages.CompilerBundle"; private CompilerBundle() { @@ -40,10 +45,6 @@ public class CompilerBundle { return message("javac.error.jdk.home.missing", jdk.getName(), jdk.getHomePath()); } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/java/debugger/openapi/src/com/intellij/debugger/DebuggerBundle.java b/java/debugger/openapi/src/com/intellij/debugger/DebuggerBundle.java index d83053bd56c5..17f779919970 100644 --- a/java/debugger/openapi/src/com/intellij/debugger/DebuggerBundle.java +++ b/java/debugger/openapi/src/com/intellij/debugger/DebuggerBundle.java @@ -18,6 +18,7 @@ package com.intellij.debugger; import com.intellij.CommonBundle; import com.intellij.execution.configurations.RemoteConnection; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -25,8 +26,12 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class DebuggerBundle { - private static Reference ourBundle; + 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 = "messages.DebuggerBundle"; private DebuggerBundle() { @@ -40,10 +45,6 @@ public class DebuggerBundle { return connection.isUseSockets() ? message("transport.name.socket") : message("transport.name.shared.memory"); } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/CompletionBundle.java b/java/java-impl/src/com/intellij/codeInsight/completion/CompletionBundle.java index d2ac5c1d8f9f..0e5ff81b5e8c 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/CompletionBundle.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/CompletionBundle.java @@ -17,6 +17,7 @@ package com.intellij.codeInsight.completion; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class CompletionBundle { - private static Reference ourBundle; + 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 = "messages.CompletionBundle"; private CompletionBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/java/java-impl/src/com/intellij/javadoc/JavadocBundle.java b/java/java-impl/src/com/intellij/javadoc/JavadocBundle.java index 5310d247c4c9..f231bd8f5384 100644 --- a/java/java-impl/src/com/intellij/javadoc/JavadocBundle.java +++ b/java/java-impl/src/com/intellij/javadoc/JavadocBundle.java @@ -17,6 +17,7 @@ package com.intellij.javadoc; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author yole */ public class JavadocBundle { - private static Reference ourBundle; + 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 = "messages.JavadocBundle"; private JavadocBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/java/java-impl/src/com/intellij/refactoring/RefactorJBundle.java b/java/java-impl/src/com/intellij/refactoring/RefactorJBundle.java index 775960118fb3..f2bd765dcd5c 100644 --- a/java/java-impl/src/com/intellij/refactoring/RefactorJBundle.java +++ b/java/java-impl/src/com/intellij/refactoring/RefactorJBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,19 +16,21 @@ package com.intellij.refactoring; import com.intellij.CommonBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.util.ResourceBundle; -public class RefactorJBundle{ - private static final ResourceBundle ourBundle = - ResourceBundle.getBundle("com.intellij.refactoring.RefactorJBundle"); +public class RefactorJBundle { - private RefactorJBundle(){ - } + public static String message(@NotNull @PropertyKey(resourceBundle = "com.intellij.refactoring.RefactorJBundle") String key, + @NotNull Object... params) { + return CommonBundle.message(ourBundle, key, params); + } - public static String message(@PropertyKey(resourceBundle = "com.intellij.refactoring.RefactorJBundle")String key, - Object... params){ - return CommonBundle.message(ourBundle, key, params); - } + private static final ResourceBundle ourBundle = + ResourceBundle.getBundle("com.intellij.refactoring.RefactorJBundle"); + + private RefactorJBundle() { + } } diff --git a/java/java-psi-api/src/com/intellij/core/JavaCoreBundle.java b/java/java-psi-api/src/com/intellij/core/JavaCoreBundle.java index 4f315b15b0bb..f63801f1bfd2 100644 --- a/java/java-psi-api/src/com/intellij/core/JavaCoreBundle.java +++ b/java/java-psi-api/src/com/intellij/core/JavaCoreBundle.java @@ -17,6 +17,7 @@ package com.intellij.core; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class JavaCoreBundle { - private static Reference ourBundle; + 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 = "messages.JavaCoreBundle"; private JavaCoreBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java b/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java index 496ba872f287..9ac74726ed93 100644 --- a/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java +++ b/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java @@ -40,7 +40,8 @@ import java.util.Map; public class MethodCandidateInfo extends CandidateInfo{ public static final RecursionGuard ourOverloadGuard = RecursionManager.createGuard("overload.guard"); public static final ThreadLocal>> CURRENT_CANDIDATE = new ThreadLocal>>(); - @ApplicabilityLevelConstant private int myApplicabilityLevel = 0; + @ApplicabilityLevelConstant + private int myApplicabilityLevel; // benign race private final PsiElement myArgumentList; private final PsiType[] myArgumentTypes; private final PsiType[] myTypeArguments; diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/daemon/JavaErrorMessages.java b/java/java-psi-impl/src/com/intellij/codeInsight/daemon/JavaErrorMessages.java index 530c87cb33f4..74d06d2fd568 100644 --- a/java/java-psi-impl/src/com/intellij/codeInsight/daemon/JavaErrorMessages.java +++ b/java/java-psi-impl/src/com/intellij/codeInsight/daemon/JavaErrorMessages.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,16 +24,15 @@ import org.jetbrains.annotations.PropertyKey; * @author max */ public class JavaErrorMessages extends AbstractBundle { - public static final JavaErrorMessages INSTANCE = new JavaErrorMessages(); + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { + return INSTANCE.getMessage(key, params); + } + + public static final JavaErrorMessages INSTANCE = new JavaErrorMessages(); @NonNls public static final String BUNDLE = "messages.JavaErrorMessages"; private JavaErrorMessages() { super(BUNDLE); } - - @NotNull - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return INSTANCE.getMessage(key, params); - } } diff --git a/java/manifest/src/org/jetbrains/lang/manifest/ManifestBundle.java b/java/manifest/src/org/jetbrains/lang/manifest/ManifestBundle.java index 4d5fe2c53fb2..7b9ba1d92f5c 100644 --- a/java/manifest/src/org/jetbrains/lang/manifest/ManifestBundle.java +++ b/java/manifest/src/org/jetbrains/lang/manifest/ManifestBundle.java @@ -16,18 +16,19 @@ package org.jetbrains.lang.manifest; import com.intellij.AbstractBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; public class ManifestBundle extends AbstractBundle { - public static final String PATH_TO_BUNDLE = "org.jetbrains.lang.manifest.ManifestBundle"; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return BUNDLE.getMessage(key, params); + } + + public static final String PATH_TO_BUNDLE = "org.jetbrains.lang.manifest.ManifestBundle"; private static final ManifestBundle BUNDLE = new ManifestBundle(); private ManifestBundle() { super(PATH_TO_BUNDLE); } - - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object... params) { - return BUNDLE.getMessage(key, params); - } } diff --git a/platform/analysis-api/src/com/intellij/analysis/AnalysisScopeBundle.java b/platform/analysis-api/src/com/intellij/analysis/AnalysisScopeBundle.java index 44e1d4a48f16..5d3e98739a0e 100644 --- a/platform/analysis-api/src/com/intellij/analysis/AnalysisScopeBundle.java +++ b/platform/analysis-api/src/com/intellij/analysis/AnalysisScopeBundle.java @@ -17,6 +17,7 @@ package com.intellij.analysis; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -34,7 +35,7 @@ public class AnalysisScopeBundle { private AnalysisScopeBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE)String key, @NotNull Object... params) { return CommonBundle.message(getBundle(), key, params); } diff --git a/platform/analysis-api/src/com/intellij/codeInsight/daemon/DaemonBundle.java b/platform/analysis-api/src/com/intellij/codeInsight/daemon/DaemonBundle.java index 3d848632342d..b843dada96fa 100644 --- a/platform/analysis-api/src/com/intellij/codeInsight/daemon/DaemonBundle.java +++ b/platform/analysis-api/src/com/intellij/codeInsight/daemon/DaemonBundle.java @@ -17,6 +17,7 @@ package com.intellij.codeInsight.daemon; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -34,7 +35,7 @@ public class DaemonBundle { private DaemonBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE)String key, @NotNull Object... params) { return CommonBundle.message(getBundle(), key, params); } diff --git a/platform/analysis-api/src/com/intellij/codeInspection/InspectionsBundle.java b/platform/analysis-api/src/com/intellij/codeInspection/InspectionsBundle.java index 585c2f6f7bac..72836879951e 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/InspectionsBundle.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/InspectionsBundle.java @@ -17,6 +17,7 @@ package com.intellij.codeInspection; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -34,7 +35,7 @@ public class InspectionsBundle { private InspectionsBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, @NonNls Object... params) { + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE)String key, @NotNull @NonNls Object... params) { return CommonBundle.message(getBundle(), key, params); } diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/QuickFixBundle.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/QuickFixBundle.java index 9a32d315f95f..fbcef3ca6a3f 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/QuickFixBundle.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/QuickFixBundle.java @@ -17,6 +17,7 @@ package com.intellij.codeInsight.daemon; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -34,7 +35,7 @@ public class QuickFixBundle { private QuickFixBundle() { } - public static String message(@NonNls @PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + public static String message(@NotNull @NonNls @PropertyKey(resourceBundle = BUNDLE)String key, @NotNull Object... params) { return CommonBundle.message(getBundle(), key, params); } diff --git a/platform/core-api/src/com/intellij/codeInsight/CodeInsightBundle.java b/platform/core-api/src/com/intellij/codeInsight/CodeInsightBundle.java index 572bcf4065eb..1b5a1337b453 100644 --- a/platform/core-api/src/com/intellij/codeInsight/CodeInsightBundle.java +++ b/platform/core-api/src/com/intellij/codeInsight/CodeInsightBundle.java @@ -17,6 +17,7 @@ package com.intellij.codeInsight; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class CodeInsightBundle { - private static Reference ourBundle; + 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 = "messages.CodeInsightBundle"; private CodeInsightBundle() { } - public static String message(@NonNls @PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/core-api/src/com/intellij/core/CoreBundle.java b/platform/core-api/src/com/intellij/core/CoreBundle.java index 5c7451fd31ae..4423cdad2ee6 100644 --- a/platform/core-api/src/com/intellij/core/CoreBundle.java +++ b/platform/core-api/src/com/intellij/core/CoreBundle.java @@ -17,6 +17,7 @@ package com.intellij.core; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class CoreBundle { - private static Reference ourBundle; + 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 = "messages.CoreBundle"; private CoreBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/core-api/src/com/intellij/ide/IdeBundle.java b/platform/core-api/src/com/intellij/ide/IdeBundle.java index 44a707b37288..51e4c1b66aac 100644 --- a/platform/core-api/src/com/intellij/ide/IdeBundle.java +++ b/platform/core-api/src/com/intellij/ide/IdeBundle.java @@ -18,6 +18,7 @@ package com.intellij.ide; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,17 +29,17 @@ import java.util.ResourceBundle; * @author yole */ public class IdeBundle { - private static Reference ourBundle; + 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 = "messages.IdeBundle"; private IdeBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/core-api/src/com/intellij/openapi/editor/EditorBundle.java b/platform/core-api/src/com/intellij/openapi/editor/EditorBundle.java index a7657f74db13..5a407e7d3d3f 100644 --- a/platform/core-api/src/com/intellij/openapi/editor/EditorBundle.java +++ b/platform/core-api/src/com/intellij/openapi/editor/EditorBundle.java @@ -17,6 +17,7 @@ package com.intellij.openapi.editor; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author lesya */ public class EditorBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.EditorBundle"; private EditorBundle() { } - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/core-api/src/com/intellij/openapi/vfs/VfsBundle.java b/platform/core-api/src/com/intellij/openapi/vfs/VfsBundle.java index 25f98afc0a59..d7e4ab8acd4b 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/VfsBundle.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/VfsBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,21 +18,22 @@ package com.intellij.openapi.vfs; import com.intellij.AbstractBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; /** * @author yole */ public class VfsBundle extends AbstractBundle { + + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { + return ourInstance.getMessage(key, params); + } + @NonNls private static final String BUNDLE = "messages.VfsBundle"; private static final VfsBundle ourInstance = new VfsBundle(); private VfsBundle() { super(BUNDLE); } - - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return ourInstance.getMessage(key, params); - } - } diff --git a/platform/core-api/src/com/intellij/psi/PsiBundle.java b/platform/core-api/src/com/intellij/psi/PsiBundle.java index b403743043a9..900fa03198c6 100644 --- a/platform/core-api/src/com/intellij/psi/PsiBundle.java +++ b/platform/core-api/src/com/intellij/psi/PsiBundle.java @@ -28,17 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class PsiBundle { - private static Reference ourBundle; + 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 = "messages.PsiBundle"; private PsiBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/core-impl/src/com/intellij/lang/LangBundle.java b/platform/core-impl/src/com/intellij/lang/LangBundle.java index 5727dd06bdec..46ea66fda59c 100644 --- a/platform/core-impl/src/com/intellij/lang/LangBundle.java +++ b/platform/core-impl/src/com/intellij/lang/LangBundle.java @@ -18,6 +18,7 @@ package com.intellij.lang; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,17 +29,17 @@ import java.util.ResourceBundle; * @author yole */ public class LangBundle { - private static Reference ourBundle; + 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 = "messages.LangBundle"; private LangBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/core-impl/src/com/intellij/openapi/fileTypes/FileTypesBundle.java b/platform/core-impl/src/com/intellij/openapi/fileTypes/FileTypesBundle.java index 22d89a69049f..ac9fd71e502c 100644 --- a/platform/core-impl/src/com/intellij/openapi/fileTypes/FileTypesBundle.java +++ b/platform/core-impl/src/com/intellij/openapi/fileTypes/FileTypesBundle.java @@ -17,6 +17,7 @@ package com.intellij.openapi.fileTypes; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author yole */ public class FileTypesBundle { - private static Reference ourBundle; + 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 = "messages.FileTypesBundle"; private FileTypesBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/dvcs/src/com/intellij/dvcs/ui/DvcsBundle.java b/platform/dvcs/src/com/intellij/dvcs/ui/DvcsBundle.java index df38abd544f4..879def5e1802 100644 --- a/platform/dvcs/src/com/intellij/dvcs/ui/DvcsBundle.java +++ b/platform/dvcs/src/com/intellij/dvcs/ui/DvcsBundle.java @@ -17,6 +17,7 @@ package com.intellij.dvcs.ui; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,18 +28,18 @@ import java.util.ResourceBundle; * @author Nadya Zabrodina */ public class DvcsBundle { - private static Reference ourBundle; + 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 = "com.intellij.dvcs.ui.DvcsBundle"; private DvcsBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemBundle.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemBundle.java index 0142b823e8b8..89cc9d8b08a2 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemBundle.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemBundle.java @@ -1,6 +1,22 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.openapi.externalSystem.util; import com.intellij.AbstractBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; /** @@ -9,15 +25,14 @@ import org.jetbrains.annotations.PropertyKey; */ public class ExternalSystemBundle extends AbstractBundle { - public static final String PATH_TO_BUNDLE = "i18n.ExternalSystemBundle"; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return BUNDLE.getMessage(key, params); + } + public static final String PATH_TO_BUNDLE = "i18n.ExternalSystemBundle"; private static final ExternalSystemBundle BUNDLE = new ExternalSystemBundle(); public ExternalSystemBundle() { super(PATH_TO_BUNDLE); } - - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object... params) { - return BUNDLE.getMessage(key, params); - } } diff --git a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/TestExternalSystemManager.groovy b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/TestExternalSystemManager.groovy index a37e01952d9f..659da916e0fd 100644 --- a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/TestExternalSystemManager.groovy +++ b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/TestExternalSystemManager.groovy @@ -86,10 +86,10 @@ TestExternalSystemExecutionSettings> } @Override - void enhanceRemoteProcessing(@NotNull @NotNull SimpleJavaParameters parameters) throws ExecutionException { + void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) throws ExecutionException { } @Override - void enhanceLocalProcessing(@NotNull @NotNull List urls) { + void enhanceLocalProcessing(@NotNull List urls) { } } diff --git a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/TestExternalSystemSettings.groovy b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/TestExternalSystemSettings.groovy index 52bdfe5e88a7..3e43b7976a30 100644 --- a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/TestExternalSystemSettings.groovy +++ b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/TestExternalSystemSettings.groovy @@ -34,17 +34,17 @@ TestExternalSystemSettingsListener> } @Override - void subscribe(@NotNull @NotNull ExternalSystemSettingsListener listener) { + void subscribe(@NotNull ExternalSystemSettingsListener listener) { throw new UnsupportedOperationException() } @Override - protected void copyExtraSettingsFrom(@NotNull @NotNull TestExternalSystemSettings settings) { + protected void copyExtraSettingsFrom(@NotNull TestExternalSystemSettings settings) { throw new UnsupportedOperationException() } @Override - protected void checkSettings(@NotNull @NotNull TestExternalProjectSettings old, @NotNull @NotNull TestExternalProjectSettings current) { + protected void checkSettings(@NotNull TestExternalProjectSettings old, @NotNull TestExternalProjectSettings current) { throw new UnsupportedOperationException() } } diff --git a/platform/lang-api/src/com/intellij/execution/ExecutionBundle.java b/platform/lang-api/src/com/intellij/execution/ExecutionBundle.java index 5c6e47d41c2c..8a1ad258ce19 100644 --- a/platform/lang-api/src/com/intellij/execution/ExecutionBundle.java +++ b/platform/lang-api/src/com/intellij/execution/ExecutionBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,20 +16,22 @@ package com.intellij.execution; import com.intellij.AbstractBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; /** * @author lesya */ public class ExecutionBundle extends AbstractBundle { + + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return ourInstance.getMessage(key, params); + } + public static final String PATH_TO_BUNDLE = "messages.ExecutionBundle"; private static final AbstractBundle ourInstance = new ExecutionBundle(); private ExecutionBundle() { super(PATH_TO_BUNDLE); } - - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return ourInstance.getMessage(key, params); - } } diff --git a/platform/lang-api/src/com/intellij/refactoring/RefactoringBundle.java b/platform/lang-api/src/com/intellij/refactoring/RefactoringBundle.java index fbeb5409a8e9..692f889f96e3 100644 --- a/platform/lang-api/src/com/intellij/refactoring/RefactoringBundle.java +++ b/platform/lang-api/src/com/intellij/refactoring/RefactoringBundle.java @@ -18,6 +18,7 @@ package com.intellij.refactoring; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.PropertyKey; @@ -29,8 +30,12 @@ import java.util.ResourceBundle; * @author ven */ public class RefactoringBundle { - private static Reference ourBundle; + 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 = "messages.RefactoringBundle"; private RefactoringBundle() { @@ -72,11 +77,7 @@ public class RefactoringBundle { return message("cannot.perform.refactoring") + (message == null ? "" : "\n" + message); } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key) { + public static String message(@PropertyKey(resourceBundle = BUNDLE) String key) { return CommonBundle.message(getBundle(), key); } diff --git a/platform/lang-api/src/com/intellij/usageView/UsageViewBundle.java b/platform/lang-api/src/com/intellij/usageView/UsageViewBundle.java index 3e249f8e3637..866d6319a9df 100644 --- a/platform/lang-api/src/com/intellij/usageView/UsageViewBundle.java +++ b/platform/lang-api/src/com/intellij/usageView/UsageViewBundle.java @@ -18,6 +18,7 @@ package com.intellij.usageView; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,8 +29,12 @@ import java.util.ResourceBundle; * @author yole */ public class UsageViewBundle { - private static Reference ourBundle; + 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 = "messages.UsageView"; private UsageViewBundle() { @@ -50,10 +55,6 @@ public class UsageViewBundle { return " (" + message("occurence.info.reference", usagesCount, filesCount) + ")"; } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/lang-impl/src/com/intellij/codeEditor/printing/CodeEditorBundle.java b/platform/lang-impl/src/com/intellij/codeEditor/printing/CodeEditorBundle.java index 8aa01a6ea4cb..5968d574991f 100644 --- a/platform/lang-impl/src/com/intellij/codeEditor/printing/CodeEditorBundle.java +++ b/platform/lang-impl/src/com/intellij/codeEditor/printing/CodeEditorBundle.java @@ -18,6 +18,7 @@ package com.intellij.codeEditor.printing; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,17 +29,17 @@ import java.util.ResourceBundle; * @author yole */ public class CodeEditorBundle { - private static Reference ourBundle; + 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 = "messages.CodeEditorBundle"; private CodeEditorBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/lang-impl/src/com/intellij/find/FindBundle.java b/platform/lang-impl/src/com/intellij/find/FindBundle.java index e4c431bf9bf3..6f18c8c41edf 100644 --- a/platform/lang-impl/src/com/intellij/find/FindBundle.java +++ b/platform/lang-impl/src/com/intellij/find/FindBundle.java @@ -18,6 +18,7 @@ package com.intellij.find; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,17 +29,17 @@ import java.util.ResourceBundle; * @author yole */ public class FindBundle { - private static Reference ourBundle; + 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 = "messages.FindBundle"; private FindBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/lang-impl/src/com/intellij/tools/ToolsBundle.java b/platform/lang-impl/src/com/intellij/tools/ToolsBundle.java index 997da889eb9c..0f060abb4a30 100644 --- a/platform/lang-impl/src/com/intellij/tools/ToolsBundle.java +++ b/platform/lang-impl/src/com/intellij/tools/ToolsBundle.java @@ -18,6 +18,7 @@ package com.intellij.tools; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,17 +29,17 @@ import java.util.ResourceBundle; * @author yole */ public class ToolsBundle { - private static Reference ourBundle; + 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 = "messages.ToolsBundle"; private ToolsBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryBundle.java b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryBundle.java index 6ff6d8d21fec..993a42954181 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryBundle.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryBundle.java @@ -17,6 +17,7 @@ package com.intellij.history.integration; import com.intellij.CommonBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,13 +25,14 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class LocalHistoryBundle { - private static final String PATH_TO_BUNDLE = "com.intellij.history.integration.LocalHistoryBundle"; - private static Reference ourBundle; - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { return CommonBundle.message(getBundle(), key, params); } + private static final String PATH_TO_BUNDLE = "com.intellij.history.integration.LocalHistoryBundle"; + private static Reference ourBundle; + private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundle.java b/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundle.java index 22136335e239..317ee6407596 100644 --- a/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundle.java +++ b/platform/platform-api/src/com/intellij/featureStatistics/FeatureStatisticsBundle.java @@ -19,6 +19,7 @@ import com.intellij.CommonBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.Extensions; 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.*; * @author max */ public class FeatureStatisticsBundle { + + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(key), key, params); + } + private static Reference ourBundle; private static final Logger LOG = Logger.getInstance(FeatureStatisticsBundle.class); - @NonNls private static final String BUNDLE = "messages.FeatureStatisticsBundle"; private FeatureStatisticsBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(key), key, params); - } - private static ResourceBundle getBundle(final String key) { ResourceBundle providerBundle = ProvidersBundles.INSTANCE.get(key); if (providerBundle != null) { diff --git a/platform/platform-api/src/com/intellij/idea/ActionsBundle.java b/platform/platform-api/src/com/intellij/idea/ActionsBundle.java index 68fb85a3f501..615468e415fd 100644 --- a/platform/platform-api/src/com/intellij/idea/ActionsBundle.java +++ b/platform/platform-api/src/com/intellij/idea/ActionsBundle.java @@ -17,6 +17,7 @@ package com.intellij.idea; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,8 +29,12 @@ import java.util.ResourceBundle; * Date: Aug 29, 2005 */ public class ActionsBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = IDEA_ACTIONS_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls private static final String IDEA_ACTIONS_BUNDLE = "messages.ActionsBundle"; @SuppressWarnings({"HardCodedStringLiteral", "UnresolvedPropertyKey"}) @@ -47,10 +52,6 @@ public class ActionsBundle { return message("action." + actionId + ".description"); } - public static String message(@PropertyKey(resourceBundle = IDEA_ACTIONS_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/platform-api/src/com/intellij/openapi/application/ApplicationBundle.java b/platform/platform-api/src/com/intellij/openapi/application/ApplicationBundle.java index 2f42278c3ee2..cc30402c1e19 100644 --- a/platform/platform-api/src/com/intellij/openapi/application/ApplicationBundle.java +++ b/platform/platform-api/src/com/intellij/openapi/application/ApplicationBundle.java @@ -17,6 +17,7 @@ package com.intellij.openapi.application; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * Provides access to localized properties for the application component of IDEA. */ public class ApplicationBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls public static final String BUNDLE = "messages.ApplicationBundle"; private ApplicationBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/platform-api/src/com/intellij/openapi/diff/DiffBundle.java b/platform/platform-api/src/com/intellij/openapi/diff/DiffBundle.java index 35ad6170213e..ceea52e74df1 100644 --- a/platform/platform-api/src/com/intellij/openapi/diff/DiffBundle.java +++ b/platform/platform-api/src/com/intellij/openapi/diff/DiffBundle.java @@ -17,6 +17,7 @@ package com.intellij.openapi.diff; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author lesya */ public class DiffBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.DiffBundle"; private DiffBundle() { } - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/platform-api/src/com/intellij/openapi/keymap/KeyMapBundle.java b/platform/platform-api/src/com/intellij/openapi/keymap/KeyMapBundle.java index efd081cc53d9..066fc86d6798 100644 --- a/platform/platform-api/src/com/intellij/openapi/keymap/KeyMapBundle.java +++ b/platform/platform-api/src/com/intellij/openapi/keymap/KeyMapBundle.java @@ -18,6 +18,7 @@ package com.intellij.openapi.keymap; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -31,18 +32,18 @@ import java.util.ResourceBundle; * Time: 17:13:10 */ public class KeyMapBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = "messages.KeyMapBundle") String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.KeyMapBundle"; private KeyMapBundle() { } - public static String message(@PropertyKey(resourceBundle = "messages.KeyMapBundle")String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/platform-api/src/com/intellij/openapi/options/OptionsBundle.java b/platform/platform-api/src/com/intellij/openapi/options/OptionsBundle.java index e86d07d7a133..faaa5629a21c 100644 --- a/platform/platform-api/src/com/intellij/openapi/options/OptionsBundle.java +++ b/platform/platform-api/src/com/intellij/openapi/options/OptionsBundle.java @@ -17,6 +17,7 @@ package com.intellij.openapi.options; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author lesya */ public class OptionsBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.OptionsBundle"; private OptionsBundle() { } - public static String message(@NonNls @PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/platform-api/src/com/intellij/openapi/vcs/VcsBundle.java b/platform/platform-api/src/com/intellij/openapi/vcs/VcsBundle.java index 536db1ebd279..20cf6cb389fd 100644 --- a/platform/platform-api/src/com/intellij/openapi/vcs/VcsBundle.java +++ b/platform/platform-api/src/com/intellij/openapi/vcs/VcsBundle.java @@ -17,6 +17,7 @@ package com.intellij.openapi.vcs; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author lesya */ public class VcsBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.VcsBundle"; private VcsBundle() { } - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - public static String getString(@PropertyKey(resourceBundle = PATH_TO_BUNDLE) final String key) { return getBundle().getString(key); } diff --git a/platform/platform-impl/src/com/intellij/diagnostic/DiagnosticBundle.java b/platform/platform-impl/src/com/intellij/diagnostic/DiagnosticBundle.java index 6ecd54988fab..71e782922577 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/DiagnosticBundle.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/DiagnosticBundle.java @@ -17,6 +17,7 @@ package com.intellij.diagnostic; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author yole */ public class DiagnosticBundle { - private static Reference ourBundle; + 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 = "messages.DiagnosticBundle"; private DiagnosticBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/StatisticsBundle.java b/platform/platform-impl/src/com/intellij/internal/statistic/StatisticsBundle.java index 483efa87b667..76cc768aa9ca 100644 --- a/platform/platform-impl/src/com/intellij/internal/statistic/StatisticsBundle.java +++ b/platform/platform-impl/src/com/intellij/internal/statistic/StatisticsBundle.java @@ -16,6 +16,7 @@ package com.intellij.internal.statistic; import com.intellij.AbstractBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; /** @@ -24,14 +25,14 @@ import org.jetbrains.annotations.PropertyKey; */ public class StatisticsBundle extends AbstractBundle { - public static final String PATH_TO_BUNDLE = "messages.StatisticsBundle"; - private static final StatisticsBundle BUNDLE = new StatisticsBundle(); + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return BUNDLE.getMessage(key, params); + } + + public static final String PATH_TO_BUNDLE = "messages.StatisticsBundle"; + private static final StatisticsBundle BUNDLE = new StatisticsBundle(); public StatisticsBundle() { super(PATH_TO_BUNDLE); } - - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object... params) { - return BUNDLE.getMessage(key, params); - } } diff --git a/platform/projectModel-api/src/com/intellij/openapi/project/ProjectBundle.java b/platform/projectModel-api/src/com/intellij/openapi/project/ProjectBundle.java index 961e91842e24..5e1f24aa2de8 100644 --- a/platform/projectModel-api/src/com/intellij/openapi/project/ProjectBundle.java +++ b/platform/projectModel-api/src/com/intellij/openapi/project/ProjectBundle.java @@ -17,6 +17,7 @@ package com.intellij.openapi.project; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,17 +25,17 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class ProjectBundle { - private static Reference ourBundle; + 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 = "messages.ProjectBundle"; private ProjectBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestsRunnerBundle.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestsRunnerBundle.java index 87d7d7d3a391..f343e7db3f4a 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestsRunnerBundle.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestsRunnerBundle.java @@ -17,6 +17,7 @@ package com.intellij.execution.testframework.sm; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author Roman Chernyatchik */ public class SMTestsRunnerBundle { - private static Reference ourBundle; + 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 = "messages.SMTestsRunnerBundle"; private SMTestsRunnerBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/util-rt/src/com/intellij/BundleBase.java b/platform/util-rt/src/com/intellij/BundleBase.java index 6cc40fd6e606..687d1019adad 100644 --- a/platform/util-rt/src/com/intellij/BundleBase.java +++ b/platform/util-rt/src/com/intellij/BundleBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,9 +32,9 @@ public abstract class BundleBase { public static boolean assertKeyIsFound = false; public static String messageOrDefault(@Nullable final ResourceBundle bundle, - final String key, + @NotNull String key, @Nullable final String defaultValue, - final Object... params) { + @NotNull Object... params) { if (bundle == null) return defaultValue; String value; diff --git a/platform/util/src/com/intellij/AbstractBundle.java b/platform/util/src/com/intellij/AbstractBundle.java index 372094e2211a..70502e86d32a 100644 --- a/platform/util/src/com/intellij/AbstractBundle.java +++ b/platform/util/src/com/intellij/AbstractBundle.java @@ -55,7 +55,7 @@ public abstract class AbstractBundle { myPathToBundle = pathToBundle; } - public String getMessage(@NotNull String key, Object... params) { + public String getMessage(@NotNull String key, @NotNull Object... params) { return CommonBundle.message(getBundle(), key, params); } diff --git a/platform/util/src/com/intellij/CommonBundle.java b/platform/util/src/com/intellij/CommonBundle.java index ce678364a5ba..25d0711d25b1 100644 --- a/platform/util/src/com/intellij/CommonBundle.java +++ b/platform/util/src/com/intellij/CommonBundle.java @@ -31,14 +31,15 @@ import java.util.ResourceBundle; */ @SuppressWarnings("MethodOverridesStaticMethodOfSuperclass") public class CommonBundle extends BundleBase { + + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { + return message(getCommonBundle(), key, params); + } + @NonNls private static final String BUNDLE = "messages.CommonBundle"; private static Reference ourBundle; - private CommonBundle() {} - - @NotNull - public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { - return message(getCommonBundle(), key, params); + private CommonBundle() { } @NotNull @@ -52,9 +53,9 @@ public class CommonBundle extends BundleBase { } public static String messageOrDefault(@Nullable final ResourceBundle bundle, - final String key, + @NotNull String key, @Nullable final String defaultValue, - final Object... params) { + @NotNull Object... params) { return BundleBase.messageOrDefault(bundle, key, defaultValue, params); } @@ -88,23 +89,22 @@ public class CommonBundle extends BundleBase { return message("tree.node.loading"); } - public static String getOkButtonText(){ + public static String getOkButtonText() { return message("button.ok"); } - public static String getYesButtonText(){ + public static String getYesButtonText() { return message("button.yes"); } - public static String getNoButtonText(){ + public static String getNoButtonText() { return message("button.no"); } - public static String getContinueButtonText(){ + public static String getContinueButtonText() { return message("button.continue"); } - public static String getYesForAllButtonText() { return message("button.yes.for.all"); } diff --git a/platform/util/src/com/intellij/ui/UIBundle.java b/platform/util/src/com/intellij/ui/UIBundle.java index b2381649a424..8802f9dfe830 100644 --- a/platform/util/src/com/intellij/ui/UIBundle.java +++ b/platform/util/src/com/intellij/ui/UIBundle.java @@ -17,6 +17,7 @@ package com.intellij.ui; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,17 +25,17 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class UIBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = "messages.UIBundle") String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.UIBundle"; private UIBundle() { } - public static String message(@PropertyKey(resourceBundle = "messages.UIBundle")String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerBundle.java b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerBundle.java index 8242c6dfdd49..a9594ca27ba7 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerBundle.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerBundle.java @@ -18,6 +18,7 @@ package com.intellij.xdebugger; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,16 +29,17 @@ import java.util.ResourceBundle; * @author nik */ public class XDebuggerBundle { + + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + @NonNls private static final String BUNDLE = "messages.XDebuggerBundle"; private static Reference ourBundle; private XDebuggerBundle() { } - public static String message(@NonNls @PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { @@ -46,5 +48,4 @@ public class XDebuggerBundle { } return bundle; } - } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.java index ebc18f2b498a..66847cc47dbc 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.java @@ -17,6 +17,7 @@ package com.siyeh; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class InspectionGadgetsBundle { - private static Reference ourBundle; + 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 = "com.siyeh.InspectionGadgetsBundle"; private InspectionGadgetsBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/IntentionPowerPak/src/com/siyeh/IntentionPowerPackBundle.java b/plugins/IntentionPowerPak/src/com/siyeh/IntentionPowerPackBundle.java index 7a7e23cfe4f2..44732e18fcbd 100644 --- a/plugins/IntentionPowerPak/src/com/siyeh/IntentionPowerPackBundle.java +++ b/plugins/IntentionPowerPak/src/com/siyeh/IntentionPowerPackBundle.java @@ -17,6 +17,7 @@ package com.siyeh; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class IntentionPowerPackBundle { - private static Reference ourBundle; + 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 = "com.siyeh.IntentionPowerPackBundle"; private IntentionPowerPackBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - public static String defaultableMessage(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { return CommonBundle.messageOrDefault(getBundle(), key, "default", true, (Object[])params); } diff --git a/plugins/ant/src/com/intellij/lang/ant/AntBundle.java b/plugins/ant/src/com/intellij/lang/ant/AntBundle.java index a0821abe4bf2..2abb224a454d 100644 --- a/plugins/ant/src/com/intellij/lang/ant/AntBundle.java +++ b/plugins/ant/src/com/intellij/lang/ant/AntBundle.java @@ -17,6 +17,7 @@ package com.intellij.lang.ant; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,18 +25,17 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class AntBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.AntBundle"; private AntBundle() { } - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/ant/src/com/intellij/lang/ant/resources/AntActionsBundle.java b/plugins/ant/src/com/intellij/lang/ant/resources/AntActionsBundle.java index f42ec62f253b..3a6c9fe283ee 100644 --- a/plugins/ant/src/com/intellij/lang/ant/resources/AntActionsBundle.java +++ b/plugins/ant/src/com/intellij/lang/ant/resources/AntActionsBundle.java @@ -17,6 +17,7 @@ package com.intellij.lang.ant.resources; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,8 +25,12 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public final class AntActionsBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = IDEA_ACTIONS_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls private static final String IDEA_ACTIONS_BUNDLE = "com.intellij.lang.ant.resources.AntActionsBundle"; private AntActionsBundle() { @@ -41,10 +46,6 @@ public final class AntActionsBundle { return message("action." + actionId + ".description"); } - public static String message(@PropertyKey(resourceBundle = IDEA_ACTIONS_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/cvs/cvs-core/src/com/intellij/CvsBundle.java b/plugins/cvs/cvs-core/src/com/intellij/CvsBundle.java index b1ad597f9b6c..f5a71b730a89 100644 --- a/plugins/cvs/cvs-core/src/com/intellij/CvsBundle.java +++ b/plugins/cvs/cvs-core/src/com/intellij/CvsBundle.java @@ -13,7 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij;import org.jetbrains.annotations.NonNls; +package com.intellij; + +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -21,8 +24,12 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class CvsBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls private static final String BUNDLE_NAME = "com.intellij.cvsSupport2.CvsBundle"; private CvsBundle() { @@ -64,10 +71,6 @@ public class CvsBundle { return message("operation.name.annotate"); } - public static String message(@PropertyKey(resourceBundle = BUNDLE_NAME)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/JavaCvsSrcBundle.java b/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/JavaCvsSrcBundle.java index 8e5ea9159077..e983756a81ae 100644 --- a/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/JavaCvsSrcBundle.java +++ b/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/JavaCvsSrcBundle.java @@ -17,6 +17,7 @@ package org.netbeans.lib.cvsclient; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author lesya */ public class JavaCvsSrcBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "org.netbeans.lib.cvsclient.JavaCvsSrcBundle"; private JavaCvsSrcBundle() { } - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/SmartCvsSrcBundle.java b/plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/SmartCvsSrcBundle.java index 93b1d78f1ccd..637a6f286181 100644 --- a/plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/SmartCvsSrcBundle.java +++ b/plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/SmartCvsSrcBundle.java @@ -17,6 +17,7 @@ package org.netbeans.lib.cvsclient; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author lesya */ public class SmartCvsSrcBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "org.netbeans.lib.cvsclient.SmartCvsSrcBundle"; private SmartCvsSrcBundle() { } - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/devkit/src/DevKitBundle.java b/plugins/devkit/src/DevKitBundle.java index a08cb196e0ce..8dfec4be8ee9 100644 --- a/plugins/devkit/src/DevKitBundle.java +++ b/plugins/devkit/src/DevKitBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.idea.devkit; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,17 +29,17 @@ import java.util.ResourceBundle; * Date: Aug 11, 2005 */ public class DevKitBundle { - private static Reference ourBundle; + 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 = "org.jetbrains.idea.devkit.DevKitBundle"; private DevKitBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/EclipseBundle.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/EclipseBundle.java index dfcc1a4bc699..c00e15b12aec 100644 --- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/EclipseBundle.java +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/EclipseBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.idea.eclipse; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,18 +25,18 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class EclipseBundle { - private static Reference ourBundle; + 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 = "EclipseBundle"; private EclipseBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/git4idea/rt/src/org/jetbrains/git4idea/ssh/SSHMainBundle.java b/plugins/git4idea/rt/src/org/jetbrains/git4idea/ssh/SSHMainBundle.java index 17c90a0c9526..f94cd2965cb2 100644 --- a/plugins/git4idea/rt/src/org/jetbrains/git4idea/ssh/SSHMainBundle.java +++ b/plugins/git4idea/rt/src/org/jetbrains/git4idea/ssh/SSHMainBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.git4idea.ssh; import com.intellij.BundleBase; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,15 +28,16 @@ import java.util.ResourceBundle; * The bundle for SSH messages */ public class SSHMainBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) { + return BundleBase.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls private static final String BUNDLE = "org.jetbrains.git4idea.ssh.SSHMainBundle"; - private SSHMainBundle() { } - - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return BundleBase.message(getBundle(), key, params); + private SSHMainBundle() { } private static ResourceBundle getBundle() { diff --git a/plugins/git4idea/src/git4idea/i18n/GitBundle.java b/plugins/git4idea/src/git4idea/i18n/GitBundle.java index 701adf6e2bc8..da0fe7c9a3ae 100644 --- a/plugins/git4idea/src/git4idea/i18n/GitBundle.java +++ b/plugins/git4idea/src/git4idea/i18n/GitBundle.java @@ -29,6 +29,7 @@ package git4idea.i18n; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -39,18 +40,18 @@ import java.util.ResourceBundle; * Git4Idea package I18N localization bundle helper */ public class GitBundle { - private static Reference ourBundle; + 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 = "git4idea.i18n.GitBundle"; private GitBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/codeInspection/GradleInspectionBundle.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/codeInspection/GradleInspectionBundle.java index 9bb1b6e5a0d9..af55b2471913 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/codeInspection/GradleInspectionBundle.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/codeInspection/GradleInspectionBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.plugins.gradle.codeInspection; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -29,15 +30,14 @@ import java.util.ResourceBundle; */ public class GradleInspectionBundle { - private static Reference ourBundle; - - @NonNls - private static final String BUNDLE = "org.jetbrains.plugins.gradle.codeInspection.GradleInspectionBundle"; - - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + 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 = "org.jetbrains.plugins.gradle.codeInspection.GradleInspectionBundle"; + private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); @@ -47,5 +47,4 @@ public class GradleInspectionBundle { } return bundle; } - } \ No newline at end of file diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleBundle.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleBundle.java index 066a07c2f973..9dd3fc420de5 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleBundle.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleBundle.java @@ -16,6 +16,7 @@ package org.jetbrains.plugins.gradle.util; import com.intellij.AbstractBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; /** @@ -24,14 +25,14 @@ import org.jetbrains.annotations.PropertyKey; */ public class GradleBundle extends AbstractBundle { - public static final String PATH_TO_BUNDLE = "i18n.GradleBundle"; - private static final GradleBundle BUNDLE = new GradleBundle(); + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return BUNDLE.getMessage(key, params); + } + + public static final String PATH_TO_BUNDLE = "i18n.GradleBundle"; + private static final GradleBundle BUNDLE = new GradleBundle(); public GradleBundle() { super(PATH_TO_BUNDLE); } - - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object... params) { - return BUNDLE.getMessage(key, params); - } } diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleDocumentationBundle.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleDocumentationBundle.java index c38e3946f1ce..e3bb3c09af55 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleDocumentationBundle.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleDocumentationBundle.java @@ -18,6 +18,7 @@ package org.jetbrains.plugins.gradle.util; import com.intellij.AbstractBundle; import com.intellij.CommonBundle; import com.intellij.reference.SoftReference; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -29,6 +30,10 @@ import java.util.ResourceBundle; */ public class GradleDocumentationBundle extends AbstractBundle { + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return BUNDLE.getMessage(key, params); + } + public static final String PATH_TO_BUNDLE = "i18n.GradleDocumentationBundle"; private static final GradleDocumentationBundle BUNDLE = new GradleDocumentationBundle(); private static Reference ourBundle; @@ -37,11 +42,9 @@ public class GradleDocumentationBundle extends AbstractBundle { super(PATH_TO_BUNDLE); } - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object... params) { - return BUNDLE.getMessage(key, params); - } - - public static String messageOrDefault(String key, String defaultValue, Object... params) { + public static String messageOrDefault(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, + String defaultValue, + @NotNull Object... params) { return CommonBundle.messageOrDefault(getBundle(), key, defaultValue, params); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.java index 75b5306f149f..9b587e21d4d0 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.java @@ -30,16 +30,14 @@ import java.util.ResourceBundle; */ public class GroovyBundle { - private static Reference ourBundle; - - @NonNls - private static final String BUNDLE = "org.jetbrains.plugins.groovy.GroovyBundle"; - - @NotNull - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + 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 = "org.jetbrains.plugins.groovy.GroovyBundle"; + private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); @@ -49,5 +47,4 @@ public class GroovyBundle { } return bundle; } - } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/GroovyCodeInsightBundle.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/GroovyCodeInsightBundle.java index 4627bc381f60..1823fd70f2ae 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/GroovyCodeInsightBundle.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/GroovyCodeInsightBundle.java @@ -16,6 +16,7 @@ package org.jetbrains.plugins.groovy.actions.generate; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.util.ResourceBundle; @@ -29,15 +30,15 @@ import com.intellij.CommonBundle; * Date: 02.06.2008 */ public class GroovyCodeInsightBundle { - private static Reference ourBundle; - @NonNls - private static final String BUNDLE = "org.jetbrains.plugins.groovy.actions.generate.GroovyCodeInsightBundle"; - - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + 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 = "org.jetbrains.plugins.groovy.actions.generate.GroovyCodeInsightBundle"; + private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.java index 9493104433bd..8c4a2042b52e 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.java @@ -16,6 +16,7 @@ package org.jetbrains.plugins.groovy.codeInspection; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.util.ResourceBundle; @@ -29,15 +30,14 @@ import com.intellij.CommonBundle; */ public class GroovyInspectionBundle { - private static Reference ourBundle; - - @NonNls - private static final String BUNDLE = "org.jetbrains.plugins.groovy.codeInspection.GroovyInspectionBundle"; - - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + 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 = "org.jetbrains.plugins.groovy.codeInspection.GroovyInspectionBundle"; + private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); @@ -47,5 +47,4 @@ public class GroovyInspectionBundle { } return bundle; } - } \ No newline at end of file diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/doc/GroovyDocBundle.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/doc/GroovyDocBundle.java index 198cbbbd2a45..4a403bcfb447 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/doc/GroovyDocBundle.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/doc/GroovyDocBundle.java @@ -18,6 +18,7 @@ package org.jetbrains.plugins.groovy.doc; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -26,15 +27,14 @@ import java.util.ResourceBundle; public class GroovyDocBundle { - private static Reference ourBundle; - - @NonNls - private static final String BUNDLE = "org.jetbrains.plugins.groovy.doc.GroovyDocBundle"; - - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { + 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 = "org.jetbrains.plugins.groovy.doc.GroovyDocBundle"; + private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); @@ -44,6 +44,5 @@ public class GroovyDocBundle { } return bundle; } - } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.java index 93b0b0fe825f..74bcfea49553 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.java @@ -18,6 +18,7 @@ package org.jetbrains.plugins.groovy.intentions; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -29,15 +30,14 @@ import java.util.ResourceBundle; */ public class GroovyIntentionsBundle { - private static Reference ourBundle; - - @NonNls - private static final String BUNDLE = "org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle"; - - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + 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 = "org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle"; + private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); @@ -47,5 +47,4 @@ public class GroovyIntentionsBundle { } return bundle; } - } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringBundle.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringBundle.java index ad5c5e9a1571..8a6fc6f693c9 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringBundle.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringBundle.java @@ -16,6 +16,7 @@ package org.jetbrains.plugins.groovy.refactoring; +import org.jetbrains.annotations.NotNull; import org.jetbrains.plugins.groovy.GroovyBundle; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.PropertyKey; @@ -31,15 +32,14 @@ import com.intellij.CommonBundle; */ public class GroovyRefactoringBundle { - private static Reference ourBundle; - - @NonNls - private static final String BUNDLE = "org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle"; - - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { + 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 = "org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle"; + private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); @@ -49,5 +49,4 @@ public class GroovyRefactoringBundle { } return bundle; } - } \ No newline at end of file diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/HgVcsMessages.java b/plugins/hg4idea/src/org/zmlx/hg4idea/HgVcsMessages.java index 27a7234ea72a..9937db3eb522 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/HgVcsMessages.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/HgVcsMessages.java @@ -12,6 +12,7 @@ // limitations under the License. package org.zmlx.hg4idea; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.PropertyKey; @@ -23,14 +24,14 @@ import com.intellij.CommonBundle; public final class HgVcsMessages { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull @Nullable Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + private static Reference ourBundle; private static final String BUNDLE = "org.zmlx.hg4idea.HgVcsMessages"; - private HgVcsMessages() { } - - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, @Nullable Object... params) { - return CommonBundle.message(getBundle(), key, params); + private HgVcsMessages() { } private static ResourceBundle getBundle() { @@ -41,5 +42,4 @@ public final class HgVcsMessages { } return bundle; } - } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomBundle.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomBundle.java index f980dce4573e..b5c68f498912 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomBundle.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.idea.maven.dom; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,18 +25,18 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class MavenDomBundle { - private static Reference ourBundle; + 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 = "MavenDomBundle"; private MavenDomBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/RunnerBundle.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/RunnerBundle.java index 73bf517ebb4b..342a5e074757 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/RunnerBundle.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/RunnerBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +16,19 @@ package org.jetbrains.idea.maven.execution; import com.intellij.AbstractBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; public class RunnerBundle extends AbstractBundle { + + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return ourInstance.getMessage(key, params); + } + private static final String PATH_TO_BUNDLE = "RunnerBundle"; private static final AbstractBundle ourInstance = new RunnerBundle(); private RunnerBundle() { super(PATH_TO_BUNDLE); } - - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return ourInstance.getMessage(key, params); - } } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/IndicesBundle.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/IndicesBundle.java index 60560940078a..f557c66bb210 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/IndicesBundle.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/IndicesBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.idea.maven.indices; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,18 +25,18 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class IndicesBundle { - private static Reference ourBundle; + 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 = "IndicesBundle"; private IndicesBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/ProjectBundle.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/ProjectBundle.java index 1bf7a9a43cbb..fe974edefb2c 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/ProjectBundle.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/ProjectBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.idea.maven.project; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,18 +25,18 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class ProjectBundle { - private static Reference ourBundle; + 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 = "ProjectBundle"; private ProjectBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/TasksBundle.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/TasksBundle.java index f0b1f38c0771..965bb11dab43 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/TasksBundle.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/TasksBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.idea.maven.tasks; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,18 +25,18 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class TasksBundle { - private static Reference ourBundle; + 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 = "TasksBundle"; private TasksBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesBundle.java b/plugins/properties/src/com/intellij/lang/properties/PropertiesBundle.java index e766152be274..290f5a476581 100644 --- a/plugins/properties/src/com/intellij/lang/properties/PropertiesBundle.java +++ b/plugins/properties/src/com/intellij/lang/properties/PropertiesBundle.java @@ -17,6 +17,7 @@ package com.intellij.lang.properties; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,17 +25,17 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class PropertiesBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.PropertiesBundle"; private PropertiesBundle() { } - public static String message(@PropertyKey(resourceBundle = PATH_TO_BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.java index 7e2ff1e86cbe..c3edbd500eb1 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.java @@ -17,6 +17,7 @@ package org.jetbrains.idea.svn; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -24,18 +25,18 @@ import java.lang.ref.SoftReference; import java.util.ResourceBundle; public class SvnBundle { - private static Reference ourBundle; + 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 = "org.jetbrains.idea.svn.SvnBundle"; private SvnBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - - public static String getString(@PropertyKey(resourceBundle = BUNDLE)String key) { + public static String getString(@PropertyKey(resourceBundle = BUNDLE) String key) { return getBundle().getString(key); } diff --git a/plugins/ui-designer-core/src/com/intellij/designer/DesignerBundle.java b/plugins/ui-designer-core/src/com/intellij/designer/DesignerBundle.java index 691276ca2f96..18f6319096c0 100644 --- a/plugins/ui-designer-core/src/com/intellij/designer/DesignerBundle.java +++ b/plugins/ui-designer-core/src/com/intellij/designer/DesignerBundle.java @@ -17,6 +17,7 @@ package com.intellij.designer; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author yole */ public class DesignerBundle { - private static Reference ourBundle; + 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 = "messages.DesignerBundle"; private DesignerBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/UIDesignerBundle.java b/plugins/ui-designer/src/com/intellij/uiDesigner/UIDesignerBundle.java index 0984ae126847..98c951f9d8c9 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/UIDesignerBundle.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/UIDesignerBundle.java @@ -17,6 +17,7 @@ package com.intellij.uiDesigner; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author yole */ public class UIDesignerBundle { - private static Reference ourBundle; + 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 = "messages.UIDesignerBundle"; private UIDesignerBundle() { } - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/python/rest/src/com/jetbrains/rest/RestBundle.java b/python/rest/src/com/jetbrains/rest/RestBundle.java index eacf64ed73b2..5884d2c2c819 100644 --- a/python/rest/src/com/jetbrains/rest/RestBundle.java +++ b/python/rest/src/com/jetbrains/rest/RestBundle.java @@ -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 ourBundle; + 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 = "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); diff --git a/python/src/com/jetbrains/python/PyBundle.java b/python/src/com/jetbrains/python/PyBundle.java index 042973fafcf2..28b853e31e5c 100644 --- a/python/src/com/jetbrains/python/PyBundle.java +++ b/python/src/com/jetbrains/python/PyBundle.java @@ -18,29 +18,31 @@ package com.jetbrains.python; 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; import java.util.ResourceBundle; // A copy of Ruby's. + /** * Resource bundle access. * Date: Nov 25, 2008 2:36:10 AM */ public class PyBundle { - private static Reference ourBundle; + 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 = "com.jetbrains.python.PyBundle"; private PyBundle() { } - 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); diff --git a/spellchecker/src/com/intellij/spellchecker/util/SpellCheckerBundle.java b/spellchecker/src/com/intellij/spellchecker/util/SpellCheckerBundle.java index cc9f63c2b6a3..cf4c87b54f83 100644 --- a/spellchecker/src/com/intellij/spellchecker/util/SpellCheckerBundle.java +++ b/spellchecker/src/com/intellij/spellchecker/util/SpellCheckerBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,21 +17,22 @@ package com.intellij.spellchecker.util; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.util.ResourceBundle; public final class SpellCheckerBundle { - @NonNls - private static final String BUNDLE_NAME = "com.intellij.spellchecker.util.SpellCheckerBundle"; - private static final ResourceBundle BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); - private SpellCheckerBundle() { - } + public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) { + return CommonBundle.message(BUNDLE, key, params); + } - public static String message(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) { - return CommonBundle.message(BUNDLE, key, params); - - } + @NonNls + private static final String BUNDLE_NAME = "com.intellij.spellchecker.util.SpellCheckerBundle"; + private static final ResourceBundle BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); + + private SpellCheckerBundle() { + } } diff --git a/xml/dom-openapi/src/com/intellij/util/xml/DomBundle.java b/xml/dom-openapi/src/com/intellij/util/xml/DomBundle.java index 07a41223a74e..a36a99a9301b 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/DomBundle.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/DomBundle.java @@ -18,6 +18,7 @@ package com.intellij.util.xml; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -28,17 +29,17 @@ import java.util.ResourceBundle; * @author Dmitry Avdeev */ public class DomBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = "messages.DomBundle") String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls protected static final String PATH_TO_BUNDLE = "messages.DomBundle"; private DomBundle() { } - public static String message(@PropertyKey(resourceBundle = "messages.DomBundle")String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/xml/xml-psi-api/src/com/intellij/xml/XmlBundle.java b/xml/xml-psi-api/src/com/intellij/xml/XmlBundle.java index 0abf03a3593f..7940a25d002e 100644 --- a/xml/xml-psi-api/src/com/intellij/xml/XmlBundle.java +++ b/xml/xml-psi-api/src/com/intellij/xml/XmlBundle.java @@ -17,6 +17,7 @@ package com.intellij.xml; import com.intellij.CommonBundle; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.lang.ref.Reference; @@ -27,17 +28,17 @@ import java.util.ResourceBundle; * @author lesya */ public class XmlBundle { - private static Reference ourBundle; + public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) { + return CommonBundle.message(getBundle(), key, params); + } + + private static Reference ourBundle; @NonNls public static final String PATH_TO_BUNDLE = "messages.XmlBundle"; private XmlBundle() { } - public static String message(@NonNls @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) { diff --git a/xml/xml-psi-impl/src/com/intellij/codeInsight/daemon/XmlErrorMessages.java b/xml/xml-psi-impl/src/com/intellij/codeInsight/daemon/XmlErrorMessages.java index 38dbb11f93e3..cdf58d17b9e6 100644 --- a/xml/xml-psi-impl/src/com/intellij/codeInsight/daemon/XmlErrorMessages.java +++ b/xml/xml-psi-impl/src/com/intellij/codeInsight/daemon/XmlErrorMessages.java @@ -28,18 +28,17 @@ import java.util.ResourceBundle; * @author max */ public class XmlErrorMessages { - private static Reference ourBundle; + 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 = "messages.XmlErrorMessages"; private XmlErrorMessages() { } - @NotNull - public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) { - return CommonBundle.message(getBundle(), key, params); - } - private static ResourceBundle getBundle() { ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle); if (bundle == null) {