private final void assertIsLocPathIterator ( Expression expr1 , ExpressionOwner eo ) throws RuntimeException { if ( ! ( expr1 instanceof LocPathIterator ) ) { String errMsg ; if ( expr1 instanceof Variable ) { errMsg = "Programmer's assertion: expr1 not an iterator: " + ( ( Variable ) expr1 ) . getQName ( ) ; } else { errMsg = "Programmer's assertion: expr1 not an iterator: " + expr1 . getClass ( ) . getName ( ) ; } throw new RuntimeException ( errMsg + ", " + eo . getClass ( ) . getName ( ) + " " + expr1 . exprGetParent ( ) ) ; } }
Assert that the expression is a LocPathIterator and if not try to give some diagnostic info .