boolean throwex = false;
int majorCode;
int minorCode;
String fmsg = null;
XResourceBundleBase aResourceBundle = null;
aResourceBundle = (XResourceBundleBase) loadResourceBundle(bundleName);
String msgKey = aResourceBundle.getMessageKey(errorCode);
String msg = null;
if (msgKey != null)
msg = aResourceBundle.getString(msgKey);
if (msg == null)
{
msg = aResourceBundle.getString(BAD_CODE);
throwex = true;
}
if (args != null)
{
try
{
// Do this to keep format from crying.
// This is better than making a bunch of conditional
// code all over the place.
int n = args.length;
for (int i = 0; i < n; i++)
{
if (null == args[i])
args[i] = "";
}
fmsg = java.text.MessageFormat.format(msg, args);
}
catch (Exception e)
{
fmsg = aResourceBundle.getString(FORMAT_FAILED);
fmsg += " " + msg;
}
}
else
fmsg = msg;