Skip to content
Merged
Show file tree
Hide file tree
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 @@ -199,7 +199,7 @@ public void javaCheckTestSources() throws Exception {
softly.assertThat(newDiffs).containsExactlyInAnyOrderElementsOf(knownDiffs.values());
softly.assertThat(newTotal).isEqualTo(knownTotal);
softly.assertThat(rulesCausingFPs).hasSize(10);
softly.assertThat(rulesNotReporting).hasSize(18);
softly.assertThat(rulesNotReporting).hasSize(19);

/**
* 4. Check total number of differences (FPs + FNs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2881,7 +2881,7 @@
},
{
"ruleKey": "8447",
"hasTruePositives": true,
"hasTruePositives": false,
"falseNegatives": 0,
"falsePositives": 0
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ruleKey": "S8447",
"hasTruePositives": true,
"hasTruePositives": false,
"falseNegatives": 0,
"falsePositives": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,22 +173,11 @@ abstract class Middle extends Base {

Middle() {
super();
this.label = "value"; // Noncompliant
this.label = "value"; // Compliant : cannot resolve describe() implementation, conservative approach is to not flag
}

abstract void describe();
}

abstract class Leaf extends Middle {
Leaf() {
super();
}

@Override
void describe() {
IO.println(label);
}
}
}

// Parameter with same name as field: bare name resolves to parameter, this.field resolves to field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ private static boolean isFieldUsedInMethod(
) {
BlockTree methodBlock;
if (method == null || (methodBlock = method.block()) == null) {
// Can't resolve body, conservatively assume field may be used.
return true;
// Can't resolve body, assume field is not used to avoid false positives
return false;
}
SymbolUsedVisitor symbolUsedVisitor = new SymbolUsedVisitor(symbol, childClass, visitedMethods);
methodBlock.body().forEach(statement -> statement.accept(symbolUsedVisitor));
Expand Down
Loading