The sun.security.ssl.SSLHandshake enum has a method called getHandshakeProducer(ConnectionContext) which is expected to return a HandshakeProducer. The SSLHandshake has an array which keeps tracks of such producers. The implementation of this getHandshakeProducer() has this line:
if (handshakeConsumers.length == 0) {
return null;
}
This appears to be a typo and instead should have been checking the length of handshakeProducers instead of handshakeConsumers. The rest of this method implementation correctly uses and works only on the handshakeProducers.