return set ;
System.out.println( Thread.currentThread().getName() + " selected " + ((LinkedList)set.getValue()).size() + " references" ); return set;
	public Variable evaluateSelectExpression( SelectExpression se, Context c ) throws LemRuntimeException {		metamodel.Class selectedClass = se.getSelectedClass() ;		RelatedToOperation rto = se.getRelatedToOperation() ;		Expression condition = se.getCondition();		SetVariable set			= new SetVariable() ;		do {			synchronized ( c ) {				Collection objectList = c.getObjectList();				for ( Iterator i = objectList.iterator(); i.hasNext(); ) {					runtime.Object o = ( runtime.Object ) i.next();					for ( Iterator j = o.getInstances().iterator(); j.hasNext(); ) {						Instance instance = ( Instance ) j.next();						if ( instance.getInstanceClass() == selectedClass ) {							Variable var = VariableFactory.newVariable( ObjectReferenceType.getInstance(), o );							boolean goodVariable = true;							if ( condition != null ) {								Variable result;								Context newContext = new Context( c ) ;								newContext.addVariable( "selected" , var ) ;								result = evaluateExpression( condition , newContext );								if ( result instanceof BooleanVariable ) {									if ( !( ( Boolean ) ( ( BooleanVariable ) result ).getValue() ).booleanValue() ) {										goodVariable = false;									}								} else {									throw new LemRuntimeException( "Not a Boolean Expression." ) ;								}								/** @todo:								 * This context should not really be allowed								 * to create new objects, because that might								 * destroy our iterator integrity when those								 * objects are put into their parent context.								 * In fact, even when we don't have any objects								 * to create, this line will make the iterator								 * throw a concurrent modifiction exception								 * but that could be avoided if we only add to								 * the parent set if the finishing context's								 * objectlist is empty.								 * //    newContext.finish() ;								 */							}							if ( goodVariable && rto != null ) {								Relationship r = rto.getRelationship() ;								metamodel.Class relatedClass = rto.getRelatedClass() ;								metamodel.Class instanceClass = instance.getInstanceClass() ;								HashMap associations = instanceClass.getAssociations() ;								if ( ! ( associations.containsKey( r.getName() ) &&								         ( ( metamodel.Class ) associations.get( r.getName() ) ).getName().equals( relatedClass.getName() ) ) ) {									goodVariable = false;								}							}							if ( goodVariable )								set.addToSet( var ) ;						}					}				}			}			c = c.getParent();		} while ( c != null );		return set			       ;	}