Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-444

Correctly handle unnamed package and remove metric "packages"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: None
    • Labels:
      None

      Description

      Currently for a file from directory "org/Example.java":

      class Example {}
      

      package "org" will be used (see SONAR-2348 and SONAR-864), which results in incorrect metric "packages", when file in another directory (let's say "com/Example.java") also belongs to unnamed package.

      Moreover - exception will be thrown, when package name doesn't match package declaration. This exception should be removed for SONARJAVA-438.

      To be discussed - whether should we continue to compute metric "packages" for directories or not? The problem is that several directories could contain same package or even one directory several packages.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              godin OLD - Evgeny Mandrikov
              Reporter:
              godin OLD - Evgeny Mandrikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: