Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-40603

JavadocFormatter is mismatching comments to parameters

    Details

      Description

      When formatting comments for a method that has parameters with names that have a similar start (e.g., params named "fileName" and "file"), the Javadoc formatter can apply the wrong comments to the parameters.

      For example, consider a method that has the following parameter Javadoc ...

      @param fileName the file's original name
      @param file the file

      The formatter is using the comment of the first parameter plus the suffix of the first parameter name as the second parameter's comment, resulting in the following:

      @param fileName the file's original name
      @param file Name the file's original name

      Steps To Reproduce:

      1. Open DLAppServiceImpl and find the following method:

      public FileEntry updateFileEntry(
      long fileEntryId, String sourceFileName, String mimeType,
      String title, String description, String changeLog,
      boolean majorVersion, File file, ServiceContext serviceContext)

      2. Note its fileEntryId params's Javadoc is the following:

      @param fileEntryId the primary key of the file entry

      3. Edit its file param's Javadoc to be the following:

      @param file the file

      4. cd portal-impl

      5. ant compile format-javadoc -Dlimit=DLAppServiceImpl

      Expected result Javadoc:

      @param fileEntryId the primary key of the file entry
      ....
      @param file the file

      Actual result Javadoc:

      @param fileEntryId the primary key of the file entry
      ....
      @param file EntryId the primary key of the file entry

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                brian.chan Brian Chan
                Reporter:
                james.hinkey James Hinkey
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 8 weeks, 3 days ago

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.0 CE RC2