api/jar/src/main/java/javax/slee/profile/query/CompositeQueryExpression.java
void checkForCycles(QueryExpression expr) throws IllegalArgumentException {
        // is the expression argument equal to this?
        if (expr == this) throw new IllegalArgumentException("Cyclic expression detected");

        // recurse through all nested expressions that are composite expressions
        for (int i=0; i<exprs.size(); i++) {
            QueryExpression nested = (QueryExpression)exprs.get(i);
            if (nested instanceof CompositeQueryExpression) {
                ((CompositeQueryExpression)nested).checkForCycles(expr);
            }
            else if (nested instanceof Not) {
                ((Not)nested).checkForCycles(expr);
            }
        }
    }
void checkForCycles(QueryExpression expr) throws IllegalArgumentException {
        // is the expression argument equal to this?
        if (expr == this) throw new IllegalArgumentException("Cyclic expression detected");

        // recurse through all nested expressions that are composite expressions
        for (int i=0; i<exprs.size(); i++) {
            QueryExpression nested = (QueryExpression)exprs.get(i);
            if (nested instanceof CompositeQueryExpression) {
                ((CompositeQueryExpression)nested).checkForCycles(expr);
            }
            else if (nested instanceof Not) {
                ((Not)nested).checkForCycles(expr);
            }
        }
    }
void checkForCycles ( QueryExpression expr ) throws IllegalArgumentException { // is the expression argument equal to this? if ( expr == this ) throw new IllegalArgumentException ( "Cyclic expression detected" ) ; // recurse through all nested expressions that are composite expressions for ( int i = 0 ; i < exprs . size ( ) ; i ++ ) { QueryExpression nested = ( QueryExpression ) exprs . get ( i ) ; if ( nested instanceof CompositeQueryExpression ) { ( ( CompositeQueryExpression ) nested ) . checkForCycles ( expr ) ; } else if ( nested instanceof Not ) { ( ( Not ) nested ) . checkForCycles ( expr ) ; } } }
Check whether the specified expression contains a reference, either direct
or indirect, to this expression.
@param expr the expression to check and possibly recurse through.
@throws IllegalArgumentException if a cyclic expression is detected.
Check whether the specified expression contains a reference either direct or indirect to this expression .