Details
-
Type:
Story
-
Status: Won't Fix
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: jointcal
-
Labels:
-
Story Points:1
-
Epic Link:
-
Team:Alert Production
Description
While fixing DM-7070, we discovered that FittedStar's handling of MeasurementCount is via a potentially dangerous int&-returning method. Better would be incrementMeasurementCount/decrementMeasurementCount methods (or could we just use the ++/-- operators?). It should only ever be incremented or decremented (or set to 0, but that happens on construction and in clearBeforeAssoc()).
This would prevent accidentally overwriting it. We should also have the decrement raise an exception if the value would go below 0 (which it shouldn't, as it's a strict counter).
Attachments
Issue Links
- mentioned in
-
Page Loading...
I'd recommend against using ++ because it leads to a confusing API – just what does it mean to "increment a star"? Does that turn it into a binary?
If you're trying to go for a shorter name, how about e.g. addMeasurement and removeMeasurement/clearMeasurement (depending on exactly what it means for Jointcal to decrement this)?