Skip to content

Commit

Permalink
Fix the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yoon committed May 15, 2020
1 parent de40452 commit b737b81
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 3 deletions.
Binary file modified bin/main/hgu/csee/isel/alinew/szz/AGSZZ.class
Binary file not shown.
Binary file modified bin/main/hgu/csee/isel/alinew/szz/AGSZZRunner.class
Binary file not shown.
Binary file not shown.
Binary file modified bin/main/hgu/csee/isel/alinew/szz/model/Line.class
Binary file not shown.
Binary file modified bin/main/hgu/csee/isel/alinew/szz/trace/Tracer.class
Binary file not shown.
Binary file modified bin/main/hgu/csee/isel/alinew/szz/util/GitUtils.class
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private AnnotationGraphModel buildPartitionedAnnotationGraph(Repository repo, Re
break;

RevCommit parentRev = revs.get(revs.indexOf(childRev) + 1);

String parentContent = Utils.removeComments(GitUtils.fetchBlob(repo, parentRev, path)).trim();
String childContent = Utils.removeComments(GitUtils.fetchBlob(repo, childRev, path)).trim();

Expand All @@ -100,6 +100,7 @@ private AnnotationGraphModel buildPartitionedAnnotationGraph(Repository repo, Re
System.out.println("\tparent rev : " + parentRev.getName());
System.out.println("\tchild rev : " + childRev.getName());
}


// get the parent line list from content
configureLineList(parentLineList, path, parentRev, parentContent);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/hgu/csee/isel/alinew/szz/model/Line.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ public class Line {
private LineType lineType;
private List<Line> ancestors;
private boolean isFormatChange;
private boolean isInitialCommit;
private boolean isWithinHunk;
private String commiter;
private String author;
private String commitDate;

public Line(String path, String rev, String content, int idx, LineType lineType, List<Line> ancestors,
boolean isFormatChange, boolean isWithinHunk, String commiter, String author, String commitDate) {
boolean isFormatChange,boolean isWithinHunk, String commiter, String author, String commitDate) {
super();
this.path = path;
this.rev = rev;
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/hgu/csee/isel/alinew/szz/trace/Tracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ public List<BICInfo> collectBILines(Repository repo, List<RevCommit> BFCList, An
if (0 <= begin && 0 <= end) {
for (int i = begin; i < end; i++) {
Line line = linesToTrace.get(i);

// if(line.getAncestors().size() == 0) {
// BILines.add(line);
// continue;
// }
if(analysis) {
traceWithAnalysis(line, BFC.getName());
} else {
Expand All @@ -184,6 +187,13 @@ public List<BICInfo> collectBILines(Repository repo, List<RevCommit> BFCList, An
return bicList;
}
public void trace(Line line) {

if(line.getAncestors().size() == 0) {
if (!Utils.isWhitespace(line.getContent()) && line.isWithinHunk()) {
BILines.add(line);
}
}

for (Line ancestor : line.getAncestors()) {
// Lines that are not white space, not format change, and within hunk are BI Lines.
if (!Utils.isWhitespace(ancestor.getContent())) {
Expand All @@ -194,8 +204,11 @@ public void trace(Line line) {
}
}
}

}



public void traceWithAnalysis(Line line, String BFC) {
for (Line ancestor : line.getAncestors()) {
// Lines that are not white space, not format change, and within hunk are BI Lines.
Expand Down

0 comments on commit b737b81

Please sign in to comment.