JAL-1355
[jalview.git] / src / jalview / binding / SequenceSet.java
index 85b4889..59151c8 100644 (file)
@@ -24,6 +24,8 @@ package jalview.binding;
 //- Imported classes and packages -/
 //---------------------------------/
 
+import jalview.util.MessageManager;
+
 import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.Unmarshaller;
 
@@ -186,9 +188,11 @@ public class SequenceSet implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._annotationList.size())
     {
-      throw new IndexOutOfBoundsException("getAnnotation: Index value '"
-              + index + "' not in range [0.."
-              + (this._annotationList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                 "getAnnotation",
+                 Integer.valueOf(index).toString(),
+                 Integer.valueOf((this._annotationList.size() - 1)).toString()
+        })); 
     }
 
     return (jalview.binding.Annotation) _annotationList.get(index);
@@ -244,9 +248,11 @@ public class SequenceSet implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._sequenceList.size())
     {
-      throw new IndexOutOfBoundsException("getSequence: Index value '"
-              + index + "' not in range [0.."
-              + (this._sequenceList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                         "getSequence",
+                         Integer.valueOf(index).toString(),
+                         Integer.valueOf((this._sequenceList.size() - 1)).toString()
+          })); 
     }
 
     return (jalview.binding.Sequence) _sequenceList.get(index);
@@ -441,9 +447,11 @@ public class SequenceSet implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._annotationList.size())
     {
-      throw new IndexOutOfBoundsException("setAnnotation: Index value '"
-              + index + "' not in range [0.."
-              + (this._annotationList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                 "setAnnotation",
+                 Integer.valueOf(index).toString(),
+                 Integer.valueOf((this._annotationList.size() - 1)).toString()
+        })); 
     }
 
     this._annotationList.set(index, vAnnotation);
@@ -492,9 +500,11 @@ public class SequenceSet implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._sequenceList.size())
     {
-      throw new IndexOutOfBoundsException("setSequence: Index value '"
-              + index + "' not in range [0.."
-              + (this._sequenceList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                         "setSequence",
+                         Integer.valueOf(index).toString(),
+                         Integer.valueOf((this._sequenceList.size() - 1)).toString()
+          })); 
     }
 
     this._sequenceList.set(index, vSequence);