Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-6287

Make batch more resilient with case sensitivity issues of path on Windows

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5
    • Component/s: Scanner
    • Labels:
      None
    • Environment:
      Windows

      Description

      Say you have a drive letter name that is "C:".
      new File("C:\toto").getCanonicalPath() will return "C:\toto"

      To get the current project basedir SQ Runner is doing new File(".").getAbsolutePath(). The result depends on the value of System property "user.dir". It seems that this value can sometimes be incorrectly changing case of drive letters and will return "c:\toto".

      It will break in many SQ locations but one in particular is FileSystem.inputFile(predicate.absolutePath("C:\toto\titi.java"))

      I see several option to be tried:

      • SQ Runner should sanitize user.dir by calling getCanonicalPath
      • Try if new Path API of Java 7 may help
      • Compare paths using File

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              duarte.meneses Duarte Meneses
              Reporter:
              henryju OLD - Julien HENRY
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: