/java/

Clean code. What do you think ?

2013-10-08 23:32:57

1)

org.joda.time.DateMidnight.java

    public DateMidnight withZoneRetainFields(DateTimeZone newZone) {
        newZone = DateTimeUtils.getZone(newZone);
        DateTimeZone originalZone = DateTimeUtils.getZone(getZone());
        if (newZone == originalZone) {
            return this;
        }

        long millis = originalZone.getMillisKeepLocal(newZone, getMillis());
        return new DateMidnight(millis, getChronology().withZone(newZone));
    }

DateTimeZone is abstract, it is allowed to signment of parameter 'newZone' ?

2)

    public DateTime toDateTimeISO() {
        if (getChronology() == ISOChronology.getInstance()) {
            return this;
        }
        return super.toDateTimeISO();
    }

* == for abstract ? *

3)

    public Chronology getChronology() {
        return iChronology;
    }

Hungarian notation ?