Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4657

SettingsUtils.copySettings does not perform a deep copy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.1
    • 3.0-alpha-3
    • Settings
    • None

    Description

      The org.apache.maven.settings.SettingsUtils.copySettings method only creates a new Settings instance and then copies all its attributes by reference, including lists such as profiles or proxies. Hence, modifying the copy can produce unexpected side effects on the original object.

      Expected behavior is that a deep copy is returned, or documentation should mention this behaviour. Maybe make it implement Clonable ?

      Attachments

        Activity

          People

            bentmann Benjamin Bentmann
            edouard.hue Edouard Hue
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: