From 1804a3e81593d7b5e4c589a152a6a0da8ec44f4d Mon Sep 17 00:00:00 2001 From: Barbosa Date: Tue, 22 Dec 2020 16:17:04 -0300 Subject: [PATCH] docs(#31): translate comments --- .../InterproceduralOverrideAssignment.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java b/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java index 2edbaa47..6c1d395b 100644 --- a/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java +++ b/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java @@ -99,10 +99,14 @@ private void runAnalyzeWithBaseUnit(SootMethod sm, List traversed, S private void runAnalyze(SootMethod sm, List 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()); @@ -137,9 +141,9 @@ 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) { @@ -147,7 +151,9 @@ private void gen(Statement 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. + */ res.add(new DataFlowAbstraction((InstanceFieldRef) valueBox.getValue(), stmt)); } }); @@ -207,8 +213,8 @@ private void checkConflicts(Unit unit, List 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());