Update the information of a violation.
This commit is contained in:
@@ -8,6 +8,7 @@ import edu.lu.uni.serval.gumtree.regroup.HierarchicalActionSet;
|
|||||||
|
|
||||||
public class Violation implements Comparable<Violation> {
|
public class Violation implements Comparable<Violation> {
|
||||||
|
|
||||||
|
private String fileName = "";
|
||||||
private Integer startLineNum;
|
private Integer startLineNum;
|
||||||
private int endLineNum;
|
private int endLineNum;
|
||||||
private int bugStartLineNum;
|
private int bugStartLineNum;
|
||||||
@@ -26,6 +27,14 @@ public class Violation implements Comparable<Violation> {
|
|||||||
this.actionSets = new ArrayList<>();
|
this.actionSets = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFileName() {
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileName(String fileName) {
|
||||||
|
this.fileName = fileName;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getStartLineNum() {
|
public Integer getStartLineNum() {
|
||||||
return startLineNum;
|
return startLineNum;
|
||||||
}
|
}
|
||||||
@@ -92,4 +101,15 @@ public class Violation implements Comparable<Violation> {
|
|||||||
return this.startLineNum + " : " + this.endLineNum + " : " + this.alarmType;
|
return this.startLineNum + " : " + this.endLineNum + " : " + this.alarmType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (obj instanceof Violation) {
|
||||||
|
Violation v = (Violation) obj;
|
||||||
|
if (this.fileName.equals(v.fileName) && this.alarmType.equals(v.alarmType) && this.startLineNum == v.startLineNum && this.endLineNum == v.endLineNum) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user