JAL-2349 JAL-3855 off by one and daft return
[jalview.git] / src / com / stevesoft / pat / Transformer.java
index d770f08..0339a43 100755 (executable)
@@ -7,7 +7,9 @@
 //
 package com.stevesoft.pat;
 
-import com.stevesoft.pat.wrap.*;
+import jalview.util.MessageManager;
+
+import com.stevesoft.pat.wrap.StringWrap;
 
 /**
  * Replacement rule used by the Transformer.
@@ -116,7 +118,8 @@ public class Transformer
   {
     if (i >= tp.ra_len)
     {
-      throw new ArrayIndexOutOfBoundsException("i=" + i + ">=" + patterns());
+      throw new ArrayIndexOutOfBoundsException(
+              "i=" + i + ">=" + patterns());
     }
     if (i < 0)
     {
@@ -130,7 +133,8 @@ public class Transformer
   {
     if (i >= tp.ra_len)
     {
-      throw new ArrayIndexOutOfBoundsException("i=" + i + ">=" + patterns());
+      throw new ArrayIndexOutOfBoundsException(
+              "i=" + i + ">=" + patterns());
     }
     if (i < 0)
     {
@@ -149,7 +153,9 @@ public class Transformer
     Regex r = Regex.perlCode(rs);
     if (r == null)
     {
-      throw new NullPointerException("bad pattern to Regex.perlCode: " + rs);
+      throw new NullPointerException(MessageManager.formatMessage(
+              "exception.bad_pattern_to_regex_perl_code", new String[]
+              { rs }));
     }
     add(r);
   }