Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JavaDoc issue: @see tags not displaying properly

843810Aug 11 2006 — edited Sep 20 2006
I am having a very odd issue that I cannot seem to figure out. I am trying to add the following lines to a comment on a specific method:

@see javax.mail.internet.MimeMessage#setSubject(java.lang.String)
@see java.util.Properties#getProperty(java.lang.String)


My problem is, when the html is generated...it shows

See also:
MimeMessage, Properties.getProperty(java.lang.String)

I have both the J2SE and J2EE documentation linked so that these are linked to the source api on sun's site. When I click on MimeMessage it does send me to the setSubject() method within the MimeMessage class. So why does it not show MimeMessage.setSubject(java.lang.String)? Instead it just shows the class name. And why does Properties.getProperty(java.lang.String) properly show on the documentation but the MimeMessage class does not show the specific method it is linking to?

Comments

843810
I haven't heard of this bug before, so my first suspicion is that it's a bug in your doc comment or javadoc command somewhere. Could you please paste the surrounding text of your doc comment and the full (or representative) javadoc command with options?

Are you using the -noqualifier option to hide the package names?
I can see it. It could be a bug in javadoc or a bug with how -noqualifier was specified.

It's acting like you specified the first line as follow (with -noqualifier):
@see javax.mail.internet.MimeMessage
So maybe there's a funny character ahead of the hash character (#)?

It's also acting like the first line was specified as:
@see javax.mail.internet.MimeMessage#setSubject(java.lang.String) MimeMessage
(which is less likely) where the second argument to @see is just "MimeMessage". The second argument is generated as the HTML label, as in <a&nbsp;href="xxx">MimeMessage</a>.

-Doug
843810
Here is my set of @see tags for this method:
@see javax.mail.Session#getInstance(java.util.Properties, javax.mail.Authenticator)
@see javax.mail.internet.MimeMessage#setRecipients(javax.mail.Message.RecipientType, javax.mail.Address[])
@see javax.mail.internet.MimeMessage#setSentDate(java.util.Date)
@see javax.mail.internet.MimeMessage#setSubject(java.lang.String)
@see javax.mail.internet.MimeMessage#setHeader(java.lang.String, java.lang.String)
@see java.util.Properties#getProperty(java.lang.String)
@see java.util.Properties#list(java.io.PrintStream)
@see javax.mail.internet.MimeMessage#setFrom(javax.mail.Address)
@see java.io.StringWriter#write(java.lang.String)
@see javax.mail.internet.MimeBodyPart#setContent(java.lang.Object, java.lang.String)
@see javax.mail.Multipart#addBodyPart(javax.mail.BodyPart)
@see javax.mail.Transport#send(javax.mail.Message)
And here is what it outputs on the documentation:

See Also:
Session, MimeMessage, MimeMessage, MimeMessage, MimeMessage, Properties.getProperty(java.lang.String), Properties.list(java.io.PrintStream), MimeMessage, StringWriter.write(java.lang.String), MimeBodyPart, Multipart, Transport

I am using an ant build to generate the documentation, here is the javadoc target:
<target name="javadoc" description="Generates javadoc">
	
	<!--	Backup current javadocs directory and create new directory	-->
	<script language='javascript' src='./WebContent/js/javadocs/javadocBackup.js'></script>
	<delete dir="${backupdoc.dir}" failonerror="false"/>
	<move file="${doc.dir}" tofile="${backupdoc.dir}"/>
	<delete dir="${doc.dir}" failonerror="false"/>
	<mkdir dir="${doc.dir}" />
	
	<javadoc destdir="${doc.dir}" access="package" use="true" notree="false" nonavbar="false"
		noindex="false" splitindex="true" author="true" version="true" nodeprecatedlist="false"
		packagenames="us.or.state.dhs.*" sourcepath="${src.dir}" doctitle="${project.name}"
		windowtitle="${project.name} - API reference." stylesheetfile="../documents/javadocs.css"
		bottom="<script src='../../WebContent/js/javadocs/javadocTopBanner.js'></script>">
		
		<!--	Link to external API documentation	-->
		<link href="http://java.sun.com/j2ee/1.4/docs/api/"/>
		<link href="http://java.sun.com/j2se/1.4.2/docs/api"/>
	
	</javadoc>
