Groovy Documentation

groovy.org.codenarc.rule.groovyism
[Groovy] Class ExplicitCallToCompareToMethodRule

java.lang.Object
  org.codenarc.rule.AbstractAstVisitorRule
      groovy.org.codenarc.rule.groovyism.ExplicitCallToCompareToMethodRule

class ExplicitCallToCompareToMethodRule
extends AbstractAstVisitorRule

This rule detects when the compareTo(Object) method is called directly in code instead of using the <=>, >, >=, <, and <= operators. A groovier way to express this: a.compareTo(b) is this: a <=> b, or using the other operators.

Authors:
Hamlet D'Arcy


Property Summary
Class astVisitorClass

boolean ignoreThisReference

String name

int priority

 

Property Detail

astVisitorClass

Class astVisitorClass


ignoreThisReference

boolean ignoreThisReference


name

String name


priority

int priority


 

Groovy Documentation