Source:
<code>DTLSMessage getNextMessage(Record candidate) throws GeneralSecurityException, HandshakeException { int recordEpoch = candidate.getEpoch(); int sessionEpoch = session.getReadEpoch(); if (recordEpoch == sessionEpoch) { DTLSMessage fragment = candidate.getFragment(); if (fragment == null) { <START> LOGGER.debug("Cannot process message of type [{}], discarding...", candidate.getType()); <END> return null; } if (fragment.getContentType() != ContentType.HANDSHAKE && fragment.getContentType() != ContentType.CHANGE_CIPHER_SPEC) { LOGGER.debug("Drop message of type [{}], discarding...", candidate.getType()); return null; } switch (fragment.getContentType()) { case CHANGE_CIPHER_SPEC: if (isChangeCipherSpecMessageExpected()) { return fragment; } else { LOGGER.debug("Change Cipher Spec is not expected and therefore kept for later processing!"); changeCipherSpec = (ChangeCipherSpecMessage) fragment; return null; } case HANDSHAKE: HandshakeMessage handshakeMessage = (HandshakeMessage) fragment; int messageSeq = handshakeMessage.getMessageSeq(); if (messageSeq == nextReceiveSeq) { return handshakeMessage; } else if (messageSeq > nextReceiveSeq) { LOGGER.debug( "Queued newer message from current epoch, message_seq > next_receive_seq [{}]", messageSeq, nextReceiveSeq); queue.add(candidate); return null; } else { LOGGER.debug("Discarding old message_seq < next_receive_seq [{}]", handshakeMessage.getMessageType(), messageSeq, nextReceiveSeq); return null; } default: LOGGER.debug("Cannot process message of type [{}], discarding...", fragment.getContentType()); return null; } } else { throw new IllegalArgumentException("record epoch " + recordEpoch + " doesn't match session " + sessionEpoch); } }</code><technical_language>if this happened, this means is a bug scandium side ? If yes, log ERROR WARN</technical_language>

Target:
DTLSMessage getNextMessage(Record candidate) throws GeneralSecurityException, HandshakeException { int recordEpoch = candidate.getEpoch(); int sessionEpoch = session.getReadEpoch(); if (recordEpoch == sessionEpoch) { DTLSMessage fragment = candidate.getFragment(); switch (fragment.getContentType()) { case CHANGE_CIPHER_SPEC: if (isChangeCipherSpecMessageExpected()) { return fragment; } else { LOGGER.debug("Change Cipher Spec is not expected and therefore kept for later processing!"); changeCipherSpec = (ChangeCipherSpecMessage) fragment; return null; } case HANDSHAKE: HandshakeMessage handshakeMessage = (HandshakeMessage) fragment; int messageSeq = handshakeMessage.getMessageSeq(); if (messageSeq == nextReceiveSeq) { return handshakeMessage; } else if (messageSeq > nextReceiveSeq) { LOGGER.debug( "Queued newer message from current epoch, message_seq > next_receive_seq [{}]", messageSeq, nextReceiveSeq); queue.add(candidate); return null; } else { LOGGER.debug("Discarding old message_seq < next_receive_seq [{}]", handshakeMessage.getMessageType(), messageSeq, nextReceiveSeq); return null; } default: LOGGER.warn("Cannot process message of type [{}], discarding...", fragment.getContentType()); return null; } } else { throw new IllegalArgumentException("record epoch " + recordEpoch + " doesn't match session " + sessionEpoch); } }