Class UseCollectionIsEmptyRule

All Implemented Interfaces:
AstVisitor, JavaVisitor, Rule, PropertySource

public class UseCollectionIsEmptyRule extends AbstractJavaRulechainRule
Detect structures like "foo.size() == 0" and suggest replacing them with foo.isEmpty(). Will also find != 0 (replaceable with !isEmpty()).
Author:
Jason Bennett
  • Constructor Details

    • UseCollectionIsEmptyRule

      public UseCollectionIsEmptyRule()
  • Method Details