下面列出了org.joda.time.IllegalFieldValueException#initCause ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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;
}