Legacy Issue Number: 18714
Source: LieberLieber Software ( Tanja Mayerhofer)
If a value of a structured value shall be removed and the isRemoveDuplicates flag of the RemoveStruturalFeatureValueAction is set to true or if the removeAt pin was null, the position(s) of the value to be removed are determined by calling the operation int WriteStructuralFeatureActionActivation.position(Value, ValueList, int). The problem is that the last found position is provided as startPosition for the next call of the position operation. Therefore this found position is found again and again in each call of the operation resulting in an infinite loop.
Replace the following operation call
j = this.position(inputValue, featureValue.values, j);
>>> j = this.position(inputValue, featureValue.values, j+1);
In line 113 (last statement in while loop of if (action.isRemoveDuplicates) clause) and 121 (last statement in while loop of else if (action.removeAt == null) clause).
Reported: FUML 1.1 — Tue, 14 May 2013 04:00 GMT
Disposition: Resolved — FUML 1.2
In the case of action.isRemoveDuplicates = false and action.removeAt = null, the issue is correct that the current specification will result in an infinite loop if the given structural feature holds any instances of the given value.
However, the issue is not correct for the case action.isRemoveDuplicates = true. In that case, instance of the given value found at position j is removed before the search for the position of the next instance, so beginning the search at position j is correct. Indeed, starting the next search at position j+1 could cause an instance of the value to be skipped, if it happened to come right after the instance that had just been removed.
Updated: Tue, 22 Dec 2015 15:09 GMT