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 String
getId()
boolean
isPreventingExceptions()
This kind of rules may not fit everybody, as in some cases, exceptions are a feature (even if probably a bad thing).String
minimalJavaVersion()
String
pmdId()
String
pmdUrl()
protected boolean
processNotRecursively(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:
getId
in interfaceIClassTransformer
-
minimalJavaVersion
public String minimalJavaVersion()
- Specified by:
minimalJavaVersion
in interfaceIClassTransformer
- Specified by:
minimalJavaVersion
in interfaceIRuleDescriber
- Returns:
- the minimal JDKF version for this rule to trigger
-
pmdUrl
public String pmdUrl()
- Specified by:
pmdUrl
in interfaceIRuleExternalUrls
-
pmdId
public String pmdId()
-
isPreventingExceptions
public boolean isPreventingExceptions()
Description copied from interface:IRuleDescriber
This kind of rules may not fit everybody, as in some cases, exceptions are a feature (even if probably a bad thing).- Specified by:
isPreventingExceptions
in interfaceIRuleDescriber
- Returns:
- true if the rule helps preventing exceptions.
- See Also:
UseIsEmptyOnCollections
-
processNotRecursively
protected boolean processNotRecursively(com.github.javaparser.ast.Node node)
- Overrides:
processNotRecursively
in classAJavaParserRule
-
-