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

ArchitecturalConstraints should handle differentiation between wildcards "*" and "**"

    Details

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

      Description

      With the following configuration

      toClasses: java.lang.String
      fromClasses: org.*.util.**

      This should mean that:

      org.something.util.packageA.SomeClass1 should not access String, and that
      org.something2.util.packageB.SomeClass2 should not access String, and even that
      org.something3.util.packageA.subpackage.SomeClass3 should not access String.

      but

      org.something.extrapackage.util.packageA.SomeClass1 should be able to access String, and
      org.something2.extrapackage.util.packageB.SomeClass2 should be able to access String, and even
      org.something3.extrapackage1.extrapackage2.util.packageA.subpackage.SomeClass3 should be able to access String.

      Single * should be used to skip single level in the hierarchy, while ** should allow to bypass multiple levels.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.gumowski Michael Gumowski
                Reporter:
                michael.gumowski Michael Gumowski
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: