Uploaded image for project: 'Maven JXR'
  1. Maven JXR
  2. JXR-41

Relative link to Xref not determined reliably

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • maven-jxr-plugin
    • None

    Description

      Using the HEAD revision of the JXR plugin, I find that with certain of my projects determining the relative link between the xref and the jxr.html page can both crash and provide incorrect results. The problem is basically this line:
      String relativPath = des.getAbsolutePath().substring( out.getAbsolutePath().length() + 1 );
      It does no content checking, and thus when for instance the output directory contains some '..' elements, it doesn't consider how that affects the length. A slight improvement is:
      String relativPath = des.getCanonicalPath().substring( out.getCanonicalPath().length() + 1 );
      which will at least be better so long as the locations point to similar filesystem locations (see attached patch).

      What is really needed is to do a filesystem based compare of the two locations and determine what the link should be - or just add a parameter to let the link be defined as a parameter, and reduce the cases that are guaranteed to work automatically.

      Attachments

        1. MOJO-jxr.patch
          0.9 kB
          Nick Giles

        Issue Links

          Activity

            People

              brett Brett Porter
              uroshnor Nick Giles
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: