Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.sonar.python.PythonSubscriptionCheck;
import org.sonar.python.api.tree.PyClassDefTree;
import org.sonar.python.api.tree.Tree;
import org.sonar.python.semantic.TreeSymbol;
import org.sonar.python.semantic.Symbol;

@Rule(key = "S1700")
public class FieldDuplicatesClassNameCheck extends PythonSubscriptionCheck {
Expand All @@ -40,7 +40,7 @@ public void initialize(Context context) {
return;
}
String className = classDef.name().name();
Set<TreeSymbol> allFields = new HashSet<>(classDef.classFields());
Set<Symbol> allFields = new HashSet<>(classDef.classFields());
allFields.addAll(classDef.instanceFields());
allFields.stream()
.filter(symbol -> className.equalsIgnoreCase(symbol.name()))
Expand Down