Class UnnecessaryFullyQualifiedName
java.lang.Object
eu.solven.cleanthat.engine.java.refactorer.AJavaparserAstMutator
eu.solven.cleanthat.engine.java.refactorer.AJavaparserNodeMutator
eu.solven.cleanthat.engine.java.refactorer.mutators.UnnecessaryFullyQualifiedName
- All Implemented Interfaces:
ICountMutatorIssues
,IJavaparserAstMutator
,IJavaparserNodeMutator
,IMutator
,IMutatorExternalReferences
,IWalkingMutator<com.github.javaparser.ast.Node,
com.github.javaparser.ast.Node>
This will remove unnecessary fully qualified type reference, typically because given type if imported.
For instance, it will turns 'java.lang.String' into 'String' as `java.lang` is already imported.
It assumes there is no class in current package with same name as some class in a wildcard imported package
(especially `java.lang`). (e.g. https://www.baeldung.com/java-classes-same-name)
- Author:
- Benoit Lacelle
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
-
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()
getTags()
pmdUrl()
protected boolean
processNotRecursively
(NodeAndSymbolSolver<?> nodeAndContext) Methods inherited from class eu.solven.cleanthat.engine.java.refactorer.AJavaparserNodeMutator
cancelDueToComment, getNbRemoveIssues, getNbReplaceIssues, isMethodReturnUsed, logJavaParserIssue, onMethodName, optResolved, replaceNode, tryRemove, tryReplace, tryReplace
Methods inherited from class eu.solven.cleanthat.engine.java.refactorer.AJavaparserAstMutator
getNbIdempotencyIssues, messageForIssueReporting, simulateOnClone, 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, isDraft, isJreOnly
Methods inherited from interface eu.solven.cleanthat.engine.java.refactorer.meta.IMutatorExternalReferences
checkstyleUrl, errorProneUrl, getCheckstyleId, getCleanthatId, getErrorProneId, getJSparrowId, getLegacyIds, getPmdIds, getSeeUrls, getSonarId, getSpotBugsId, jSparrowUrl, sonarUrl, spotBugsUrl
Methods inherited from interface eu.solven.cleanthat.engine.java.refactorer.meta.IWalkingMutator
walkAstHasChanged
-
Constructor Details
-
UnnecessaryFullyQualifiedName
public UnnecessaryFullyQualifiedName()
-
-
Method Details
-
minimalJavaVersion
-
getTags
-
getPmdId
-
pmdUrl
-
processNotRecursively
- Overrides:
processNotRecursively
in classAJavaparserNodeMutator
-