Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plugin/src/main/scala/com/typesafe/genjavadoc/AST.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ trait AST { this: TransformCake ⇒
case Nil ⇒ acc
}
val args = rec(d.vparamss.head) mkString ("(", ", ", ")")

val throwsAnnotations = d.symbol.throwsAnnotations.map(_.fullName)
val throws = if (throwsAnnotations.isEmpty) "" else "throws " + throwsAnnotations.mkString(", ")

val impl = if (d.mods.isDeferred || interface) ";" else "{ throw new RuntimeException(); }"
val pattern = (n: String) ⇒ s"$acc $tp $n $args $impl"
val pattern = (n: String) ⇒ s"$acc $tp $n $args $throws $impl"
def hasParam(n: String) = comment.find(_.contains(s"@param $n")).isDefined
val commentWithParams =
if (fabricateParams && comment.size > 1 && comment.head.startsWith("/**")) {
Expand Down
5 changes: 5 additions & 0 deletions tests/expected_output/akka/rk/buh/is/it/A.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ public class C implements akka.rk.buh.is.it.X {
* @return (undocumented)
*/
public int hello (scala.collection.Seq<java.lang.String> s) { throw new RuntimeException(); }
/**
* throws
* @return (undocumented)
*/
public int testthrows () throws java.lang.IllegalArgumentException, java.lang.NullPointerException { throw new RuntimeException(); }
/**
* Accessor for nested Scala object
* @return (undocumented)
Expand Down
7 changes: 7 additions & 0 deletions tests/src/test/scala/scala/javadoc/test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ class A {
@varargs
def hello(s: String*) = 0

/**
* throws
*/
@throws[IllegalArgumentException]
@throws(classOf[NullPointerException])
def testthrows = 0

/**
* class A.B
*/
Expand Down