package com.amee.platform.science;

import org.joda.time.DateTime;

import java.util.Date;

public abstract class BaseDate extends java.util.Date {

    protected String dateStr;

    public BaseDate(long time) {
        setTime(time);
        setDefaultDateStr();
    }

    public BaseDate(String dateStr) {
        super();
        if (dateStr != null) {
            setTime(parseStr(dateStr));
            this.dateStr = dateStr;
        } else {
            setTime(defaultDate());
            setDefaultDateStr();
        }
    }

    protected abstract long parseStr(String dateStr);

    protected abstract void setDefaultDateStr();

    protected abstract long defaultDate();

    public String toString() {
        return dateStr;
    }

    public DateTime toDateTime() {
        return new DateTime(this.getTime());
    }
}

@@ -826,11 +826,99 @@
 );%0A    %7D
+%0A%0A    public Date toDate() %7B%0A        return new DateTime(this.getTime()).toDate();%0A    %7D
 %0A%7D%0A

Revert "Removed unused method. PL-1321."