Parent-Child Diagram Part Inconsistency

Issue #1 resolved
andreas andreas created an issue

Exist since : PDT 4.0 =================================================================== Step to Reproduce : 1. Create an agent, create a capability inside of it. 2. delete the capability 3. Notice : "diagram initialized uncorrectly" is shown 4. add another capability in it. Null-pointer exception is thrown. 5. Now add another capability into the Agent 6. Exception thrown : Null-Pointer

=================================================================== Cause : 1-4 The entityID of the capability is removed from IDObject collection, and then the ModelElementPart of the capability try to getText() from the capability entity for refreshVisual()

current solution : Not yet found. It is still questionable whether this should be a Notice of diagram incorrectness, or should we treat it as a special case, as it could indicate that the ModelPart is not useful anymore. This indication is used as solution for the next (5-6) bug

5-6 The agent part still holding the deleted capability part as its listener. It will call the deactivate() and ask the entity to removelistener, but the entity has already gone.

current solution : when the deletion comes into play at (1-4) we detect this, and we ask the parent part to delete this capability from its children list.

=================================================================== Reason why it is minor bug: 1. These Exceptions are catch and not shown to the user that used it as plugins (It is shown in the console if we run it from a plugin project.) As far as I see, it does not break the relationship entity.

2. After step 1-4, if we close the .pd file, and then open it again, the problem in 5-6 does not shows, as The Diagram-Part relationship are built all over again, from the data definition in the.pd file which is not being affected by this runtime incosistency.

Comments (1)

  1. Log in to comment