Class Summary Class Description AbstractOptimizationRuleBase class with utility methods for optimization rules AppendCharacterWithCharRuleThis rule finds the following: AvoidInstantiatingObjectsInLoopsRule BigIntegerInstantiationRule BooleanInstantiationRuleAvoid instantiating Boolean objects; you can reference Boolean.TRUE, Boolean.FALSE, or call Boolean.valueOf() instead. ConsecutiveAppendsShouldReuseRule ConsecutiveLiteralAppendsRuleThis rule finds concurrent calls to StringBuffer/Builder.append where String literals are used It would be much better to make these calls using one call to
InefficientEmptyStringCheckRuleThis rule finds code which inefficiently determines empty strings. InefficientStringBufferingRuleHow this rule works: find additive expressions: + check that the addition is between anything other than two literals if true and also the parent is StringBuffer constructor or append, report a violation. InsufficientStringBufferDeclarationRuleThis rule finds StringBuffers which may have been pre-sized incorrectly. RedundantFieldInitializerRuleDetects redundant field initializers, i.e. StringInstantiationRule StringToStringRule UnnecessaryWrapperObjectCreationRule UseIndexOfCharRule UselessStringValueOfRule UseStringBufferForStringAppendsRule UseStringBufferLengthRuleThis rule finds places where StringBuffer.toString() is called just to see if the string is 0 length by either using .equals("") or toString().length().