Formats a message with the specified arguments using the given locale
information.
if (fResourceBundle == null || locale != fLocale) {
if (locale != null) {
fResourceBundle = PropertyResourceBundle.getBundle(
"com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages", locale);
// memorize the most-recent locale
fLocale = locale;
}
if (fResourceBundle == null)
fResourceBundle = PropertyResourceBundle
.getBundle("com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages");
}
String msg = fResourceBundle.getString(key);
if (arguments != null) {
try {
msg = java.text.MessageFormat.format(msg, arguments);
} catch (Exception e) {
msg = fResourceBundle.getString("FormatFailed");
msg += " " + fResourceBundle.getString(key);
}
}
if (msg == null) {
msg = fResourceBundle.getString("BadMessageKey");
throw new MissingResourceException(msg,
"com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages", key);
}
return msg;