From 16c1e42b976320464dcd1021ff0aa2490bbc31ff Mon Sep 17 00:00:00 2001 From: Shen-Ta Hsieh Date: Wed, 28 Aug 2019 03:20:49 +0800 Subject: [PATCH] normalize license expire date to prevent outstanding value on Java 12 Date(Long.MAX_VALUE) is 292278994-08-17T07:12:55.807Z on Java 12, and make Ultrasonic failed to parse. Signed-off-by: Shen-Ta Hsieh --- .../airsonic/player/controller/SubsonicRESTController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java b/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java index 3651c214..9e87f4fe 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java +++ b/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java @@ -170,9 +170,10 @@ public class SubsonicRESTController { license.setEmail("airsonic@github.com"); license.setValid(true); - Date neverExpireDate = new Date(Long.MAX_VALUE); - license.setLicenseExpires(jaxbWriter.convertDate(neverExpireDate)); - license.setTrialExpires(jaxbWriter.convertDate(neverExpireDate)); + Date farFuture = new Date(); + farFuture.setYear(farFuture.getYear() + 100); + license.setLicenseExpires(jaxbWriter.convertDate(farFuture)); + license.setTrialExpires(jaxbWriter.convertDate(farFuture)); Response res = createResponse(); res.setLicense(license);