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

Blake Smith edited comment on KAFKA-1054 at 3/11/15 4:51 AM:
-------------------------------------------------------------

I attached an [updated patch|https://reviews.apache.org/r/31925/] that's 
rebased on the current trunk, and squashed 2 more compiler warnings.

Also: there are some surpressed scala "feature" warnings (looks like: postfix 
operators and implicit conversions). It looks like these warnings were added in 
2.10 as part of 
[SIP-18|http://docs.scala-lang.org/sips/completed/modularizing-language-features.html].
 I'm not sure what importing these language "features" will do in Scala 2.9 
given that they were considered standard scala, but are they worth addressing?

Feature warnings below:

{code}
/Users/blake/src/kafka/core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala:978:
 postfix operator contains should be enabled
by making the implicit value scala.language.postfixOps visible.
This can be achieved by adding the import clause 'import 
scala.language.postfixOps'
or by setting the compiler option -language:postfixOps.
See the Scala docs for value scala.language.postfixOps for a discussion
why the feature should be explicitly enabled.
      val addedTopics = updatedTopics filterNot (wildcardTopics contains)
                                                                ^
/Users/blake/src/kafka/core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala:988:
 postfix operator contains should be enabled
by making the implicit value scala.language.postfixOps visible.
      val deletedTopics = wildcardTopics filterNot (updatedTopics contains)
                                                                  ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:23: 
implicit conversion method scalaMessageSetToJavaMessageSet should be enabled
by making the implicit value scala.language.implicitConversions visible.
This can be achieved by adding the import clause 'import 
scala.language.implicitConversions'
or by setting the compiler option -language:implicitConversions.
See the Scala docs for value scala.language.implicitConversions for a discussion
why the feature should be explicitly enabled.
  implicit def scalaMessageSetToJavaMessageSet(messageSet: 
kafka.message.ByteBufferMessageSet):
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:28: 
implicit conversion method toJavaFetchResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaFetchResponse(response: kafka.api.FetchResponse): 
kafka.javaapi.FetchResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:31: 
implicit conversion method toJavaTopicMetadataResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaTopicMetadataResponse(response: 
kafka.api.TopicMetadataResponse): kafka.javaapi.TopicMetadataResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:34: 
implicit conversion method toJavaOffsetResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaOffsetResponse(response: kafka.api.OffsetResponse): 
kafka.javaapi.OffsetResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:37: 
implicit conversion method toJavaOffsetFetchResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaOffsetFetchResponse(response: 
kafka.api.OffsetFetchResponse): kafka.javaapi.OffsetFetchResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:40: 
implicit conversion method toJavaOffsetCommitResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaOffsetCommitResponse(response: 
kafka.api.OffsetCommitResponse): kafka.javaapi.OffsetCommitResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:43: 
implicit conversion method optionToJavaRef should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def optionToJavaRef[T](opt: Option[T]): T = {
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:51: 
implicit conversion method javaListToScalaBuffer should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def javaListToScalaBuffer[A](l: java.util.List[A]) = {
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/TopicMetadata.scala:23:
 implicit conversion method toJavaTopicMetadataList should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaTopicMetadataList(topicMetadataSeq: 
Seq[kafka.api.TopicMetadata]):
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/TopicMetadata.scala:29:
 implicit conversion method toPartitionMetadataList should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toPartitionMetadataList(partitionMetadataSeq: 
Seq[kafka.api.PartitionMetadata]):
               ^
12 warnings found
{code}


was (Author: blakesmith):
I attached an [updated patch|https://reviews.apache.org/r/31925/] that's 
rebased on the current trunk, and squashed 2 more compiler warnings.

Also: there are some surpressed scala "feature" warnings (looks like: postfix 
operators and implicit conrversions). It looks like these warnings were added 
in 2.10 as part of 
[SIP-18|http://docs.scala-lang.org/sips/completed/modularizing-language-features.html].
 I'm not sure what importing these language "features" will do in Scala 2.9 
given that they were considered standard scala, but are they worth addressing?

Feature warnings below:

{code}
/Users/blake/src/kafka/core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala:978:
 postfix operator contains should be enabled
by making the implicit value scala.language.postfixOps visible.
This can be achieved by adding the import clause 'import 
scala.language.postfixOps'
or by setting the compiler option -language:postfixOps.
See the Scala docs for value scala.language.postfixOps for a discussion
why the feature should be explicitly enabled.
      val addedTopics = updatedTopics filterNot (wildcardTopics contains)
                                                                ^
/Users/blake/src/kafka/core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala:988:
 postfix operator contains should be enabled
by making the implicit value scala.language.postfixOps visible.
      val deletedTopics = wildcardTopics filterNot (updatedTopics contains)
                                                                  ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:23: 
implicit conversion method scalaMessageSetToJavaMessageSet should be enabled
by making the implicit value scala.language.implicitConversions visible.
This can be achieved by adding the import clause 'import 
scala.language.implicitConversions'
or by setting the compiler option -language:implicitConversions.
See the Scala docs for value scala.language.implicitConversions for a discussion
why the feature should be explicitly enabled.
  implicit def scalaMessageSetToJavaMessageSet(messageSet: 
kafka.message.ByteBufferMessageSet):
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:28: 
implicit conversion method toJavaFetchResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaFetchResponse(response: kafka.api.FetchResponse): 
kafka.javaapi.FetchResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:31: 
implicit conversion method toJavaTopicMetadataResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaTopicMetadataResponse(response: 
kafka.api.TopicMetadataResponse): kafka.javaapi.TopicMetadataResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:34: 
implicit conversion method toJavaOffsetResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaOffsetResponse(response: kafka.api.OffsetResponse): 
kafka.javaapi.OffsetResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:37: 
implicit conversion method toJavaOffsetFetchResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaOffsetFetchResponse(response: 
kafka.api.OffsetFetchResponse): kafka.javaapi.OffsetFetchResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:40: 
implicit conversion method toJavaOffsetCommitResponse should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaOffsetCommitResponse(response: 
kafka.api.OffsetCommitResponse): kafka.javaapi.OffsetCommitResponse =
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:43: 
implicit conversion method optionToJavaRef should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def optionToJavaRef[T](opt: Option[T]): T = {
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/Implicits.scala:51: 
implicit conversion method javaListToScalaBuffer should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def javaListToScalaBuffer[A](l: java.util.List[A]) = {
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/TopicMetadata.scala:23:
 implicit conversion method toJavaTopicMetadataList should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toJavaTopicMetadataList(topicMetadataSeq: 
Seq[kafka.api.TopicMetadata]):
               ^
/Users/blake/src/kafka/core/src/main/scala/kafka/javaapi/TopicMetadata.scala:29:
 implicit conversion method toPartitionMetadataList should be enabled
by making the implicit value scala.language.implicitConversions visible.
  implicit def toPartitionMetadataList(partitionMetadataSeq: 
Seq[kafka.api.PartitionMetadata]):
               ^
12 warnings found
{code}

> Eliminate Compilation Warnings for 0.8 Final Release
> ----------------------------------------------------
>
>                 Key: KAFKA-1054
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1054
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Guozhang Wang
>              Labels: newbie
>             Fix For: 0.9.0
>
>         Attachments: KAFKA-1054.patch, KAFKA-1054_Mar_10_2015.patch
>
>
> Currently we have a total number of 38 warnings for source code compilation 
> of 0.8.
> 1) 3 from "Unchecked type pattern"
> 2) 6 from "Unchecked conversion"
> 3) 29 from "Deprecated Hadoop API functions"
> It's better we finish these before the final release of 0.8



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

Reply via email to