KAFKA-4672 fix source compatibility for lambda expressions#2402
KAFKA-4672 fix source compatibility for lambda expressions#2402xvrl wants to merge 1 commit intoapache:trunkfrom
Conversation
|
cc'ing @ijuma |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
|
It would be good to explain the reasoning in the PR description for posterity. |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
@ijuma updated pr description |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
cc'ing @dguy |
There was a problem hiding this comment.
I don't think this one needs to change. AFAICT it is only transform that has the issue
|
I think one issue is that we don't have tests for Java 8 handy. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
Ok, LGTM. Thanks! |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
ijuma
left a comment
There was a problem hiding this comment.
LGTM, assuming that someone has verified that this fixes the issue mentioned in the PR.
We should look into including Java 8 tests/examples in the codebase in the future.
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
Variance changes introduced in KIP-100 cause compilation failures with lambda expression in Java 8. To my knowledge this only affects the following method `KStreams.transform(TransformerSupplier<...>, String...)` prior to the changes it was possible to write: `streams.transform(MyTransformer::new)` where `MyTransformer` extends `Transformer` After the changes the Java compiler is unable to infer correct return types for the lambda expressions. This change fixed this by reverting to invariant return types for transformer suppliers. please cherry-pick into 0.10.2.x Author: Xavier Léauté <xavier@confluent.io> Reviewers: Ismael Juma, Damian Guy, Guozhang Wang Closes #2402 from xvrl/lambdas-oh-my (cherry picked from commit 20e957c) Signed-off-by: Guozhang Wang <wangguoz@gmail.com>
|
LGTM, merged to trunk and 0.10.2. Thanks @xvrl ! |
Variance changes introduced in KIP-100 cause compilation failures with lambda expression in Java 8. To my knowledge this only affects the following method `KStreams.transform(TransformerSupplier<...>, String...)` prior to the changes it was possible to write: `streams.transform(MyTransformer::new)` where `MyTransformer` extends `Transformer` After the changes the Java compiler is unable to infer correct return types for the lambda expressions. This change fixed this by reverting to invariant return types for transformer suppliers. please cherry-pick into 0.10.2.x Author: Xavier Léauté <xavier@confluent.io> Reviewers: Ismael Juma, Damian Guy, Guozhang Wang Closes apache#2402 from xvrl/lambdas-oh-my
Variance changes introduced in KIP-100 cause compilation failures with lambda expression in Java 8. To my knowledge this only affects the following method
KStreams.transform(TransformerSupplier<...>, String...)prior to the changes it was possible to write:
streams.transform(MyTransformer::new)where
MyTransformerextendsTransformerAfter the changes the Java compiler is unable to infer correct return types for the lambda expressions. This change fixed this by reverting to invariant return types for transformer suppliers.
please cherry-pick into 0.10.2.x