The code generated by the current version of NGEN for
models containing cycles in associations raises
ConcurrentModificationException while saving such a
model. The problem is in the generated
processAssociations() function, which cycles through an
'extent' object, which has a type of HashMap. On some
models, this object can be modified inside the
processAssociations() function, making all iterators
invalid. Modifications are performed by the
collectAttributes() function, which is also generated
by NGEN.
My fix avoids the problem by creating a temporary copy
of 'extent' object. However, it can significantly
reduce perfomance when saving large models. Quite now I
cannot suggest a better fix.
The attached patch should be applied over file
'GenMMImplXMIWriterSAX2.java'.
--
Max Zinal
A patch for GenMMImplXMIWriterSAX2.java
Logged In: YES
user_id=1248746
I would also like to upload an example of model which causes
the problem,
but this strange tracker allows to upload only one file :(.
Logged In: NO
Actually I've found that my implementation was pretty naive.
I'm currently preparing a better (and, uh, much better)
patch which *really* works with deep-nested objects along
with multiple associations.
Logged In: YES
user_id=1248746
A better fix is provided in a separate patch record.