Uploaded image for project: 'SonarCFamily'
  1. SonarCFamily
  2. CPP-1457

Symlinked files belonging to two different languages should not lead to duplicated measures

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.12
    • Component/s: Sonar Plugin
    • Labels:
      None

      Description

      Currently, if build-wrapper is used and the project has two files of the type:

      • test.c file
      • symlink named test.cpp pointing to test.c

      The file will be analysed by both SquidSensorC and SquidSensorCpp leading to duplicate measure exception:

      org.sonar.api.utils.SonarException: Can not add the same measure twice on org.sonar.api.resources.File@2ba963c5[...]
      	at org.sonar.batch.sensor.DefaultSensorStorage.saveMeasure(DefaultSensorStorage.java:145)
      	at org.sonar.batch.index.DefaultIndex.addMeasure(DefaultIndex.java:174)
      	at org.sonar.batch.DefaultFileLinesContext.save(DefaultFileLinesContext.java:122)
      	at com.sonar.cpp.E.leaveFile(na:2845)
      	at com.sonar.sslr.squid.AstScanner.scan(na:2804)
      

      Another use case currently mis-behaving:

      • file.cpp file
      • symlink named file2.cpp pointing to file.cpp, this file will not be analysed

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              massimo.paladin Massimo PALADIN
              Reporter:
              massimo.paladin Massimo PALADIN
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: