Opened 9 years ago
Last modified 7 years ago
#2540 closed defect
StringConvertibleMatrixView may throw an exception if it is reused — at Version 5
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:
- Open the PSO sample
- Clear the value of the VelocityBounds parameter in the SwarmUpdater operator
- 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 8 years ago by mkommend
- Milestone changed from HeuristicLab 3.3.14 to HeuristicLab 3.3.15
comment:2 Changed 8 years ago by mkommend
- Owner set to abeham
- Status changed from new to assigned
comment:3 Changed 8 years ago by abeham
- Owner changed from abeham to mkommend
comment:4 Changed 8 years ago by mkommend
- Owner changed from mkommend to abeham
- Status changed from assigned to reviewing
comment:5 Changed 8 years 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.
r15074: Changed StringConvertibleMatrixView to avoid CellValidating events of not existing cells.