Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mihai.herda
keyjoana
Commits
91a705a4
Commit
91a705a4
authored
Nov 18, 2019
by
Joachim Müssig
Browse files
Add size and null comparison for equals method in ViolationChop
parent
6e23d39e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gui/DisproHandler.java
View file @
91a705a4
...
...
@@ -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: "
))
{
...
...
src/joanakey/violations/ViolationChop.java
View file @
91a705a4
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment