/** * @param localInstant the instant from 1970-01-01T00:00:00 local time * @return the instant from 1970-01-01T00:00:00Z */ private long localToUTC(long localInstant) { if (localInstant == Long.MAX_VALUE) { return Long.MAX_VALUE; } else if (localInstant == Long.MIN_VALUE) { return Long.MIN_VALUE; } DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(localInstant); long utcInstant = localInstant - offset; if (localInstant > NEAR_ZERO && utcInstant < 0) { return Long.MAX_VALUE; } else if (localInstant < -NEAR_ZERO && utcInstant > 0) { return Long.MIN_VALUE; } int offsetBasedOnUtc = zone.getOffset(utcInstant); if (offset != offsetBasedOnUtc) { throw new IllegalInstantException(localInstant, zone.getID()); } return utcInstant; }
/** * @param localInstant the instant from 1970-01-01T00:00:00 local time * @return the instant from 1970-01-01T00:00:00Z */ private long localToUTC(long localInstant) { if (localInstant == Long.MAX_VALUE) { return Long.MAX_VALUE; } else if (localInstant == Long.MIN_VALUE) { return Long.MIN_VALUE; } DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(localInstant); long utcInstant = localInstant - offset; if (localInstant > NEAR_ZERO && utcInstant < 0) { return Long.MAX_VALUE; } else if (localInstant < -NEAR_ZERO && utcInstant > 0) { return Long.MIN_VALUE; } int offsetBasedOnUtc = zone.getOffset(utcInstant); if (offset != offsetBasedOnUtc) { throw new IllegalInstantException(localInstant, zone.getID()); } return utcInstant; }
public long set(long instant, int value) { long localInstant = iZone.convertUTCToLocal(instant); localInstant = iField.set(localInstant, value); long result = iZone.convertLocalToUTC(localInstant, false, instant); if (get(result) != value) { IllegalInstantException cause = new IllegalInstantException(localInstant, iZone.getID()); IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage()); ex.initCause(cause); throw ex; } return result; }
public long set(long instant, int value) { long localInstant = iZone.convertUTCToLocal(instant); localInstant = iField.set(localInstant, value); long result = iZone.convertLocalToUTC(localInstant, false, instant); if (get(result) != value) { IllegalInstantException cause = new IllegalInstantException(localInstant, iZone.getID()); IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage()); ex.initCause(cause); throw ex; } return result; }
throw new IllegalInstantException(instantLocal, getID()); } else {
throw new IllegalInstantException(instantLocal, getID()); } else {
message = "Cannot parse \"" + text + "\": " + message; throw new IllegalInstantException(message);
message = "Cannot parse \"" + text + "\": " + message; throw new IllegalInstantException(message);
/** * @param localInstant the instant from 1970-01-01T00:00:00 local time * @return the instant from 1970-01-01T00:00:00Z */ private long localToUTC(long localInstant) { DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(localInstant); localInstant -= offset; if (offset != zone.getOffset(localInstant)) { throw new IllegalInstantException(localInstant, zone.getID()); } return localInstant; }
/** * @param localInstant the instant from 1970-01-01T00:00:00 local time * @return the instant from 1970-01-01T00:00:00Z */ private long localToUTC(long localInstant) { DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(localInstant); localInstant -= offset; if (offset != zone.getOffset(localInstant)) { throw new IllegalInstantException(localInstant, zone.getID()); } return localInstant; }
/** * @param localInstant the instant from 1970-01-01T00:00:00 local time * @return the instant from 1970-01-01T00:00:00Z */ private long localToUTC(long localInstant) { DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(localInstant); long utcInstant = localInstant - offset; int offsetBasedOnUtc = zone.getOffset(utcInstant); if (offset != offsetBasedOnUtc) { throw new IllegalInstantException(localInstant, zone.getID()); } return utcInstant; }
/** * @param localInstant the instant from 1970-01-01T00:00:00 local time * @return the instant from 1970-01-01T00:00:00Z */ private long localToUTC(long localInstant) { DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(localInstant); localInstant -= offset; if (offset != zone.getOffset(localInstant)) { throw new IllegalInstantException(localInstant, zone.getID()); } return localInstant; }
/** * @param localInstant the instant from 1970-01-01T00:00:00 local time * @return the instant from 1970-01-01T00:00:00Z */ private long localToUTC(long localInstant) { DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(localInstant); localInstant -= offset; if (offset != zone.getOffset(localInstant)) { throw new IllegalInstantException(localInstant, zone.getID()); } return localInstant; }
/** * @param localInstant the instant from 1970-01-01T00:00:00 local time * @return the instant from 1970-01-01T00:00:00Z */ private long localToUTC(long localInstant) { if (localInstant == Long.MAX_VALUE) { return Long.MAX_VALUE; } else if (localInstant == Long.MIN_VALUE) { return Long.MIN_VALUE; } DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(localInstant); long utcInstant = localInstant - offset; if (localInstant > NEAR_ZERO && utcInstant < 0) { return Long.MAX_VALUE; } else if (localInstant < -NEAR_ZERO && utcInstant > 0) { return Long.MIN_VALUE; } int offsetBasedOnUtc = zone.getOffset(utcInstant); if (offset != offsetBasedOnUtc) { throw new IllegalInstantException(localInstant, zone.getID()); } return utcInstant; }
public long set(long instant, int value) { long localInstant = iZone.convertUTCToLocal(instant); localInstant = iField.set(localInstant, value); long result = iZone.convertLocalToUTC(localInstant, false, instant); if (get(result) != value) { IllegalInstantException cause = new IllegalInstantException(localInstant, iZone.getID()); IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage()); ex.initCause(cause); throw ex; } return result; }
public long set(long instant, int value) { long localInstant = iZone.convertUTCToLocal(instant); localInstant = iField.set(localInstant, value); long result = iZone.convertLocalToUTC(localInstant, false, instant); if (get(result) != value) { IllegalInstantException cause = new IllegalInstantException(localInstant, iZone.getID()); IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage()); ex.initCause(cause); throw ex; } return result; }
public long set(long instant, int value) { long localInstant = iZone.convertUTCToLocal(instant); localInstant = iField.set(localInstant, value); long result = iZone.convertLocalToUTC(localInstant, false, instant); if (get(result) != value) { IllegalInstantException cause = new IllegalInstantException(localInstant, iZone.getID()); IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage()); ex.initCause(cause); throw ex; } return result; }
public long set(long instant, int value) { long localInstant = iZone.convertUTCToLocal(instant); localInstant = iField.set(localInstant, value); long result = iZone.convertLocalToUTC(localInstant, false, instant); if (get(result) != value) { IllegalInstantException cause = new IllegalInstantException(localInstant, iZone.getID()); IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage()); ex.initCause(cause); throw ex; } return result; }
public long set(long instant, int value) { long localInstant = iZone.convertUTCToLocal(instant); localInstant = iField.set(localInstant, value); long result = iZone.convertLocalToUTC(localInstant, false, instant); if (get(result) != value) { IllegalInstantException cause = new IllegalInstantException(localInstant, iZone.getID()); IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage()); ex.initCause(cause); throw ex; } return result; }
public long set(long instant, int value) { long localInstant = iZone.convertUTCToLocal(instant); localInstant = iField.set(localInstant, value); long result = iZone.convertLocalToUTC(localInstant, false, instant); if (get(result) != value) { IllegalInstantException cause = new IllegalInstantException(localInstant, iZone.getID()); IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage()); ex.initCause(cause); throw ex; } return result; }