Skip to content

Commit 10bd8a5

Browse files
committed
Second Round vs MO4 compilation errors
1 parent fd8213e commit 10bd8a5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/uniandes/tsdl/mutapk/operators/activity/InvalidKeyIntentPutExtra.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,25 @@ public boolean performMutation(MutationLocation location, BufferedWriter writer,
2525
String extraKeyVar = hijos.get(1).getChild(1).toString();
2626
CommonTree method = (CommonTree) parent.getParent();
2727
int putExtraPos = parent.getChildIndex();
28-
int extraKeyValPos = 0;
28+
int extraKeyValPos = -1;
2929
boolean finished = false;
3030
for (int i = putExtraPos; i >-1 && !finished; i--) {
3131
CommonTree temp = (CommonTree) method.getChild(i);
32+
System.out.println(mutantIndex+" - "+temp.getType()+" - "+temp.toStringTree());
33+
if(temp.getType()==smaliParser.I_STATEMENT_FORMAT22x && temp.getChild(1).toString().equals(extraKeyVar)) {
34+
extraKeyVar=temp.getChild(2).toString();
35+
}
3236
if(temp.getType()==smaliParser.I_STATEMENT_FORMAT21c_STRING && temp.getChild(1).toString().equals(extraKeyVar)) {
3337
extraKeyValPos = temp.getLine();
3438
finished = true;
3539
}
3640
}
3741

42+
if (extraKeyValPos==-1) {
43+
extraKeyValPos=mLocation.getLine()-1;
44+
}
45+
46+
3847
String newKey = StringGenerator.generateRandomString();
3948

4049
List<String> newLines = new ArrayList<String>();

0 commit comments

Comments
 (0)