org.joda.time.IllegalFieldValueException#initCause ( )源码实例Demo

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

源代码1 项目: astor   文件: ZonedChronology.java
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;
}
 
源代码2 项目: astor   文件: ZonedChronology.java
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;
}