Commit 91a705a4 authored by Joachim Müssig's avatar Joachim Müssig

Add size and null comparison for equals method in ViolationChop

parent 6e23d39e
......@@ -650,6 +650,8 @@ public class DisproHandler implements ViolationsWrapperListener, SettingsObserve
// Collection<? extends IViolation<SecurityNode>> uncheckedViolations =
// violationsWrapper.getUncheckedViolations();
//TODO: cause exception if .dispro is loaded
Collection<? extends IViolation<SecurityNode>> uncheckedViolations =
violationsWrapper.getAllViolationsToCheck();
......@@ -835,6 +837,9 @@ public class DisproHandler implements ViolationsWrapperListener, SettingsObserve
for(int i : itemIndexToViolation.keySet()) {
if (i != 0) {
if (itemIndexToViolation.get(i).equals(v)) {
if(listViewUncheckedChops.getItems().get(i).startsWith("CLOSED: ")) {
continue;
}
if (!violationsWrapper.getAllViolationChops().contains(v)) {
String itemText = listViewUncheckedChops.getItems().get(i);
if (!itemText.startsWith("CLOSED: ")) {
......
......@@ -143,13 +143,24 @@ public class ViolationChop {
return false;
}
if (!Objects.equals(this.violationSink, other.violationSink)) {
return false;
}
for(int i = 0; i < summaryEdges.size(); ++i) {
if(!summaryEdges.get(i).equals(other.summaryEdges.get(i))) {
return false;
}
}
return false;
}
if (other.getSummaryEdges() == null || summaryEdges == null) {
if ((other.getSummaryEdges() != null && summaryEdges == null)
|| (other.getSummaryEdges() == null || summaryEdges != null)) {
return false;
}
} else {
if (other.getSummaryEdges().size() != summaryEdges.size()) {
return false;
}
for (int i = 0; i < summaryEdges.size(); ++i) {
if (!summaryEdges.get(i).equals(other.summaryEdges.get(i))) {
return false;
}
}
}
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment