You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/08/17 21:28:29 UTC
svn commit: r1756691 -
/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/InternationalizedException.java
Author: schor
Date: Wed Aug 17 21:28:29 2016
New Revision: 1756691
URL: http://svn.apache.org/viewvc?rev=1756691&view=rev
Log:
[UIMA-4793] trying to fix this by using already fixed I18NUtil
Modified:
uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/InternationalizedException.java
Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/InternationalizedException.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/InternationalizedException.java?rev=1756691&r1=1756690&r2=1756691&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/InternationalizedException.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/InternationalizedException.java Wed Aug 17 21:28:29 2016
@@ -19,9 +19,9 @@
package org.apache.uima;
-import java.text.MessageFormat;
import java.util.Locale;
-import java.util.ResourceBundle;
+
+import org.apache.uima.internal.util.I18nUtil;
/**
* The <code>InternationalizedException</code> class adds internationalization
@@ -233,25 +233,26 @@ public class InternationalizedException
if (getMessageKey() == null)
return null;
- try {
- // locate the resource bundle for this exception's messages
- // turn over the classloader of the current object explicitly, so that the
- // message resolving also works for derived exception classes
- ResourceBundle bundle = ResourceBundle.getBundle(
- getResourceBundleName(), aLocale, this.getClass()
- .getClassLoader());
- // retrieve the message from the resource bundle
- String message = bundle.getString(getMessageKey());
- // if arguments exist, use MessageFormat to include them
- if (getArguments().length > 0) {
- MessageFormat fmt = new MessageFormat(message);
- fmt.setLocale(aLocale);
- return fmt.format(getArguments());
- } else
- return message;
- } catch (Exception e) {
- return "EXCEPTION MESSAGE LOCALIZATION FAILED: " + e.toString();
- }
+ return I18nUtil.localizeMessage(getResourceBundleName(), aLocale, getMessageKey(), getArguments());
+// try {
+// // locate the resource bundle for this exception's messages
+// // turn over the classloader of the current object explicitly, so that the
+// // message resolving also works for derived exception classes
+// ResourceBundle bundle = ResourceBundle.getBundle(
+// getResourceBundleName(), aLocale, this.getClass()
+// .getClassLoader());
+// // retrieve the message from the resource bundle
+// String message = bundle.getString(getMessageKey());
+// // if arguments exist, use MessageFormat to include them
+// if (getArguments().length > 0) {
+// MessageFormat fmt = new MessageFormat(message);
+// fmt.setLocale(aLocale);
+// return fmt.format(getArguments());
+// } else
+// return message;
+// } catch (Exception e) {
+// return "EXCEPTION MESSAGE LOCALIZATION FAILED: " + e.toString();
+// }
}
/**