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 <ibmibmibm.tw@gmail.com>
master
Shen-Ta Hsieh 5 years ago
parent 6e8ae8971c
commit 16c1e42b97
No known key found for this signature in database
GPG Key ID: DF7FED2B0492FA77
  1. 7
      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);

Loading…
Cancel
Save