You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Joel Koshy (JIRA)" <ji...@apache.org> on 2014/09/09 22:50:28 UTC

[jira] [Commented] (KAFKA-1625) Sample Java code contains Scala syntax

    [ https://issues.apache.org/jira/browse/KAFKA-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14127529#comment-14127529 ] 

Joel Koshy commented on KAFKA-1625:
-----------------------------------

Thanks for pointing out the reference to scala code from Java.

We should probably keep full qualification due to the dual-naming (between Scala and Java) that you noted - otherwise most people who try the examples out of the box would run into the question of which one do I use (say, when prompted to select imports in an IDE).

> Sample Java code contains Scala syntax
> --------------------------------------
>
>                 Key: KAFKA-1625
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1625
>             Project: Kafka
>          Issue Type: Bug
>          Components: website
>            Reporter: David Chen
>            Assignee: David Chen
>         Attachments: KAFKA-1625.site.0.patch, KAFKA-1625.site.1.patch
>
>
> As I was reading the Kafka documentation, I noticed that some of the parameters use Scala syntax, even though the code appears to be Java. For example:
> {code}
> public static kafka.javaapi.consumer.ConsumerConnector createJavaConsumerConnector(config: ConsumerConfig);
> {code}
> Also, what is the reason for fully qualifying these classes? I understand that there are Scala and Java classes with the same name, but I think that fully qualifying them in the sample code would encourage that practice by users, which is not desirable in Java code.



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