Opened 19 months ago

Last modified 14 hours ago

#2540 reviewing defect

StringConvertibleMatrixView may throw an exception if it is reused

Reported by: abeham Owned by: abeham
Priority: medium Milestone: HeuristicLab 3.3.15
Component: Encodings.RealVectorEncoding Version: 3.3.13
Keywords: Cc:

Description (last modified by abeham)

This problem first appeared when changing a parameter of the PSO. To reproduce:

  1. Open the PSO sample
  2. Clear the value of the VelocityBounds parameter in the SwarmUpdater operator
  3. Set a new value and choose DoubleMatrix

A workaround exists, if the view is switched to another parameter and then back to the VelociyBounds parameter the matrix can be set without error.

Explanation: The ViewHost caches the current view. So after clearing the old matrix, its view as well as the matrix are still present in memory, but the view is hidden. When a new matrix is created, the view is reused again. When the Content property is changed UpdateData is called and there the non-empty collection of columns of this view are cleared. This triggers a cell validating event. The event however is canceled as it does not address a valid cell (the new DoubleMatrix doesn't have rows or columns). When UpdateData continues to clear the rows the datagridview complains that there are cells that are not comitted.

Change History (5)

comment:1 Changed 12 months ago by mkommend

  • Milestone changed from HeuristicLab 3.3.14 to HeuristicLab 3.3.15

comment:2 Changed 40 hours ago by mkommend

  • Owner set to abeham
  • Status changed from new to assigned

comment:3 Changed 38 hours ago by abeham

  • Owner changed from abeham to mkommend

comment:4 Changed 36 hours ago by mkommend

  • Owner changed from mkommend to abeham
  • Status changed from assigned to reviewing

r15074: Changed StringConvertibleMatrixView to avoid CellValidating events of not existing cells.

comment:5 Changed 14 hours ago by abeham

  • Description modified (diff)
  • Summary changed from Exception is thrown when setting a new DoubleMatrix for parameter VelocityBounds in the SwarmUpdater to StringConvertibleMatrixView may throw an exception if it is reused

Reviewed r15074: ok.

Note: See TracTickets for help on using tickets.