Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-456

Configuration.copy does not copy all attributes of the configuration

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.6

      Description

      Configuration.copy (and friends) only copies the list of dependencies and the name (appropriately modified). It does not copy other important fields (like transitive) so for Configuration a, a.resolve() != a.copy().resolve().

      I have included a patch with a fix for this, updated the unit test to exercise the fix, and added more javadoc to the Configuration interface for some of the methods that were unclear to me without reading the code.

      A few notes:
      I performed a shallow copy of the artifacts and excludeRules. I'm not sure whether the artifacts should be cloned or not. Someone who understands the usage better might investigate this. I feel better about shallow copying the excludeRules since they appear to be immutable. I'm not really sure how they are used, though, since there doesn't seem to be any way to set them in the Configuration interface (read only).

      Also, I intentionally didn't copy extendsFrom and I noted this in the JavaDoc. While it is strange to have a.getHierarchy() != a.copy().getHierarchy(), copying this would mess up the intended distinction between copy and copyRecursive when resolve was called on the copy.

        Attachments

          Activity

            People

            Assignee:
            hans_d Hans Dockter
            Reporter:
            sappling Steve Appling
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: