Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5006659

@link for varargs method needs "[]" rather than "..." for method parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b44
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_9

      Description

      I'm trying to reference a varargs method using @link tags in javadoc and
      things aren't behaving as I would expect. Here's a tiny example:

      FILE: p/Ref.java

        package p;

        public class Ref {
            /**
             * m javadoc.
             */
            public void m(Object ... o) {}
        }

      FILE: p/Test.java

        package p;

        /**
         * {@link p.Ref#m(Object[])}
         */
        public class Test {}


      In Ref.html, javadoc, the method m, has the following name:

        <A NAME="m(java.lang.Object...)"><!-- --></A><H3>
        m</H3>
        <PRE>
        public void <B>m</B>(java.lang.Object...&nbsp;o)</PRE>
        <DL>
        <DD>m javadoc.

      Based on the above and the syntax for varargs, I would have guessed that the
      @link tag should look something like:

        @link p.Ref#m(Object...)

      This does not work. It seems that for javadoc to succeed, I need to use:

        @link p.Ref#m(Object[])

      -- iag@sfbay 2004-02-02

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sseligmasunw Scott Seligman (Inactive)
              Reporter:
              iris Iris Clark
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: