Simon, > if (stack.isEmpty()) { > return null; > } else { > // right here some other thread could empty the stack, causing > // the following pop to throw an exception despite our > // check above > return stack.pop(); > }
Yep gotcha now and I'm glad to hear that the pop and peek methods will throw the EmptyStackException. I did think it was weird that they did not however I figured there was something I was missing. I was trying to think about whether or not I should adopt the same behavior in the Digester pattern implementation (not for XML) I'm currently working on. Alex --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]