start position and lenght for actions
This commit is contained in:
+3
@@ -69,6 +69,9 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
int bugEndPosition = 0;
|
||||
int fixEndPosition = 0;
|
||||
for (HierarchicalActionSet hunkActionSet : hunkActionSets) {
|
||||
|
||||
|
||||
//TODO FIX ME
|
||||
int actionBugStart = hunkActionSet.getBugStartLineNum();
|
||||
int actionBugEnd = hunkActionSet.getBugEndLineNum();
|
||||
int actionFixStart = hunkActionSet.getFixStartLineNum();
|
||||
|
||||
@@ -241,11 +241,10 @@ public class HierarchicalRegrouperForC {
|
||||
|
||||
private boolean isStatement(ITree tree) {
|
||||
int nodeType = tree.getType();
|
||||
// if (nodeType == 280002 || nodeType == 280001 || nodeType == 310200 || nodeType == 280100
|
||||
// || nodeType == 300100 || nodeType == 280003 || nodeType == 310100 || nodeType == 310300
|
||||
// || 260300 == nodeType || nodeType == 460000) {// TODO
|
||||
if(nodeType == 460000){
|
||||
return true;
|
||||
if (nodeType == 280002 || nodeType == 280001 || nodeType == 310200 || nodeType == 280100
|
||||
|| nodeType == 300100 || nodeType == 280003 || nodeType == 310100 || nodeType == 310300
|
||||
|| 260300 == nodeType || nodeType == 460000) {// TODO
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -375,14 +375,14 @@ public class HunkActionFilter {
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
String actionStr = actionSet.getActionString();
|
||||
if (actionStr.startsWith("INS")) {
|
||||
int actionFixStartLine = actionSet.getBugStartLineNum();
|
||||
int actionFixEndLine = actionSet.getBugEndLineNum();
|
||||
int actionFixStartLine = actionSet.getStartPosition();
|
||||
int actionFixEndLine = actionSet.getLength();
|
||||
if (fixHunkStartLine <= actionFixEndLine && fixHunkEndLine >= actionFixStartLine ) {
|
||||
diffentryHunk.getActionSets().add(actionSet);
|
||||
}
|
||||
} else {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
int actionBugEndLine = actionSet.getBugEndLineNum();
|
||||
int actionBugStartLine = actionSet.getStartPosition();
|
||||
int actionBugEndLine = actionSet.getLength();
|
||||
|
||||
if (bugHunkStartLine <= actionBugEndLine && bugHunkEndLine >= actionBugStartLine) {
|
||||
diffentryHunk.getActionSets().add(actionSet);
|
||||
|
||||
Reference in New Issue
Block a user