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

SettingsUtils.copySettings does not perform a deep copy

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 3.0-alpha-3
    • Component/s: Settings
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: