JAL-3690 patch out need for java.time in j2s (see https://github.com/BobHanson/java2s...
authorJim Procter <jprocter@issues.jalview.org>
Tue, 15 Dec 2020 18:45:32 +0000 (18:45 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 15 Dec 2020 18:45:32 +0000 (18:45 +0000)
src/jalview/ws/api/JobId.java

index 2a092bd..5c3b51d 100644 (file)
@@ -1,6 +1,5 @@
 package jalview.ws.api;
 
-import java.time.Instant;
 import java.util.Date;
 
 public class JobId
@@ -12,22 +11,31 @@ public class JobId
   private String serviceImpl;
 
   private String jobId;
-
-  private Instant creationTime;
+  // TODO: java2script instant
+  private String creationTime=null;
 
   public JobId(String serviceType, String serviceImpl, String id)
   {
     this.serviceType = serviceType;
     this.serviceImpl = serviceImpl;
     jobId = id;
-    creationTime = Instant.now();
+    /*
+     * @j2sIgnore
+     */
+    {
+//      creationTime = Date.from(Instant.now()).toString();
+    }
+    if (creationTime==null)
+    {
+      creationTime = new Date().toString(); // j2s only
+    }
   }
 
   @Override
   public String toString()
   {
     return "" + serviceType + ":" + serviceImpl + ":" + jobId + "\nCreated "
-            + Date.from(creationTime);
+            + creationTime;
   }
   /**
    * a stringified version of the Job Id that can be saved in project.
@@ -52,7 +60,7 @@ public class JobId
     return jobId;
   }
 
-  public Instant getCreationTime()
+  public String getCreationTime()
   {
     return creationTime;
   }