Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313390 - index=7, size=6
Summary: index=7, size=6
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Hari Shankar CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-18 12:27 EDT by Hari Shankar CLA
Modified: 2010-05-20 09:56 EDT (History)
3 users (show)

See Also:
hshanka: pmc_approved? (david_williams)
hshanka: pmc_approved? (raghunathan.srinivasan)
hshanka: pmc_approved? (naci.dai)
deboer: pmc_approved+
hshanka: pmc_approved? (neil.hauge)
hshanka: pmc_approved? (kaloyan)
cbridgha: review+


Attachments
patch (1.16 KB, patch)
2010-05-18 12:28 EDT, Hari Shankar CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hari Shankar CLA 2010-05-18 12:27:54 EDT
Build Identifier: 32

The following exception was seen (once) during product restart in from adopter product:

java.lang.IndexOutOfBoundsException: index=7, size=6
at org.eclipse.emf.ecore.util.BasicFeatureMap.entryIndex(Unknown Source)
at org.eclipse.emf.ecore.util.BasicFeatureMap.add(Unknown Source)
at org.eclipse.emf.ecore.util.FeatureMapUtil$FeatureEList.add(Unknown Source)
at org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil.eSetOrAdd(Unknown Source)
at org.eclipse.wst.common.internal.emf.resource.Translator.setMOFValue(Unknown Source)
at org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl.primUpdateMOFMultiFeature(Unknown Source)
at org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl.primUpdateMOFMultiFeature(Unknown Source)
at org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl.updateMOFMultiFeature(Unknown Source)
at org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl.updateMOFFeature(Unknown Source)
at org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl.primUpdateMOF(Unknown Source)
at org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl.updateMOF(Unknown Source)
at org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl.primUpdateMOFMultiFeature(Unknown Source) 

Reproducible: Couldn't Reproduce

Steps to Reproduce:
This happened only once and is not reproducible. However, through this patch, I am proposing a defensive alternative to the existing code, so that we can avoid this issue in future.
Comment 1 Hari Shankar CLA 2010-05-18 12:28:41 EDT
Created attachment 168963 [details]
patch

This patch checks to see if the index is > the size of the array, and uses the index if its valid.
Comment 2 Chuck Bridgham CLA 2010-05-18 20:15:29 EDT
approve
Comment 3 Hari Shankar CLA 2010-05-19 11:57:45 EDT
    * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

This exception, if it occurs, will cause the model to be in a bad state.

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 
No known workarounds.

    * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
Tested this fix by running an end to end smoke test incuding rad restart.

    * Give a brief technical overview. Who has reviewed this fix? 
This fix has been reviewed by Chuck Bridgham.
    * What is the risk associated with this fix? 
No known risks.
Comment 4 Tim deBoer CLA 2010-05-19 13:45:28 EDT
I agree with defensive code and am approving, but do you have any idea how this could happen in the first place? Sounds like there is still an underlying problem lurking, and although this avoids the exception, do you know if this would be the correct behaviour if this happens again?
Comment 5 Carl Anderson CLA 2010-05-20 09:56:58 EDT
Committed to HEAD for WTP 3.2 RC 2