码迷,mamicode.com
首页 > 其他好文 > 详细

代码规范性检查

时间:2016-10-25 13:40:34      阅读:311      评论:0      收藏:0      [点我收藏+]

标签:int   diff   runtime   size   from   cep   help   and   use   

  1. [主要] A method/constructor shouldnt explicitly throw java.lang.Exception 方法或构造方法不应该显式的抛Exception
    •   It is unclear which exceptions that can be thrown from the methods. It might be difficult to document and understand the vague interfaces. Use either a class derived from RuntimeException or a checked exception.
  2. [主要] Avoid really long methods. 
    •   Violations of this rule usually indicate that the method is doing too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code.

代码规范性检查

标签:int   diff   runtime   size   from   cep   help   and   use   

原文地址:http://www.cnblogs.com/lingear/p/5996046.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!