JAL-3454 file loading string-only (testNG) fails for PDB file
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index 6db04a0..8c29078 100755 (executable)
@@ -158,9 +158,9 @@ public class AppletFormatAdapter
   {
 
     this.selectedFile = selectedFile;
-    if (selectedFile != null)
-      this.inFile = selectedFile.getPath();
-    this.inFile = file;
+    // BH 2019.10.06 PDB.getSequenceRecords calling this and then needs string,
+    // below
+    inFile = (selectedFile == null ? file : selectedFile.getPath());
     try
     {
       if (fileFormat.isStructureFile())
@@ -179,6 +179,8 @@ public class AppletFormatAdapter
         }
         else
         {
+          // BH: This block is executed by PDBSequenceFetcherTest
+
           // todo is mc_view parsing obsolete yet? JAL-2120
           StructureImportSettings.setShowSeqFeatures(true);
           alignFile = new mc_view.PDBfile(annotFromStructure,
@@ -435,7 +437,9 @@ public class AppletFormatAdapter
   public static DataSourceType checkProtocol(Object dataObject)
   {
     if(dataObject instanceof File)
+    {
       return DataSourceType.FILE;
+    }
     
     String data = dataObject.toString();
     DataSourceType protocol = DataSourceType.PASTE;
@@ -456,6 +460,10 @@ public class AppletFormatAdapter
     return protocol;
   }
 
+  /**
+   * @param args
+   * @j2sIgnore
+   */
   public static void main(String[] args)
   {
     int i = 0;