JAL-4187 JAL-629 JAL-3830 adjustments to Cygwin and WSL parts of bash launcher script...
[jalview.git] / src / jalview / ws / dbsources / TDBeacons.java
index b2fbc17..7326c6e 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.ws.dbsources;
 
+import java.util.Locale;
+
 import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
@@ -70,7 +72,7 @@ public class TDBeacons extends DbSourceProxyImpl
   private static final String DEFAULT_UNIPROT_DOMAIN = "https://www.uniprot.org";
 
   private static final String BAR_DELIMITER = "|";
-  
+
   private static final String DEFAULT_THREEDBEACONS_DOMAIN = "https://wwwdev.ebi.ac.uk/pdbe/pdbe-kb/3dbeacons-hub-api/uniprot/summary/";
 
   /**
@@ -84,7 +86,7 @@ public class TDBeacons extends DbSourceProxyImpl
   private String getDomain()
   {
     return Cache.getDefault("UNIPROT_DOMAIN", DEFAULT_UNIPROT_DOMAIN);
-    //return Cache.getDefault("3DB_DOMAIN", DEFAULT_THREEDBEACONS_DOMAIN );
+    // return Cache.getDefault("3DB_DOMAIN", DEFAULT_THREEDBEACONS_DOMAIN );
   }
 
   /*
@@ -142,13 +144,12 @@ public class TDBeacons extends DbSourceProxyImpl
     startQuery();
     try
     {
-      queries = queries.toUpperCase().replaceAll(
+      queries = queries.toUpperCase(Locale.ROOT).replaceAll(
               "(UNIPROT\\|?|UNIPROT_|UNIREF\\d+_|UNIREF\\d+\\|?)", "");
       AlignmentI al = null;
 
-      String downloadstring = getDomain() + "/uniprot/" + queries
-              + ".xml";
-//      String downloadstring = getDomain() + queries + ".json";
+      String downloadstring = getDomain() + "/uniprot/" + queries + ".xml";
+      // String downloadstring = getDomain() + queries + ".json";
 
       URL url = new URL(downloadstring);
       URLConnection urlconn = url.openConnection();
@@ -190,8 +191,7 @@ public class TDBeacons extends DbSourceProxyImpl
     String seqString = entry.getSequence().getValue().replaceAll("\\s*",
             "");
 
-    SequenceI sequence = new Sequence(id,
-            seqString);
+    SequenceI sequence = new Sequence(id, seqString);
     sequence.setDescription(getUniprotEntryDescription(entry));
 
     /*
@@ -507,10 +507,12 @@ public class TDBeacons extends DbSourceProxyImpl
       XMLStreamReader streamReader = XMLInputFactory.newInstance()
               .createXMLStreamReader(is);
       javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
-      JAXBElement<jalview.xml.binding.uniprot.Uniprot> uniprotElement = 
-                 um.unmarshal(streamReader, jalview.xml.binding.uniprot.Uniprot.class);
-      jalview.xml.binding.uniprot.Uniprot uniprot = uniprotElement.getValue();
-      
+      JAXBElement<jalview.xml.binding.uniprot.Uniprot> uniprotElement = um
+              .unmarshal(streamReader,
+                      jalview.xml.binding.uniprot.Uniprot.class);
+      jalview.xml.binding.uniprot.Uniprot uniprot = uniprotElement
+              .getValue();
+
       if (uniprot != null && !uniprot.getEntry().isEmpty())
       {
         entries = uniprot.getEntry();