You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Xavier Léauté (JIRA)" <ji...@apache.org> on 2017/01/18 20:41:26 UTC

[jira] [Created] (KAFKA-4672) KIP-100 api changes break Java 8 lambda expressions in some cases

Xavier Léauté created KAFKA-4672:
------------------------------------

             Summary: KIP-100 api changes break Java 8 lambda expressions in some cases 
                 Key: KAFKA-4672
                 URL: https://issues.apache.org/jira/browse/KAFKA-4672
             Project: Kafka
          Issue Type: Bug
          Components: streams
    Affects Versions: 0.10.2.0
            Reporter: Xavier Léauté
            Assignee: Xavier Léauté
             Fix For: 0.10.2.0


Variance changes introduced in KIP-100 cause compilation failures with lambda expression in Java 8.

To my knowledge this only affects methods taking suppliers of functions
KStreams.transform(TransformerSupplier<...>, String...)
KStreams.transformValues(ValueTransformerSupplier<...>)
KStreams.process(ProcessorSupplier<...>)

prior to the changes it was possible to write

streams.process(MyProcessor::new)
streams.transform(MyTransformer::new)
etc.

where MyProcessor and MyTransformer extend Processor and Transformer respectively.

After the changes the Java compiler is unable to infer correct types for the lambda expression.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)