if (status == ExchangeStatus.ACTIVE) { nextState = this.states[this.state][STATES_NEXT_MSG];
if (status == ExchangeStatus.ACTIVE && packet.getFault() == null) { nextState = this.states[this.state][STATES_NEXT_OUT]; } else if (status == ExchangeStatus.ACTIVE && packet.getFault() != null) { nextState = this.states[this.state][STATES_NEXT_FAULT];
    public void handleAccept() throws MessagingException {        // Change state        ExchangeStatus status = getStatus();        int nextState;        if (status == ExchangeStatus.ACTIVE) {            nextState = this.states[this.state][STATES_NEXT_MSG];        } else if (status == ExchangeStatus.ERROR) {            nextState = this.states[this.state][STATES_NEXT_ERROR];        } else if (status == ExchangeStatus.DONE) {            nextState = this.states[this.state][STATES_NEXT_DONE];        } else {            throw new IllegalStateException("unknown status");        }        if (nextState < 0 || nextState >= this.states.length) {            throw new IllegalStateException("next state is illegal");        }        this.state = nextState;    }