@Override
    public void run() {
        while (true) {
            // ArrayList<ConstraintVariable> values = 
            //         (ArrayList<ConstraintVariable>) variables.values();
            // for (ConstraintVariable v : values) {
            
            try {
                synchronized (variables) {
                    for (ConstraintVariable v : variables) {
                        // System.out.println(v.getOldValue() + ", " + v.getValue());
                        if (v.isSource()) {
                            Object value = v.getValue(), old = v.getOldValue();
                            if ((value != null && !value.equals(old)) ||
                                    (value == null && old != null)) {
                                // v.setInvalid();
                                v.populate();
                            }
                        }
                    }
                }
                Thread.sleep(1);
            } catch (Exception e) {
                System.out.println(e);
                return;
            }
        }
    }