コード例 #1
0
 /**
  * Indicates that contains operation assignment over variables non local to the element
  *
  * @param element
  * @return
  */
 private boolean containNonLocalOperatorAssignment(CtElement element) {
   // Handling operators assignment
   for (CtOperatorAssignment op :
       element.getElements(new TypeFilter<CtOperatorAssignment>(CtOperatorAssignment.class))) {
     for (CtVariableAccess a : accessOfExpression(op.getAssigned())) {
       // Add cyclic dependencies
       if (!declaredInsideBlock.contains(a.getVariable())) return true;
     }
   }
   return false;
 }
コード例 #2
0
 @Override
 public <T, A extends T> void visitCtOperatorAssignement(CtOperatorAssignment<T, A> assignment) {
   for (CtVariableAccess a : accessOfExpression(assignment.getAssigned())) {
     // Add cyclic dependencies
     if (!declaredInsideBlock.contains(a.getVariable())) {
       remove(assignment);
       return;
     }
   }
 }