Class UselessOperationOnImmutableRule

  • All Implemented Interfaces:
    JavaParserVisitor, ImmutableLanguage, PropertySource, 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.