/**
* Grow the stack capacity.
*/
private final void grow() {
if (stack.length == maxSize) {
throw new StackException("Stack full");
} else {
final Item[] tmp = new Item[Math.min(maxSize, stack.length * 2)];
System.arraycopy(stack, 0, tmp, 0, stack.length);
stack = tmp;
}