@@ -174,10 +174,11 @@ private void gatherVariables(Predicate expectedType, List<RefinedVariable> lrv,
174174
175175 private void addAllDiferent (List <RefinedVariable > toExpand , List <RefinedVariable > from ,
176176 List <RefinedVariable > remove ) {
177- for (RefinedVariable rv : from ) {
178- if (!toExpand .contains (rv ) && !remove .contains (rv ))
179- toExpand .add (rv );
180- }
177+ from .stream ().filter (rv -> !toExpand .contains (rv ) && !remove .contains (rv )).forEach (toExpand ::add );
178+ // for (RefinedVariable rv : from) {
179+ // if (!toExpand.contains(rv) && !remove.contains(rv))
180+ // toExpand.add(rv);
181+ // }
181182 }
182183
183184 private List <RefinedVariable > getVariables (Predicate c , String varName ) {
@@ -190,14 +191,20 @@ private List<RefinedVariable> getVariables(Predicate c, String varName) {
190191 }
191192
192193 private void getVariablesFromContext (List <String > lvars , List <RefinedVariable > allVars , String notAdd ) {
193- for (String name : lvars )
194- if (!name .equals (notAdd ) && context .hasVariable (name )) {
195- RefinedVariable rv = context .getVariableByName (name );
196- if (!allVars .contains (rv )) {
194+ lvars .stream ().filter (name -> name .equals (notAdd ) && context .hasVariable (name )).map (context ::getVariableByName )
195+ .filter (rv -> !allVars .contains (rv )).forEach (rv -> {
197196 allVars .add (rv );
198197 recAuxGetVars (rv , allVars );
199- }
200- }
198+ });
199+
200+ // for (String name : lvars)
201+ // if (!name.equals(notAdd) && context.hasVariable(name)) {
202+ // RefinedVariable rv = context.getVariableByName(name);
203+ // if (!allVars.contains(rv)) {
204+ // allVars.add(rv);
205+ // recAuxGetVars(rv, allVars);
206+ // }
207+ // }
201208 }
202209
203210 private void recAuxGetVars (RefinedVariable var , List <RefinedVariable > newVars ) {
@@ -260,10 +267,13 @@ private void smtChecking(Predicate cSMT, Predicate expectedType, CtElement eleme
260267 */
261268 @ SuppressWarnings ("unused" )
262269 private Predicate substituteByMap (Predicate c , HashMap <String , String > map ) {
263- Predicate c1 = c ;
264- for (String s : map .keySet ())
265- c1 = c1 .substituteVariable (s , map .get (s ));
266- return c1 ;
270+ map .keySet ().forEach (s -> c .substituteVariable (s , map .get (s )));
271+ return c ;
272+
273+ // Predicate c1 = c;
274+ // for (String s : map.keySet())
275+ // c1 = c1.substituteVariable(s, map.get(s));
276+ // return c1;
267277 }
268278
269279 public void addPathVariable (RefinedVariable rv ) {
0 commit comments