转 Intellij IDEA 自动生成 serialVersionUID
<!-- 收藏 -->
<div class="opr-btn-blog btn-favor-blog favor hover">
<a href="javascript:void(0);" class="btn btn-black-blog " data-blogid="289994" data-blogtype="3" data-userid="" data-thispage="https://my.oschina.net/tonycody/blog/289994">
<i class="icon-svg icon-star-blog"></i>
<span id="" class="operate_title">
收藏
</span>
</a>
</div>
</div>
<div class="layout-column">
<div class="user-info">
<div class="name">
<a href="https://my.oschina.net/tonycody/home" target="_blank">tonycody</a>
</div>
</div>
<div class="data-info text-gary">
<ul>
<li class="time">发表于 <span id="">2年前</span></li>
<li class="read">阅读 <span id="read">18399</span></li>
<li class="favor">收藏 <span id="">5</span></li>
<li class="vote">点赞 <span id="">2</span></li>
<li class="comment">
<a href="#comment-list" data-href="#comment-list" class="link-blue">
评论 <span id="comment">0</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- 摘要 -->
<!-- 正文 -->
<div class="blog-body" id="blogBody">
<val data-name="blog_content_type" data-value="richtext"></val>
<div class="BlogContent">
<p>使用 Eclipse 或 MyEclipse 的同学可能知道,如果 implements Serializable 接口时,会提示你生成 serialVersionUID。</p>
但 Intellij IDEA 默认没启用这个功能。
Setting->Inspections->Serialization issues->Serializable class without ’serialVersionUID’
选中以上后,在你的class中:光标定位在类名前,按 Alt+Enter 就会提示自动创建 serialVersionUID 了。
本文出自 “TONY - 小四 技术博客” 博客,请务必保留此出处http://tonycody.blog.51cto.com/8421818/1401422
<!-- 分享 -->
<li class="opr-btn-blog btn-share-blog hover">
<a href="javascript:void(0);" class="btn btn-black-blog">
<i class="icon-svg icon-share-o-blog"></i>
分享
</a>
<div class="operate-dropdown share-dropdown">
<span class="share-title">分享到:</span>
<div class="bdsharebuttonbox bdshare-button-style0-16" data-bd-bind="1482981475768">
<a href="#" class="bds_mshare" data-cmd="mshare" title="分享到一键分享">一键分享</a>
<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间">QQ空间</a>
<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信">微信</a>
<a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博">腾讯微博</a>
<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博">新浪微博</a>
<a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友">QQ好友</a>
<a href="#" class="bds_youdao" data-cmd="youdao" title="分享到有道云笔记">有道云笔记</a>
</div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":["mshare","qzone","tsina","weixin","tqq","sqq"],"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{"bdSize":16}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='/js/bdshare_api/share.js?t=1466497427000'];</script>
</div>
</li>
</ul>
<div data-type="tip" data-tip-type="fixed">
<div class="tooltips" id="error_tip"></div>
</div>
</div>
<div class="reward-list hide">
<div class="reward-list-title">
共有 <span id="reward-num"></span> 人打赏支持<span id="donate_money"></span>
</div>
<div class="donate-user-list" id="donate_user_list">
<p></p>
</div>
</div>
</div>