Skip to content

Commit 5cf7d59

Browse files
committed
First approach to solve MO27 compilation errors
1 parent 57af2d5 commit 5cf7d59

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ public boolean performMutation(MutationLocation location, BufferedWriter writer,
2222
ASTMutationLocation mLocation = (ASTMutationLocation) location;
2323
CommonTree parent = (CommonTree) mLocation.getTree().getParent();
2424
CommonTree cast = ASTHelper.getFirstBrotherNamedOfType(smaliParser.I_STATEMENT_FORMAT21c_TYPE, "check-cast", parent);
25-
String varName = cast.getChild(1).toString();
25+
String varName = "";
26+
if(cast!=null) {
27+
varName = cast.getChild(1).toString();
28+
} else {
29+
CommonTree moveResultObject = ASTHelper.getFirstBrotherNamedOfType(smaliParser.I_STATEMENT_FORMAT11x, "move-result-object", parent);
30+
varName = moveResultObject.getChild(1).toString();
31+
}
2632

2733

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

test/operators.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
#4 = InvalidKeyIntentPutExtra
66
#17 = InvalidURI
77
#28 = InvalidColor
8-
20 = NullBackEndServiceReturn
8+
#20 = NullBackEndServiceReturn
9+
27 = FindViewByIdReturnsNull

0 commit comments

Comments
 (0)