Skip to content

Commit

Permalink
Removing mutations with no line declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarlvp committed May 21, 2019
1 parent 5332629 commit d96409b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public void registerMutations(Method method, int start, int end) {
}
}


private MutationDetails getMutationDetails(Method method, MutationOperator operator, int start, int end) {

Location location = new Location(className, MethodName.fromString(method.getName()), method.getDescriptor());
Expand All @@ -79,6 +80,8 @@ private MutationDetails getMutationDetails(Method method, MutationOperator opera
return new MutationDetails(id, source, operator.getDescription(), start, 1);
}



private Collection<Integer> getIndexes(int start, int end) {
return IntStream.rangeClosed(1, end - start + 1).boxed().collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ public MethodInspector(ClassName className, Method method, MutationPointFinder f

@Override
public void visitEnd() {
finder.registerMutations(method, lineCounter.getFirstLine(), lineCounter.getLastLine());
if (!lineCounter.empty()) {
// Some methods would not include line declaration information
// we skip those for the moment as they can not be mapped to the original source code.
finder.registerMutations(method, lineCounter.getFirstLine(), lineCounter.getLastLine());
}
}

@Override
Expand Down

0 comments on commit d96409b

Please sign in to comment.