guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#33041] [PATCH] gnu: icedtea-6: Make javadoc reproducible.


From: Danny Milosavljevic
Subject: [bug#33041] [PATCH] gnu: icedtea-6: Make javadoc reproducible.
Date: Wed, 17 Oct 2018 09:58:11 +0200

Hi Gabor,

On Sun, 14 Oct 2018 21:06:55 +0200
Gábor Boskovits <address@hidden> wrote:

> +diff -r 06656286f572 -r 6e5f716a6592 
> src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
> +--- 
> a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
>  Mon Aug 22 10:53:55 2016 -0700
> ++++ 
> b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
>  Sat Oct 13 20:54:34 2018 +0200
> +@@ -396,6 +396,13 @@
> +      */
> +     public String today() {
> +         Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
> +-        return calendar.getTime().toString();
> ++    Date date=calendar.getTime();
> ++    Map<String,String> env = System.getenv();
> ++    if(env.containsKey("SOURCE_DATE_EPOCH")) {
> ++        String epoch=env.get("SOURCE_DATE_EPOCH");
> ++        long unixtime=Long.parseLong(epoch);
> ++        date=new Date(unixtime*1000L);
> ++    }
> ++        return date.toString();
> +     }
> + }

Indentation is off.

Also, why not System.getenv("SOURCE_DATE_EPOCH") and check for null?  Not that 
important, though.

Otherwise LGTM!

Attachment: pgp3N4LwpUwgY.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]