Skip to content

Commit

Permalink
refactor(spgroup#31): Get res through the attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
barbosamaatheus committed Dec 22, 2020
1 parent 0e74b7a commit dc45744
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void traverse(SootMethod sm, List<SootMethod> traversed, Statement.Type

body.getUnits().forEach(unit -> {

detectConflict(res, unit, changeTag, sm);
detectConflict(unit, changeTag, sm);

if (isTagged(changeTag, unit)) {
runAnalyzeWithTaggedUnit(sm, traversed, changeTag, unit);
Expand Down Expand Up @@ -164,16 +164,15 @@ private void kill(Unit unit) {
}
}

// TODO Obter res via atributo
/*
* To detect conflicts in verified if "u" is owned by LEFT or RIGHT
* and we fill in the "potentialConflictingAssignments" list with the changes from the other developer.
* To detect conflicts res verified if "u" is owned by LEFT or RIGHT
* and we fill res the "potentialConflictingAssignments" list with the changes from the other developer.
*
* We pass "u" and "potentialConflictingAssignments" to the checkConflits method
* to see if Left assignments interfere with Right changes or
* Right assignments interfere with Left changes.
*/
private void detectConflict(FlowSet<DataFlowAbstraction> in, Unit u, Statement.Type changeTag, SootMethod sm) {
private void detectConflict(Unit u, Statement.Type changeTag, SootMethod sm) {

if (!isTagged(changeTag, u)) {
return;
Expand All @@ -182,10 +181,10 @@ private void detectConflict(FlowSet<DataFlowAbstraction> in, Unit u, Statement.T
List<DataFlowAbstraction> potentialConflictingAssignments = new ArrayList<>();

if (isRightStatement(u) || isInRightStatementFLow(changeTag)) {
potentialConflictingAssignments = in.toList().stream().filter(
potentialConflictingAssignments = res.toList().stream().filter(
DataFlowAbstraction::containsLeftStatement).collect(Collectors.toList());
} else if (isLeftStatement(u) || isInLeftStatementFLow(changeTag)) {
potentialConflictingAssignments = in.toList().stream().filter(
potentialConflictingAssignments = res.toList().stream().filter(
DataFlowAbstraction::containsRightStatement).collect(Collectors.toList());
}

Expand Down

0 comments on commit dc45744

Please sign in to comment.