Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2890

LocalSearchPhaseConfig.copyConfig not cloning MoveSelectorConfig

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • 8.27.0.Final
    • optaplanner-core
    • None

    Description

      While setting up some programmatic configuration I stumbled upon a bug where the copy function of LocalSearchPhaseConfig doesn't copy deep enough.

       

      We were setting up the template before modifying the configuration at runtime according to the instructions we noticed that we were mutating the MoveSelectorConfig of the template.

       

      I've created a couple failing tests for this behaviour (one including the config copy ctor, and one with the minimum reproduction). 

      We've not explored if more fields are affected by this issue.

      We've worked around it by just creating the MoveSelectorConfig from scratch each time instead of appending to our xml-based template.

       

      Tested with:

      • AdoptOpenJDK@17
      • MacOS  13.1
      • Commit 8d8354401d5c6d3255c962034b627393d1cde452 on origin/main

      Detected while running OptaPlanner 8.27.0.Final

      Attachments

        Activity

          People

            Unassigned Unassigned
            linco95 Andreas Kjellqvist (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: