Package org.sonar.java.checks
Class IdenticalCasesInSwitchCheck
java.lang.Object
org.sonar.java.ast.visitors.SubscriptionVisitor
org.sonar.plugins.java.api.IssuableSubscriptionVisitor
org.sonar.java.checks.IdenticalCasesInSwitchCheck
- All Implemented Interfaces:
JavaCheck,JavaFileScanner
- Direct Known Subclasses:
AllBranchesAreIdenticalCheck
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.sonar.java.ast.visitors.SubscriptionVisitor
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanallBranchesSame(Map<? extends Tree, ? extends Set<? extends Tree>> identicalBranches, int size) protected static IdenticalCasesInSwitchCheck.IfElseChainprotected Map<CaseGroupTree, Set<CaseGroupTree>> protected static booleanhasDefaultClause(SwitchTree switchStatement) protected static booleanhasElseClause(IfStatementTree ifStatement) voidMethods inherited from class org.sonar.plugins.java.api.IssuableSubscriptionVisitor
addIssue, addIssueOnFile, leaveFile, reportIssue, reportIssue, reportIssue, scanFile, scanTree, setContextMethods inherited from class org.sonar.java.ast.visitors.SubscriptionVisitor
leaveNode, visitToken, visitTriviaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sonar.plugins.java.api.JavaFileScanner
scanWithoutParsing
-
Constructor Details
-
IdenticalCasesInSwitchCheck
public IdenticalCasesInSwitchCheck()
-
-
Method Details
-
nodesToVisit
- Specified by:
nodesToVisitin classSubscriptionVisitor
-
visitNode
- Overrides:
visitNodein classSubscriptionVisitor
-
allBranchesSame
-
checkSwitchStatement
-
checkIfStatement
-
hasDefaultClause
-
hasElseClause
-