代码规范性检查

原文链接:http://www.cnblogs.com/lingear/p/5996046.html
  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.
  3. Throwing 'Throwable' is not allowed 1
  4. Method length is xx lines (max allowed is 50). 64
  5. Avoid unused method parameters such as 'xxxx' 8
  6. Class Xxxxx should be declared as final 1
    •   Checks that class which has only private constructors is declared as final.
  7. xxxx must be non-null but is marked as nullable 11

    •   This parameter is always used in a way that requires it to be nonnull, but the parameter is explicitly annotated as being Nullable. Either the use of the parameter or the annotation is wrong.
  8.  

    Overridable method 'setIsRestart' called during object construction 3

 

转载于:https://www.cnblogs.com/lingear/p/5996046.html

上一篇:Oracle JDBC prefetch: how to avoid running out of RAM


下一篇:Git--分布式版本控制系统工具使用方法