· LocalVariableCouldBeFinal: A local variable assigned only once can be declared final.
翻译 本地变量可以是Final的:本地变量只被赋值一次可以声明为final的
· MethodArgumentCouldBeFinal: A method argument that is never assigned can be declared final.
翻译 方法参数可以是Final的:传入方法的参数从不被赋值可以声明为final的
· AvoidInstantiatingObjectsInLoops: Detects when a new object is created inside a loop
翻译 避免在循环中实例化对象:本规则检查在循环的内部用new创建对象
· UseArrayListInsteadOfVector: ArrayList is a much better Collection implementation than Vector.
翻译 使用ArrayList代替Vector:ArrayList是比Vector更好的集合类实现
· SimplifyStartsWith: Since it passes in a literal of length 1, this call to String.startsWith can be rewritten using String.charAt(0) to save some time.
翻译 简化StartWith:字符串中截取长度为1的字串时,可以用高率一点的String.charAt()代替String.startsWith()
· UseStringBufferForStringAppends: Finds usages of += for appending strings.
翻译 使用StringBuffer来进行字串append操作:查找使用+=来连接字串的不良方式
· UseArraysAsList: The java.util.Arrays class has a "asList" method that should be used when you want to create a new List from an array of objects. It is faster than executing a loop to copy all the elements of the array one by one
翻译 使用Arrays类的asList方法:java.util.Arrays类有一个asList方法,当你试图将一个对象数组转换为一个List时应该使用这个方法,这比循环从数据拷贝元素快得多。
· AvoidArrayLoops: Instead of copying data between two arrays, use System.arraycopy method
翻译 避免数组循环:拷贝数组用System.arraycopy代替循环拷贝数组元素
· UnnecessaryWrapperObjectCreation: Parsing method should be called directy instead.
翻译 不必要的包装对象创建:解析方法应该被直接调用
· AddEmptyString: Finds empty string literals which are being added. This is an inefficient way to convert any type to a String.
翻译 加空字符串:发现+“”操作。这是将其他类型转换为字符串的低效的做法