Update.
This commit is contained in:
@@ -364,6 +364,10 @@ public abstract class Parser implements ParserInterface {
|
|||||||
singleEdit.endsWith("New") || singleEdit.endsWith("WildcardType") || singleEdit.endsWith("SimpleType") ||
|
singleEdit.endsWith("New") || singleEdit.endsWith("WildcardType") || singleEdit.endsWith("SimpleType") ||
|
||||||
singleEdit.endsWith("QualifiedType") || singleEdit.endsWith("PrimitiveType") || singleEdit.endsWith("NameQualifiedType")) {
|
singleEdit.endsWith("QualifiedType") || singleEdit.endsWith("PrimitiveType") || singleEdit.endsWith("NameQualifiedType")) {
|
||||||
singleEdit += " " + actionSet.getNode().getLabel();
|
singleEdit += " " + actionSet.getNode().getLabel();
|
||||||
|
} else if (singleEdit.endsWith("SuperConstructorInvocation")) {
|
||||||
|
singleEdit += " super";
|
||||||
|
} else if (singleEdit.endsWith("ConstructorInvocation")) {
|
||||||
|
singleEdit += " this";
|
||||||
} else if (singleEdit.endsWith("SimpleName")) {
|
} else if (singleEdit.endsWith("SimpleName")) {
|
||||||
actionStr = actionStr.substring(index + 2);
|
actionStr = actionStr.substring(index + 2);
|
||||||
if (actionStr.startsWith("MethodName")) {
|
if (actionStr.startsWith("MethodName")) {
|
||||||
|
|||||||
@@ -391,6 +391,8 @@ public class HunkActionFilter {
|
|||||||
int bugHunkEndLine = violation.getBugEndLineNum();
|
int bugHunkEndLine = violation.getBugEndLineNum();
|
||||||
int fixHunkStartLine = violation.getFixStartLineNum();
|
int fixHunkStartLine = violation.getFixStartLineNum();
|
||||||
int fixHunkEndLine = violation.getFixEndLineNum();
|
int fixHunkEndLine = violation.getFixEndLineNum();
|
||||||
|
int bugFixStartLineNum = violation.getBugFixStartLineNum();
|
||||||
|
int bugFixEndLineNum = violation.getBugFixEndLineNum();
|
||||||
|
|
||||||
for (HierarchicalActionSet actionSet : actionSets) {
|
for (HierarchicalActionSet actionSet : actionSets) {
|
||||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||||
@@ -412,7 +414,8 @@ public class HunkActionFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// INS with MOV actions that are not identified in previous IF predicate, and pure INS actions
|
// INS with MOV actions that are not identified in previous IF predicate, and pure INS actions
|
||||||
if (violation.getBugFixStartLineNum() >= actionFixEndLine && actionFixStartLine <= violation.getBugFixEndLineNum()) {
|
if (bugFixStartLineNum >= actionFixEndLine && actionFixStartLine <= bugFixEndLineNum && Math.abs(bugFixStartLineNum - actionFixStartLine) <= 3
|
||||||
|
&& Math.abs(bugFixEndLineNum - actionFixEndLine) <= 3) {
|
||||||
violation.getActionSets().add(actionSet);
|
violation.getActionSets().add(actionSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user