Set lset = (Set) equisets.get(eq.getLeft()); Set rset = (Set) equisets.get(eq.getRight());
String l = eq.getLeft().toString(); String r = eq.getRight().toString(); Set lset = (Set) equisets.get(l); Set rset = (Set) equisets.get(r);
    Set getDuplicates(QFrame frame) {        List conds = frame.getRoot().getConditions();        Map equisets = new HashMap();        for (Iterator it = conds.iterator(); it.hasNext(); ) {            Expression e = (Expression) it.next();            List eqs = getEqualities(e);            for (Iterator iter = eqs.iterator(); iter.hasNext(); ) {                Equality eq = (Equality) iter.next();                Set lset = (Set) equisets.get(eq.getLeft());                Set rset = (Set) equisets.get(eq.getRight());                if (lset == null && rset == null) {                    lset = rset = new HashSet();                } else if (lset == null && rset != null) {                    lset = rset;                } else if (lset != null && rset == null) {                    rset = lset;                } else {                    lset.addAll(rset);                    rset = lset;                }                // They're the same set at this point, so it doesn't                // really matter which one we add to.                lset.add(eq.getLeft());                rset.add(eq.getRight());                equisets.put(eq.getLeft(), lset);                equisets.put(eq.getRight(), rset);            }        }        MultiMap values = new MultiMap();        for (Iterator it = conds.iterator(); it.hasNext(); ) {            Expression e = (Expression) it.next();            addDuplicates(e, frame, values, equisets);        }        Set result = new HashSet();        for (Iterator it = values.keys().iterator(); it.hasNext(); ) {            QFrame qf = (QFrame) it.next();            if (frame.isConstrained(values.get(qf))) {                result.add(qf.getAlias());            }        }        return result;    }