jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java
changeset 16953 a44e04deb948
parent 12457 c348e06f0e82
--- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java	Wed Jul 05 18:46:58 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java	Mon Feb 18 11:33:35 2013 -0800
@@ -22,68 +22,72 @@
  */
 package com.sun.org.apache.xalan.internal.res;
 
+import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
 import java.util.ListResourceBundle;
 
 import com.sun.org.apache.xpath.internal.res.XPATHMessages;
 
 /**
- * Sets things up for issuing error messages.  This class is misnamed, and
- * should be called XalanMessages, or some such.
+ * Sets things up for issuing error messages. This class is misnamed, and should
+ * be called XalanMessages, or some such.
+ *
  * @xsl.usage internal
  */
-public class XSLMessages extends XPATHMessages
-{
+public class XSLMessages extends XPATHMessages {
 
-  /** The language specific resource object for Xalan messages.  */
-  private static ListResourceBundle XSLTBundle = null;
-
-  /** The class name of the Xalan error message string table.    */
-  private static final String XSLT_ERROR_RESOURCES =
-    "com.sun.org.apache.xalan.internal.res.XSLTErrorResources";
+    /**
+     * The language specific resource object for Xalan messages.
+     */
+    private static ListResourceBundle XSLTBundle = null;
+    /**
+     * The class name of the Xalan error message string table.
+     */
+    private static final String XSLT_ERROR_RESOURCES =
+            "com.sun.org.apache.xalan.internal.res.XSLTErrorResources";
 
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param msgKey    The key for the message text.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted message string.
-   */
-  public static final String createMessage(String msgKey, Object args[])  //throws Exception
-  {
-    if (XSLTBundle == null)
-      XSLTBundle = loadResourceBundle(XSLT_ERROR_RESOURCES);
-
-    if (XSLTBundle != null)
+    /**
+     * Creates a message from the specified key and replacement arguments,
+     * localized to the given locale.
+     *
+     * @param msgKey The key for the message text.
+     * @param args The arguments to be used as replacement text in the message
+     * created.
+     *
+     * @return The formatted message string.
+     */
+    public static String createMessage(String msgKey, Object args[]) //throws Exception
     {
-      return createMsg(XSLTBundle, msgKey, args);
+        if (XSLTBundle == null) {
+            XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES);
+        }
+
+        if (XSLTBundle != null) {
+            return createMsg(XSLTBundle, msgKey, args);
+        } else {
+            return "Could not load any resource bundles.";
+        }
     }
-    else
-      return "Could not load any resource bundles.";
-  }
 
-  /**
-   * Creates a message from the specified key and replacement
-   * arguments, localized to the given locale.
-   *
-   * @param msgKey    The key for the message text.
-   * @param args      The arguments to be used as replacement text
-   *                  in the message created.
-   *
-   * @return The formatted warning string.
-   */
-  public static final String createWarning(String msgKey, Object args[])  //throws Exception
-  {
-    if (XSLTBundle == null)
-      XSLTBundle = loadResourceBundle(XSLT_ERROR_RESOURCES);
+    /**
+     * Creates a message from the specified key and replacement arguments,
+     * localized to the given locale.
+     *
+     * @param msgKey The key for the message text.
+     * @param args The arguments to be used as replacement text in the message
+     * created.
+     *
+     * @return The formatted warning string.
+     */
+    public static String createWarning(String msgKey, Object args[]) //throws Exception
+    {
+        if (XSLTBundle == null) {
+            XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES);
+        }
 
-    if (XSLTBundle != null)
-    {
-      return createMsg(XSLTBundle, msgKey, args);
+        if (XSLTBundle != null) {
+            return createMsg(XSLTBundle, msgKey, args);
+        } else {
+            return "Could not load any resource bundles.";
+        }
     }
-    else
-      return "Could not load any resource bundles.";
-  }
 }