Class UselessOperationOnImmutableRule

  • All Implemented Interfaces:
    JavaParserVisitor, net.sourceforge.pmd.lang.rule.ImmutableLanguage, net.sourceforge.pmd.properties.PropertySource, net.sourceforge.pmd.Rule

    public class UselessOperationOnImmutableRule
    extends AbstractJavaRule
    An operation on an Immutable object (String, BigDecimal or BigInteger) won't change the object itself. The result of the operation is a new object. Therefore, ignoring the operation result is an error.