ValueRange.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:jdk8u-jdk 作者:
/**
 * Restore the state of an ValueRange from the stream.
 * Check that the values are valid.
 *
 * @param s the stream to read
 * @throws InvalidObjectException if
 *     the smallest minimum is greater than the smallest maximum,
 *  or the smallest maximum is greater than the largest maximum
 *  or the largest minimum is greater than the largest maximum
 * @throws ClassNotFoundException if a class cannot be resolved
 */
private void readObject(ObjectInputStream s)
     throws IOException, ClassNotFoundException, InvalidObjectException
{
    s.defaultReadObject();
    if (minSmallest > minLargest) {
        throw new InvalidObjectException("Smallest minimum value must be less than largest minimum value");
    }
    if (maxSmallest > maxLargest) {
        throw new InvalidObjectException("Smallest maximum value must be less than largest maximum value");
    }
    if (minLargest > maxLargest) {
        throw new InvalidObjectException("Minimum value must be less than maximum value");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号