Maven Javadoc Plugin
  1. Maven Javadoc Plugin
  2. MJAVADOC-312

having parenthesis as part of a path causes ArrayIndexOutOfBounds exception

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.9
    • Labels:
      None
    • Number of attachments :
      0

      Description

      If you are running this plugin, for a project in a directory, where the directory name contains a parenthesized part, e.g., "(2)", the method getExcludedPackages in class JavadocUtil fails on line 508 saying ArrayIndexOutOfBoundsException - with the array index being "1".

      This is due to incorrect assmptions being made about characters in file paths, in particular, the code on line 507 is using a file path as a regular expression - to chop off the part in front that matches. This only works, if no characters in the file path string are "special meaning" characters for regular expressions, and parenthesis are, of course.

      The way parenthesis got into the path name was:
      1) I downloaded from the web a source release zip file.

      2) later I downloaded an updated version of this same file. My browser, seeing I already had a file by that name in my "Downloads" area, named this 2nd download as xxxx (2).zip - adding the "(2)" to the name of the download.

      3) My "unzipper" creates a directory with the same name as the zip file by convention, so the directory was named ... /xxxx (2)/ ....

        Activity

        Hide
        Benson Margulies added a comment -

        ------------------------------------------------------------------------
        r1384982 | bimargulies | 2012-09-14 20:26:16 -0400 (Fri, 14 Sep 2012) | 3 lines

        MJAVADOC-312: having parenthesis as part of a path causes ArrayIndexOutOfBounds exception
        o added call to Pattern.quote to protect from problem.

        Show
        Benson Margulies added a comment - ------------------------------------------------------------------------ r1384982 | bimargulies | 2012-09-14 20:26:16 -0400 (Fri, 14 Sep 2012) | 3 lines MJAVADOC-312 : having parenthesis as part of a path causes ArrayIndexOutOfBounds exception o added call to Pattern.quote to protect from problem.

          People

          • Assignee:
            Benson Margulies
            Reporter:
            Marshall Schor
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: