lightbend / genjavadoc

A compiler plugin for generating doc’able Java source from Scala source
Other
58 stars 32 forks source link

Single-line ScalaDoc plus deprecated annotation would trigger a bug #85

Open mengxr opened 8 years ago

mengxr commented 8 years ago

We recently deprecated setLabelCol in ChiSqSelectorModel in Spark (https://github.com/apache/spark/pull/13823):

  /** @group setParam */
  @Since("1.6.0")
  @deprecated("labelCol is not used by ChiSqSelectorModel.", "2.0.0")
  def setLabelCol(value: String): this.type = set(labelCol, value)

This unfortunately hit a genjavadoc bug and broken doc generation. This is the generated Java code:

  /** @group setParam */
  public  org.apache.spark.ml.feature.ChiSqSelectorModel setOutputCol (java.lang.String value)  { throw new RuntimeException(); }
   *
   * @deprecated labelCol is not used by ChiSqSelectorModel. Since 2.0.0.
  */
  public  org.apache.spark.ml.feature.ChiSqSelectorModel setLabelCol (java.lang.String value)  { throw new RuntimeException(); }

Switching to multiline is a workaround (https://github.com/apache/spark/pull/13855). It would be nice to fix this bug in genjavadoc.

patriknw commented 8 years ago

Same here, but that is not single line: https://github.com/akka/akka/blob/master/akka-remote/src/main/scala/akka/remote/AddressUidExtension.scala#L43

This was with Scala 2.12.0-RC2