Changeset c199124


Ignore:
Timestamp:
Mar 27, 2017 2:12:42 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ed590cd
Parents:
b503f03
Message:

Time: Fix crashes on old Androids (ticket #1976)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/time/BuildTime.java

    rb503f03 rc199124  
    3535    private static final long YEARS_25 = 25L*365*24*60*60*1000;
    3636    /** update this periodically */
    37     private static final String EARLIEST = "2016-02-19 12:00:00 UTC";
     37    private static final String EARLIEST = "2017-03-27 12:00:00 UTC";
     38    // fallback if parse fails ticket #1976
     39    // date -d 201x-xx-xx +%s
     40    private static final long EARLIEST_LONG = 1490587200 * 1000L;
    3841
    3942    static {
     
    4649            Date date = fmt.parse(EARLIEST);
    4750            if (date == null)
    48                 throw new RuntimeException("BuildTime FAIL");
    49             min = date.getTime();
     51                min = EARLIEST_LONG;
     52            else
     53                min = date.getTime();
    5054        } catch (ParseException pe) {
    5155            System.out.println("BuildTime FAIL");
    52             pe.printStackTrace();
    53             throw new RuntimeException("BuildTime FAIL", pe);
     56            // Old Android, ticket #1976
     57            //pe.printStackTrace();
     58            //throw new RuntimeException("BuildTime FAIL", pe);
     59            min = EARLIEST_LONG;
    5460        }
    5561        long max = min + YEARS_25;
Note: See TracChangeset for help on using the changeset viewer.