BaseRandom.java 文件源码

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

项目:BetterRandom 作者:
/**
 * Used to deserialize a subclass instance that wasn't a subclass instance when it was serialized.
 * Since that means we can't deserialize our seed, we generate a new one with the {@link
 * DefaultSeedGenerator}.
 * @throws InvalidObjectException if the {@link DefaultSeedGenerator} fails.
 */
@SuppressWarnings("OverriddenMethodCallDuringObjectConstruction") private void readObjectNoData()
    throws InvalidObjectException {
  LOG.warn("BaseRandom.readObjectNoData() invoked; using DefaultSeedGenerator");
  try {
    fallbackSetSeed();
  } catch (final RuntimeException e) {
    throw (InvalidObjectException) (new InvalidObjectException(
        "Failed to deserialize or generate a seed").initCause(e.getCause()));
  }
  initTransientFields();
  setSeedInternal(seed);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号