• Post Reply Bookmark Topic Watch Topic
  • New Topic

javadoc link to a constructor  RSS feed

 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you do an in-line javadoc link to a constructor? Can it even be done?

I tried various variations of the following type of thing: -



This does not work - no link gets generated and javadoc produces warnings.

Aside In Java 6, there is a regression meaning that not only do you not get the desired link, but javadoc crashes. I reported this bug to Sun and they accepted: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6551367.
(You could be nice and vote for my bug if you have an SDN account).

Anyway, as the above does not work, is there another way of in-line linking to a constructor?
[ April 30, 2007: Message edited by: Peter Chase ]
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wont this work

 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
{@link #JavadocBug()}

should work, too, I think.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Would be nice if the documentation said so, somewhere. I'm fairly sure it doesn't, but do prove me wrong...

The javadoc bug is still a bug. It shouldn't go throwing ClassCastExceptions from the javadoc tool, just because someone puts in a slightly dubious link.
 
Alex Tsyrulick
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me add one more thing about

In case of nested class one must refer to nesting class in a link to a constructor. Let's assume class Foo contains inner class Bar.
Then the link to the Bar constructor will be

or


BTW, I've found an interesting issue with Intellij IDEA (my version is 7.0.3). Its code insight and inner javadoc viewer expect the nesting class reference
is erroneous.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!