Issue #332

Updated by Christophe Demeulemeester almost 2 years ago

Provided/Required Interfaces links appear in double when using the same Interface in different opened diagrams.

Steps to reproduce:

1. Create a Class Diagram CD1.
2. In CD1 create 2 Components C1 and C2.
3. Add some Ports P1 and P2 on C1 and C2.
4. Add a Provided Interface on P1 and a Required Interface on P2.
5. Create 2 Interfaces I1 and I2 in the model.
6. In CD1, set I1 as Provided Interface and I2 as Required Interface.
7. Without closing CD1, create another Class Diagram CD2.
8. In CD2 create 2 Components C3 and C4.
9. Add some Ports P3 and P4 on C3 and C4.
10. Add a Provided Interface on P3 and a Required Interface on P4.
11. Set I1 as Provided Interface and I2 as Required Interface.
12. Check CD1 diagram -> The Provided/Required Interfaces links appear in double and "org.modelio.diagram.persistence.PersistenceException" appears in the log.

Log extract:



org.modelio.diagram.persistence.PersistenceException: Index: 5, Size: 3
at org.modelio.diagram.persistence.XmlDiagramReader.readDiagram(XmlDiagramReader.java:551)
at org.modelio.diagram.elements.common.abstractdiagram.DiagramPersistence.load(DiagramPersistence.java:86)
at org.modelio.diagram.elements.common.abstractdiagram.GmAbstractDiagram.loadFromPersistence(GmAbstractDiagram.java:852)
at org.modelio.diagram.elements.common.abstractdiagram.GmAbstractDiagram$VisibleDiagramRefresher.visibilityChanged(GmAbstractDiagram.java:1254)
at org.modelio.diagram.elements.common.abstractdiagram.GmAbstractDiagram.enableRefresh(GmAbstractDiagram.java:401)
at org.modelio.diagram.editor.AbstractDiagramEditor$1.partVisible(AbstractDiagramEditor.java:506)
...

Caused by: java.lang.IndexOutOfBoundsException: Index: 5, Size: 3
at java.util.ArrayList.rangeCheckForAdd(ArrayList.java:661)
...
at org.modelio.diagram.elements.core.model.GmAbstractObject.firePropertyChange(GmAbstractObject.java:262)
...
at org.modelio.diagram.persistence.XmlDiagramReader.readDiagram(XmlDiagramReader.java:548)
... 93 more

Back