jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
changeset 16953 a44e04deb948
parent 12457 c348e06f0e82
child 25264 040625ce9b72
equal deleted inserted replaced
16416:bcebd3fdefc9 16953:a44e04deb948
    24 import java.util.MissingResourceException;
    24 import java.util.MissingResourceException;
    25 import java.util.ResourceBundle;
    25 import java.util.ResourceBundle;
    26 import java.util.PropertyResourceBundle;
    26 import java.util.PropertyResourceBundle;
    27 
    27 
    28 import com.sun.org.apache.xerces.internal.util.MessageFormatter;
    28 import com.sun.org.apache.xerces.internal.util.MessageFormatter;
       
    29 import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
    29 
    30 
    30 /**
    31 /**
    31  * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
    32  * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
    32  * the Namespaces Recommendation
    33  * the Namespaces Recommendation
    33  *
    34  *
    34  * @xerces.internal
    35  * @xerces.internal
    35  *
    36  *
    36  * @author Eric Ye, IBM
    37  * @author Eric Ye, IBM
    37  * @version $Id: XMLMessageFormatter_ja.java 3021 2011-03-01 00:12:28Z joehw $
    38  * @version $Id: XMLMessageFormatter_ja.java 3094 2012-03-21 05:50:01Z joehw $
    38  *
    39  *
    39  */
    40  */
    40 public class XMLMessageFormatter_ja implements MessageFormatter {
    41 public class XMLMessageFormatter_ja implements MessageFormatter {
    41     /**
    42     /**
    42      * The domain of messages concerning the XML 1.0 specification.
    43      * The domain of messages concerning the XML 1.0 specification.
    70     public String formatMessage(Locale locale, String key, Object[] arguments)
    71     public String formatMessage(Locale locale, String key, Object[] arguments)
    71         throws MissingResourceException {
    72         throws MissingResourceException {
    72 
    73 
    73         if (fResourceBundle == null || locale != fLocale) {
    74         if (fResourceBundle == null || locale != fLocale) {
    74             if (locale != null) {
    75             if (locale != null) {
    75                 fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
    76                 fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
    76                 // memorize the most-recent locale
    77                 // memorize the most-recent locale
    77                 fLocale = locale;
    78                 fLocale = locale;
    78             }
    79             }
    79             if (fResourceBundle == null)
    80             if (fResourceBundle == null)
    80                 fResourceBundle = PropertyResourceBundle.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
    81                 fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
    81         }
    82         }
    82 
    83 
    83         // format message
    84         // format message
    84         String msg;
    85         String msg;
    85         try {
    86         try {