[471045] Fix ArrayIndexOutOfBoundsException in model resolution42/72942/6
commitcc727ea40711b293accea0337cfc32272151cd36
authorAndreas Mayer <anma-e@gmx.de>
Tue, 17 May 2016 15:19:19 +0000 (17 17:19 +0200)
committerLaurent Delaigue <laurent.delaigue@obeo.fr>
Fri, 20 May 2016 10:04:35 +0000 (20 12:04 +0200)
treeea92075836acef224e1984b4d90d745ae44bd92f
parent7517bb7436d01391643d96096946959f4e72bba4
[471045] Fix ArrayIndexOutOfBoundsException in model resolution

If we skip setValue() for particular features, then we also have to skip
setManyReference() for them. Otherwise, setManyReference() may throw an
ArrayIndexOutOfBoundsException by trying to insert values at invalid
indexes (because expected values are missing) into many-valued features.
This happenned when a non-containment EList had several elements with
some of them resolved and others not yet resolved. Then, on
endDocument(), the management of forward references invokes
setManyReference(), expecting that elements already present are indeed
present in the targeted EList, which is not the case with our parser
pool.

Bug: 471045
Change-Id: I09f014f3d3e59f7919aef091368d61de4e56a19a
Signed-off-by: Andreas Mayer <anma-e@gmx.de>
Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr>
plugins/org.eclipse.emf.compare.ide.tests/src/org/eclipse/emf/compare/ide/tests/suite/AllTests.java
plugins/org.eclipse.emf.compare.ide.tests/src/org/eclipse/emf/compare/ide/utils/tests/Bug471045Test.java [new file with mode: 0644]
plugins/org.eclipse.emf.compare.ide.tests/src/org/eclipse/emf/compare/ide/utils/tests/data/bug471045.ecore [new file with mode: 0644]
plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotifyingParserPool.java