Skip to content

Commit 17a73f4

Browse files
committed
Improvement of approach used to solve MO27 compilation errors
1 parent 5cf7d59 commit 17a73f4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/uniandes/tsdl/mutapk/operators/gui/android/FindViewByIdReturnsNull.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ public boolean performMutation(MutationLocation location, BufferedWriter writer,
2323
CommonTree parent = (CommonTree) mLocation.getTree().getParent();
2424
CommonTree cast = ASTHelper.getFirstBrotherNamedOfType(smaliParser.I_STATEMENT_FORMAT21c_TYPE, "check-cast", parent);
2525
String varName = "";
26+
int position = -1;
2627
if(cast!=null) {
27-
varName = cast.getChild(1).toString();
28+
varName = cast.getChild(1).toString();
29+
position = cast.getLine();
2830
} else {
2931
CommonTree moveResultObject = ASTHelper.getFirstBrotherNamedOfType(smaliParser.I_STATEMENT_FORMAT11x, "move-result-object", parent);
3032
varName = moveResultObject.getChild(1).toString();
33+
position = moveResultObject.getLine();
3134
}
3235

3336

@@ -44,7 +47,7 @@ public boolean performMutation(MutationLocation location, BufferedWriter writer,
4447
newLines.add(" const/4 "+varName+", 0x0");
4548
newLines.add("");
4649

47-
for(int i=cast.getLine(); i < lines.size() ; i++){
50+
for(int i=position; i < lines.size() ; i++){
4851
newLines.add(lines.get(i));
4952
}
5053

0 commit comments

Comments
 (0)