You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Bruno Cadonna (Jira)" <ji...@apache.org> on 2019/10/29 08:48:00 UTC

[jira] [Created] (KAFKA-9109) Get Rid of Cast from ProcessorContext to InternalProcessorContext

Bruno Cadonna created KAFKA-9109:
------------------------------------

             Summary: Get Rid of Cast from ProcessorContext to InternalProcessorContext
                 Key: KAFKA-9109
                 URL: https://issues.apache.org/jira/browse/KAFKA-9109
             Project: Kafka
          Issue Type: Improvement
          Components: streams
            Reporter: Bruno Cadonna


The following cast is often used in Kafka Streams code.

{code:java}
public void init(final ProcessorContext context) {
    internalProcessorContext = (InternalProcessorContext) context;
    ...
}
{code}

This code leads to a {{ClassCastException}} if the implementation of the {{ProcessorContext}} is not an {{InternalProcessorContext}}, which defeats the purpose of using interface {{ProcessorContext}} in the API.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)