JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / ws / dbsources / EmblCdsSource.java
index 03f0d16..c5159f2 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -22,12 +22,15 @@ package jalview.ws.dbsources;
 
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefSource;
+import jalview.util.Platform;
 
 import com.stevesoft.pat.Regex;
 
 public class EmblCdsSource extends EmblXmlSource
 {
 
+  private Regex ACCESSION_REGEX = null;
+
   public EmblCdsSource()
   {
     super();
@@ -42,7 +45,11 @@ public class EmblCdsSource extends EmblXmlSource
   @Override
   public Regex getAccessionValidator()
   {
-    return new Regex("^[A-Z]+[0-9]+");
+    if (ACCESSION_REGEX == null)
+    {
+      ACCESSION_REGEX = Platform.newRegex("^[A-Z]+[0-9]+", null);
+    }
+    return ACCESSION_REGEX;
   }
 
   @Override