Long vs Integer parsing selector modified field 87/3887/1
authorAndrew Gauld <agauld@att.com>
Mon, 4 Mar 2019 15:40:13 +0000 (15:40 +0000)
committerAndrew Gauld <agauld@att.com>
Mon, 4 Mar 2019 15:41:03 +0000 (15:41 +0000)
Change-Id: I37f838f16dd67a9b4cb3f47407becdcd93f83370
Issue-ID: ACUMOS-2570
Signed-off-by: Andrew Gauld <agauld@att.com>
docs/release-notes.rst
gateway/src/main/java/org/acumos/federation/gateway/service/impl/CatalogServiceImpl.java
gateway/src/main/java/org/acumos/federation/gateway/service/impl/ServiceImpl.java

index e3c79d8..8a5358f 100644 (file)
@@ -32,6 +32,7 @@ Version 2.0.1, 2019-02-26
 * Various problems found with version 2.0.0 (`ACUMOS-2570 <https://jira.acumos.org/browse/ACUMOS-2570>`_)
   - List dependency on jersey-hk2 for spring-boot
   - Instant rendered as JSON object rather than seconds since epoch
+  - Seconds since epoch may parse as Integer instead of Long
 
 Version 2.0.0, 2019-02-20
 -------------------------
index b265fc6..5861966 100644 (file)
@@ -123,7 +123,7 @@ public class CatalogServiceImpl extends AbstractServiceImpl
                                        codes = ((List<String>)o).toArray(new String[0]);
                                }
                                String[] xcodes = codes;
-                               Instant since = Instant.ofEpochSecond((Long)selector.get(Solution.Fields.modified));
+                               Instant since = Instant.ofEpochSecond(((Number)selector.get(Solution.Fields.modified)).longValue());
                                pager = page -> cdsClient.findSolutionsByDate(active, xcodes, since, page);
                        }
                        do {
index e59b470..ee5b09a 100644 (file)
@@ -167,7 +167,7 @@ public abstract class ServiceImpl {
                log.trace("compileSelector {}", theSelector);
                Boolean ao = (Boolean)theSelector.get(Solution.Fields.active);
                boolean active = ao == null? true: ao.booleanValue();
-               Instant since = Instant.ofEpochSecond((Long)theSelector.get(Solution.Fields.modified));
+               Instant since = Instant.ofEpochSecond(((Number)theSelector.get(Solution.Fields.modified)).longValue());
                return(and(
                        arg -> arg.isActive() == active,
                        arg -> arg.getModified().compareTo(since) >= 0,