Scaladoc 2.11 "throws tag" cannot find any member to link

413 views
Skip to first unread message

Chip Senkbeil

unread,
Jul 18, 2015, 3:02:25 PM7/18/15
to scala...@googlegroups.com
Hi,

I have a small Scala project located here (https://github.com/rcsenkbeil/scala-debugger) that cross compiles against Scala 2.10.5 and Scala 2.11.6. When trying to locally publish the jars via sbt +publishLocal, I get errors with Scala 2.11.6 regarding the use of the @throws tag.

E.g. 

For the following code:
  /**
   * Attempts to load the JDI, asserting that it can be and is loaded.
   *
   * @throws AssertionError If failed to load the JDI
   */

 
@throws[AssertionError]
 
protected def assertJdiLoaded(): Unit =
   
assert(jdiLoader.tryLoadJdi(),
     
"""
        |Unable to load Java Debugger Interface! This is part of tools.jar
        |provided by OpenJDK/Oracle JDK and is the core of the debugger! Please
        |make sure that JAVA_HOME has been set and that tools.jar is available
        |on the classpath!
      """
.stripMargin.replace("\n", " "))

I get this error:
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/Debugger.scala:19: Could not find any member to link for "AssertionError".
[error]   /**
[error]   ^

Is there anything that stands out as immediately wrong? I want to avoid removing the tag (there are 19 cases of this) since I use it to provide information regarding why the error would be thrown. This error does not happen with Scala 2.10.5.

Andreas Joseph Krogh

unread,
Jul 18, 2015, 3:10:15 PM7/18/15
to scala...@googlegroups.com
På lørdag 18. juli 2015 kl. 21:02:25, skrev Chip Senkbeil <chip.s...@gmail.com>:
Hi,
 
I have a small Scala project located here (https://github.com/rcsenkbeil/scala-debugger) that cross compiles against Scala 2.10.5 and Scala 2.11.6. When trying to locally publish the jars via sbt +publishLocal, I get errors with Scala 2.11.6 regarding the use of the @throws tag.
 
The syntax is:
    @throws(classOf[SomeClass])
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 

Chip Senkbeil

unread,
Jul 18, 2015, 3:18:07 PM7/18/15
to scala...@googlegroups.com
Even with the updated @throws(classOf[AssertionError])), I am still hitting the issue when publishing. It seems to be complaining about the Scaladoc, not the annotation I had. In fact, I didn't even have the annotation earlier (just the Scaladoc tag) and it had the same issue.

For reference, my current snippet now looks like this:

  /**
   * Attempts to load the JDI, asserting that it can be and is loaded.
   *
   * @throws AssertionError If failed to load the JDI
   */

 
@throws(classOf[AssertionError])

 
protected def assertJdiLoaded(): Unit =
   
assert(jdiLoader.tryLoadJdi(),
     
"""
        |Unable to load Java Debugger Interface! This is part of tools.jar
        |provided by OpenJDK/Oracle JDK and is the core of the debugger! Please
        |make sure that JAVA_HOME has been set and that tools.jar is available
        |on the classpath!
      """
.stripMargin.replace("\n", " "))

Is there anything else I am missing? Did I write the Scaladoc tag for @throws incorrectly?

Som Snytt

unread,
Jul 18, 2015, 11:22:44 PM7/18/15
to Chip Senkbeil, scala-user
The Scala annotation takes either form.

I don't know whether scaladoc does foreign links, but there's -no-link-warnings.


--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chip Senkbeil

unread,
Jul 18, 2015, 11:25:13 PM7/18/15
to scala...@googlegroups.com, chip.s...@gmail.com
Yeah, I found that option about an hour ago when looking at what I could do. That's what I'm going to do for now.
Reply all
Reply to author
Forward
0 new messages