protected static Variable findTargetVariable(VariableExpression ve){
  final Variable accessedVariable=ve.getAccessedVariable() != null ? ve.getAccessedVariable() : ve;
  if (accessedVariable != ve) {
    if (accessedVariable instanceof VariableExpression)     return findTargetVariable((VariableExpression)accessedVariable);
  }
  return accessedVariable;
}

protected static Variable findTargetVariable ( VariableExpression ve ) { final Variable accessedVariable = ve . getAccessedVariable ( ) != null ? ve . getAccessedVariable ( ) : ve ; if ( accessedVariable != ve ) { if ( accessedVariable instanceof VariableExpression ) return findTargetVariable ( ( VariableExpression ) accessedVariable ) ; } return accessedVariable ; }
given a variable expression , returns the ultimately accessed variable .