</target>
It is just really odd that the classes within the j2se docs are displaying correctly whereas the j2ee classes are not. The j2see classes link correctly and point to the correct methods when you click on them. They just aren't displaying correctly as you see above with the 4 MimeMessage classes and the Session, Transport, etc.

Any help is appreciated, thanks for responding! :)
843810
Anyone have an idea why this bug is occuring? I still haven't been able to figure it out :(
843810
New Info:

I decided to force this to occur again, yet in a smaller scale to help show what is going on exactly.

Shown below are two simple link commands showing that a package within j2se displays correctly while a j2ee package does not. I have tried multiple classes and methods and they all produce the same result. The j2ee links are only displaying the class names rather than including the method name like it should be.

Here is the first command:
{@link javax.servlet.jsp.tagext#doStart()}
Which produces this html using the standard doclet:
<A HREF="http://java.sun.com/javaee/5/docs/api/javax/servlet/jsp/tagext/TagSupport.html#doStartTag()" title="class or interface in javax.servlet.jsp.tagext"><CODE>TagSupport</CODE></A>
Here is the second command:
{@link java.util.Vector#add(java.lang.Object)}
Which produces this html using the standard doclet:
<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Vector.html#add(java.lang.Object)" title="class or interface in java.util"><CODE>Vector.add(java.lang.Object)</CODE></A>
843810
Sorry for the delay in replying, wougoose.

I don't know if this is a copy and paste error from your source code, but your "first command" is missing the class name. Looking at the generated HTML, I would have expected that the command was:
{@link javax.servlet.jsp.tagext.TagSupport#doStart()}
Is this what it looks like in your source file?

If so, then please paste the source file's doStart() method declaration (implementation not needed) and doc comment into this thread so I can see what javadoc sees.

-Doug
843810
Sorry for the late response. The above was just a copy and paste error. This is my javadoc comment:
        /**
	 * Overrides method in <code>TagSupport</code>.
	 * 
	 * @return 				a constant indicating that servlet
	 * 						container should continue to evaluate the page.
	 * @throws JspException if any exceptions occur during tag processing lifecycle.
	 * @see 				javax.servlet.jsp.tagext.TagSupport#doStartTag()
	 */
The generated html for this javadoc comment is still buggy, as it only shows a link as:
<A HREF="http://java.sun.com/javaee/5/docs/api/javax/servlet/jsp/tagext/TagSupport.html#doStartTag()" title="class or interface in javax.servlet.jsp.tagext"><CODE>TagSupport</CODE></A>
When it should in fact be:
<A HREF="http://java.sun.com/javaee/5/docs/api/javax/servlet/jsp/tagext/TagSupport.html#doStartTag()" title="class or interface in javax.servlet.jsp.tagext"><CODE>TagSupport.doStartTag()</CODE></A>
Let me know if you need any more information.

Thanks,
-Joslyn
843810
Boy, I'm baffled by this. It looks like the doc comments are correct. As you say, the Javadoc tool does see the #doStartTag() because it inserts it in the HREF, but somehow doesn't insert it in the <CODE> element.

This looks like a bug in the tool itself. The only thing I can think of is to try some guesses at isolating the problem better. If there are any tab characters on the @see line, change them to spaces. (It appears that there are.) And try removing the @return and @throws tags to see if @see by itself works.

Lastly, I figure you won't care for this, but you can workaround the problem by adding a second argument in @see:

@see javax.servlet.jsp.tagext.TagSupport#doStartTag() TagSupport.doStartTag()

The second argument is the HTML label that appears between <a> and </a> tags (and can contain spaces). It can be any text you like, such as just "doStartTag()" or "doStartTag method".
1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 18 2006
Added on Aug 11 2006
7 comments
224 views