JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / ext / ensembl / EnsemblGene.java
index 0d73a47..63a6a6c 100644 (file)
@@ -56,7 +56,7 @@ public class EnsemblGene extends EnsemblSeqProxy
    * accepts anything as we will attempt lookup of gene or 
    * transcript id or gene name
    */
-  private static final Regex ACCESSION_REGEX = new Regex(".*");
+  private static Regex ACCESSION_REGEX;
 
   private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
       EnsemblFeatureType.gene, EnsemblFeatureType.transcript,
@@ -577,7 +577,7 @@ public class EnsemblGene extends EnsemblSeqProxy
   @Override
   protected boolean retainFeature(SequenceFeature sf, String accessionId)
   {
-    SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+    SequenceOntologyI so = SequenceOntologyFactory.getSequenceOntology();
     String type = sf.getType();
     if (so.isA(type, SequenceOntologyI.GENE))
     {
@@ -606,6 +606,10 @@ public class EnsemblGene extends EnsemblSeqProxy
   @Override
   public Regex getAccessionValidator()
   {
+    if (ACCESSION_REGEX == null)
+    {
+      ACCESSION_REGEX = Platform.newRegex(".*", null);
+    }
     return ACCESSION_REGEX;
   }
 
@@ -624,7 +628,7 @@ public class EnsemblGene extends EnsemblSeqProxy
   {
     return new FeatureSettingsAdapter()
     {
-      SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+      SequenceOntologyI so = SequenceOntologyFactory.getSequenceOntology();
 
       @Override
       public boolean isFeatureDisplayed(String type)