Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343783

Summary: BasicEList$BasicIndexOutOfBoundsException triggered via Element.destroy()
Product: [Modeling] MDT.UML2 Reporter: Keith W. Campbell <keithc>
Component: CoreAssignee: Kenn Hussey <Kenn.Hussey>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: Kenn.Hussey
Version: unspecifiedFlags: Kenn.Hussey: indigo+
Target Milestone: RC1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Junit test plugin to reproduce the problem.
none
proposed patch Kenn.Hussey: iplog+

Description Keith W. Campbell CLA 2011-04-25 21:37:09 EDT
Build Identifier: org.eclipse.uml2.common_1.5.0.v201005031530

The attached zip file contains a small junit test class that demonstrates
how the exception occurs.

Reproducible: Always

Steps to Reproduce:
1. Run the attached junit test.
Comment 1 Keith W. Campbell CLA 2011-04-25 21:38:58 EDT
Created attachment 194030 [details]
Junit test plugin to reproduce the problem.
Comment 2 Keith W. Campbell CLA 2011-04-25 21:45:00 EDT
Here is the stack trace of the exception as triggered by the junit test.

org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=1, size=1
  at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:352)
  at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.hasNext(EContentsEList.java:484)
  at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.next(EContentsEList.java:565)
  at org.eclipse.emf.common.util.AbstractTreeIterator.next(AbstractTreeIterator.java:139)
  at org.eclipse.uml2.uml.internal.operations.ElementOperations.destroy(ElementOperations.java:1623)
  at org.eclipse.uml2.uml.internal.operations.ElementOperations.destroy(ElementOperations.java:1593)
  at org.eclipse.uml2.uml.internal.impl.ElementImpl.destroy(ElementImpl.java:567)
  at bug.example.DestroyTest.testDestroy(DestroyTest.java:94)
  ...
Comment 3 Keith W. Campbell CLA 2011-04-25 21:45:51 EDT
Created attachment 194031 [details]
proposed patch
Comment 4 Kenn Hussey CLA 2011-05-02 17:21:50 EDT
The proposed fix has been committed to CVS. I'll post an integration build later this week.
Comment 5 Kenn Hussey CLA 2011-05-02 21:44:42 EDT
Integration build I201105021958 is now available. Please confirm that this build resolves the issue.
Comment 6 Kenn Hussey CLA 2011-05-17 23:02:24 EDT
The fix is available in the RC1 build.
Comment 7 Kenn Hussey CLA 2011-05-31 10:34:20 EDT
Closing for Indigo release.