Skip to content

Commit

Permalink
docs(spgroup#31): translate comments
Browse files Browse the repository at this point in the history
  • Loading branch information
barbosamaatheus committed Dec 22, 2020
1 parent 332abb1 commit 1804a3e
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ private void runAnalyzeWithBaseUnit(SootMethod sm, List<SootMethod> traversed, S

private void runAnalyze(SootMethod sm, List<SootMethod> traversed, Statement.Type changeTag, Unit unit, boolean tagged) {
if (unit instanceof AssignStmt) {
// TODO Does AssignStmt check contain objects, arrays or other types?
/* TODO Does AssignStmt check contain objects, arrays or other types?
Yes, sssignStmt handles assignments and they can be of any type as long as they follow the structure: variable = value
*/
AssignStmt assignStmt = (AssignStmt) unit;

// TODO Check case: x = foo() + foo
/* TODO Check case: x = foo() + bar()
In this case, this condition will be executed for the call to the foo() method and then another call to the bar() method.
*/
if (assignStmt.containsInvokeExpr()) {
Statement stmt = getStatementAssociatedWithUnit(sm, unit, changeTag);
traverse(assignStmt.getInvokeExpr().getMethod(), traversed, stmt.getType());
Expand Down Expand Up @@ -137,17 +141,19 @@ private boolean isInLeftStatementFLow(Statement.Type changeTag) {
return changeTag.equals(Statement.Type.SOURCE);
}

// TODO precisa tratar outros casos
// TODO adicionar em duas litas (left e right).
// TODO adicionar profundidade InstanceFieldRef e StaticFieldRef
// TODO need to treat other cases
// TODO add in two lists (left and right).
// TODO add depth to InstanceFieldRef and StaticFieldRef
private void gen(Statement stmt) {
stmt.getUnit().getDefBoxes().forEach(valueBox -> {
if (valueBox.getValue() instanceof Local) {
res.add(new DataFlowAbstraction((Local) valueBox.getValue(), stmt));
} else if (valueBox.getValue() instanceof StaticFieldRef) {
res.add(new DataFlowAbstraction((StaticFieldRef) valueBox.getValue(), stmt));
} else if (valueBox.getValue() instanceof InstanceFieldRef) {
// TODO verificar o que é adicionado. (Objeto.field)
/* TODO check what is added. (Object.field)
r0.<br.unb.cic.analysis.samples.OverridingAssignmentClassFieldConflictInterProceduralSample: int x>
*/
res.add(new DataFlowAbstraction((InstanceFieldRef) valueBox.getValue(), stmt));
}
});
Expand Down Expand Up @@ -207,8 +213,8 @@ private void checkConflicts(Unit unit, List<DataFlowAbstraction> potentialConfli
}
}

// TODO melhorar nome do metodo
// TODO não comparar como string
// TODO improve method name
// TODO don't compare as a string
private boolean compareItens(ValueBox valueBox, DataFlowAbstraction dataFlowAbstraction) {
if (valueBox.getValue() instanceof InstanceFieldRef && dataFlowAbstraction.getFieldRef() != null) {
return getVariableNameInFromValueBoxInstanceFieldRef(valueBox).equals(dataFlowAbstraction.getFieldRef().getBase().toString());
Expand Down

0 comments on commit 1804a3e

Please sign in to comment.