IzPack
  1. IzPack
  2. IZPACK-660

ProcessPanelWorker does not clear old jobs, it keeps adding additional jobs

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.3.3
    • Fix Version/s: 4.3.4, 5.0
    • Component/s: Installer, Panels
    • Labels:
      None
    • Environment:
      All platforms
    • Number of attachments :
      2

      Description

      The com.izforge.izpack.installer.ProcessPanelWorker maintains a list of the jobs that it will execute (ArrayList<ProcessingJob> jobs). When the ProcessPanelWorker runs, it parses the ProcessPanel.Spec.xml to create jobs for the currently selected packs (AutomatedInstallData.selectedPacks) and adds them to the list. Unfortunately, this list is never cleared. Each time the ProcessPanelWorker runs, it will keep adding or re-adding jobs to this list.

      We use the ProcessPanel to execute 3rd party installers based on a user's selection from the PacksPanel (via executeForPack in ProcessPanel.Spec.xml). If I allow users to navigate back to the PacksPanel to revise their packs selection, the jobs for the new selection are added on to this list of jobs. When the user proceeds to the ProcessPanel again, the old jobs will still be executed and the total number of jobs will be the sum of the old jobs and the new jobs. For example (assuming 1 job per pack), if I choose pack A, the process panel will show 1, but if I go back and select packs B and C and de-select pack A, the process panel will now show 3 rather than 2 and it will execute the jobs for packs A, B and C.

      I believe the jobs list should be cleared each time before the ProcessPanelWorker parses the ProcessPanel.Spec.xml.

      1. ProcessPanel.patch.txt
        0.5 kB
        Manny Lim
      2. ProcessPanelWorker.patch.txt
        0.6 kB
        Manny Lim

        Activity

        Hide
        Julien Ponge added a comment -

        Would you be able to contribute a patch?

        Show
        Julien Ponge added a comment - Would you be able to contribute a patch?
        Hide
        Manny Lim added a comment -

        I've attached two patches. ProcessPanelWorker.patch.txt will clear the jobs list before parsing the ProcessPanel.Spec.xml. ProcessPanel.path.txt zeroes out the "currentJob", which was continuing to increment every time the user returned to the ProcessPanel. Please review them, thanks.

        Show
        Manny Lim added a comment - I've attached two patches. ProcessPanelWorker.patch.txt will clear the jobs list before parsing the ProcessPanel.Spec.xml. ProcessPanel.path.txt zeroes out the "currentJob", which was continuing to increment every time the user returned to the ProcessPanel. Please review them, thanks.
        Hide
        Julien Ponge added a comment -

        Wonderful, I even was able to forward-port to v5!

        Show
        Julien Ponge added a comment - Wonderful, I even was able to forward-port to v5!

          People

          • Assignee:
            Julien Ponge
            Reporter:
            Manny Lim
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: