Skip to content

Conversation

@vodorok
Copy link
Collaborator

@vodorok vodorok commented Sep 4, 2019

The old algorithm failed to add bugpaths in the following case:

Checker display set to hierarchical.
unix
- unix.MallocSizeof
- unix.Malloc <- ArrayIndexOutOfBounds exception when clicked.

unix.MallocSizeof starts with unix.Malloc and was tried to be added
as a child of unix.Malloc. This resulted the aforementioned exception.

The modified algorithm adds the bugpaths correctly and should work with deeper
checker trees also.

The old algorithm failed to add bugpaths in the following case:

Checker display set to hierarchical.
unix
    - unix.MallocSizeof
    - unix.Malloc       <- ArrayIndexOutOfBounds exception when clicked.

unix.MallocSizeof starts with unix.Malloc and was tried to be added
as a child of unix.Malloc. This resulted the aforementioned exception.

The modified algorithm adds the bugpaths correctly and should work with deeper
checker trees also.
String[] splitted = s.split("\\.");
if (splitted.length > parentLevel - 1 && splitted[parentLevel - 1].equals(parent)
&& !s.equals(parent)) {
tops.add(parent + "." + s.split("\\.")[parentLevel]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of s.plit("\\.") in this line, splitted array could be used

if (s.startsWith(parent) && !s.equals(parent)) {
tops.add(parent + "." + s.split("\\.")[parentDots]);
String[] splitted = s.split("\\.");
if (splitted.length > parentLevel - 1 && splitted[parentLevel - 1].equals(parent)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't the following condition be equivalent for our entries in the checkerlist?
if (splitted.length > parentLevel && splitted[parentLevel - 1].equals(parent)) { ... }
Maybe not, just asking.

@gamesh411 gamesh411 merged commit 0d7e505 into Ericsson:master Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants