From: Jim Procter Date: Tue, 15 Dec 2020 18:45:32 +0000 (+0000) Subject: JAL-3690 patch out need for java.time in j2s (see https://github.com/BobHanson/java2s... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ec224927b3bb3fb9946c6790a41d12e59b04dfb1;p=jalview.git JAL-3690 patch out need for java.time in j2s (see https://github.com/BobHanson/java2script/issues/194 ) --- diff --git a/src/jalview/ws/api/JobId.java b/src/jalview/ws/api/JobId.java index 2a092bd..5c3b51d 100644 --- a/src/jalview/ws/api/JobId.java +++ b/src/jalview/ws/api/JobId.java @@ -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; }