Class VariableEqualsConstant
- java.lang.Object
-
- eu.solven.cleanthat.language.java.rules.AJavaParserRule
-
- eu.solven.cleanthat.language.java.rules.mutators.VariableEqualsConstant
-
- All Implemented Interfaces:
IClassTransformer,IRuleDescriber,IRuleExternalUrls
public class VariableEqualsConstant extends AJavaParserRule implements IRuleDescriber
Switch o.equals("someString") to "someString".equals(o)- Author:
- Benoit Lacelle
-
-
Constructor Summary
Constructors Constructor Description VariableEqualsConstant()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()booleanisPreventingExceptions()This kind of rules may not fit everybody, as in some cases, exceptions are a feature (even if probably a bad thing).StringminimalJavaVersion()StringpmdId()StringpmdUrl()protected booleanprocessNotRecursively(com.github.javaparser.ast.Node node)-
Methods inherited from class eu.solven.cleanthat.language.java.rules.AJavaParserRule
getThreadJavaParser, onMethodName, optResolvedType, replaceNode, tryReplace, walkNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface eu.solven.cleanthat.language.java.rules.meta.IClassTransformer
getCheckstyleId, getIds, getPmdId, isProductionReady
-
Methods inherited from interface eu.solven.cleanthat.language.java.rules.meta.IRuleDescriber
isDeprecationNotice, isPerformanceImprovment
-
Methods inherited from interface eu.solven.cleanthat.language.java.rules.meta.IRuleExternalUrls
checkstyleUrl, jsparrowUrl, sonarUrl
-
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceIClassTransformer
-
minimalJavaVersion
public String minimalJavaVersion()
- Specified by:
minimalJavaVersionin interfaceIClassTransformer- Specified by:
minimalJavaVersionin interfaceIRuleDescriber- Returns:
- the minimal JDKF version for this rule to trigger
-
pmdUrl
public String pmdUrl()
- Specified by:
pmdUrlin interfaceIRuleExternalUrls
-
pmdId
public String pmdId()
-
isPreventingExceptions
public boolean isPreventingExceptions()
Description copied from interface:IRuleDescriberThis kind of rules may not fit everybody, as in some cases, exceptions are a feature (even if probably a bad thing).- Specified by:
isPreventingExceptionsin interfaceIRuleDescriber- Returns:
- true if the rule helps preventing exceptions.
- See Also:
UseIsEmptyOnCollections
-
processNotRecursively
protected boolean processNotRecursively(com.github.javaparser.ast.Node node)
- Overrides:
processNotRecursivelyin classAJavaParserRule
-
-