Package net.sourceforge.pmd.lang.java.rule.bestpractices
package net.sourceforge.pmd.lang.java.rule.bestpractices
-
ClassesClassDescription1.If a method or constructor receives an array as an argument, the array should be cloned instead of directly stored.Rule that verifies, that the return values of next(), first(), last(), etc.Check that log.debug, log.trace, log.error, etc... statements are guarded by some test expression on log.isDebugEnabled() or log.isTraceEnabled().Deprecated.Deprecated.The rule was renamed
UnitTestContainsTooManyAssertsRuleDeprecated.The rule was renamedUnitTestShouldIncludeAssertRuleThis rule finds code like this:Implementation note: this rule currently ignores return types of y.x.z, currently it handles only local type fields.Flags missing @Override annotations.Detects constructors and methods that use the JVM's default character set instead of explicitly specifying a charset.This rule detects private methods, that are not used and can therefore be deleted.Detect structures like "foo.size() == 0" and suggest replacing them with foo.isEmpty().Detect cases where EnumSet and EnumMap can be used.
UnitTestAssertionsShouldIncludeMessageRule