Class LiteralsFirstInComparisons
java.lang.Object
eu.solven.cleanthat.engine.java.refactorer.AJavaparserMutator
eu.solven.cleanthat.engine.java.refactorer.mutators.LiteralsFirstInComparisons
- All Implemented Interfaces:
IJavaparserMutator
,IMutator
,IMutatorDescriber
,IMutatorExternalReferences
,IWalkingMutator<com.github.javaparser.ast.Node,
com.github.javaparser.ast.Node>
Switch o.equals("someString") to "someString".equals(o)
- Author:
- Benoit Lacelle
-
Field Summary
Fields inherited from interface eu.solven.cleanthat.engine.java.refactorer.meta.IMutator
ID_NOOP, IS_PRODUCTION_READY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPmdId()
boolean
isDraft()
boolean
LiteralsFirstInComparisons
may turn NullPointerException into false.pmdUrl()
protected boolean
processNotRecursively
(com.github.javaparser.ast.Node node) Methods inherited from class eu.solven.cleanthat.engine.java.refactorer.AJavaparserMutator
getSimpleName, getWarnCount, isImportable, isImported, messageForIssueReporting, onMethodName, optResolved, optResolvedType, optResolvedType, replaceBy, replaceNode, scopeHasRequiredType, scopeHasRequiredType, tryReplace, walkAst
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.engine.java.refactorer.meta.IMutator
getId, getIds, isJreOnly
Methods inherited from interface eu.solven.cleanthat.engine.java.refactorer.meta.IMutatorDescriber
isDeprecationNotice, isPerformanceImprovment
Methods inherited from interface eu.solven.cleanthat.engine.java.refactorer.meta.IMutatorExternalReferences
checkstyleUrl, getCheckstyleId, getCleanthatId, getPmdIds, getSeeUrls, getSonarId, jsparrowUrl, sonarUrl
Methods inherited from interface eu.solven.cleanthat.engine.java.refactorer.meta.IWalkingMutator
walkAstHasChanged
-
Constructor Details
-
LiteralsFirstInComparisons
public LiteralsFirstInComparisons()
-
-
Method Details
-
minimalJavaVersion
- Specified by:
minimalJavaVersion
in interfaceIMutator
- Specified by:
minimalJavaVersion
in interfaceIMutatorDescriber
- Returns:
- the minimal JDKF version for this rule to trigger
-
isDraft
public boolean isDraft() -
pmdUrl
- Specified by:
pmdUrl
in interfaceIMutatorExternalReferences
-
getPmdId
- Specified by:
getPmdId
in interfaceIMutatorExternalReferences
-
isPreventingExceptions
public boolean isPreventingExceptions()LiteralsFirstInComparisons
may turn NullPointerException into false.- Specified by:
isPreventingExceptions
in interfaceIMutatorDescriber
- Returns:
- true if the rule helps preventing exceptions.
- See Also:
-
processNotRecursively
protected boolean processNotRecursively(com.github.javaparser.ast.Node node) - Overrides:
processNotRecursively
in classAJavaparserMutator
-