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 2015/12/01 19:11:24 UTC

svn commit: r1717480 - /uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/UIMARuntimeException.java

Author: schor
Date: Tue Dec  1 18:11:24 2015
New Revision: 1717480

URL: http://svn.apache.org/viewvc?rev=1717480&view=rev
Log:
[UIMA-4670] make it work with FeaturePath style exceptions

Modified:
    uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/UIMARuntimeException.java

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/UIMARuntimeException.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/UIMARuntimeException.java?rev=1717480&r1=1717479&r2=1717480&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/UIMARuntimeException.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/UIMARuntimeException.java Tue Dec  1 18:11:24 2015
@@ -165,6 +165,10 @@ public class UIMARuntimeException extend
   public static final String INTERNAL_ERROR = "INTERNAL_ERROR";
 
   /**
+   * the message bundle to use for this exception
+   */
+  private String mMessageBundle = resource_file; 
+  /**
    * An identifier that maps to the message for this exception.
    */
   private String mMessageKey;
@@ -204,6 +208,11 @@ public class UIMARuntimeException extend
    */
   public UIMARuntimeException(Throwable aCause) {
     super(aCause);
+    if (mMessageKey == null && (aCause instanceof I18nExceptionI)) {
+      I18nExceptionI cause = (I18nExceptionI)aCause;
+      mMessageKey = cause.getMessageKey();
+      mArguments  = cause.getArguments();
+    }
   }
 
   /**
@@ -218,9 +227,14 @@ public class UIMARuntimeException extend
    *          arguments.
    */
   public UIMARuntimeException(String aMessageKey, Object ... aArguments) {
-    this(null, aMessageKey, aArguments);
+    this((Throwable)null, aMessageKey, aArguments);
   }
 
+  public UIMARuntimeException(String messageBundle, String messageKey, Object[] arguments) {
+    this(messageKey, arguments);
+    mMessageBundle = messageBundle;
+  }
+  
   /**
    * Creates a new exception with the specified message and cause.
    * 
@@ -258,7 +272,7 @@ public class UIMARuntimeException extend
    */
   @Override
   public String getResourceBundleName() {
-    return resource_file;
+    return mMessageBundle;
   }
   
   /**