Community
Participate
Working Groups
This exception is thrown on startup !ENTRY org.eclipse.core.jobs 4 2 2010-05-06 10:15:51.640 !MESSAGE An internal error occurred during: "Initializing Java Tooling". !STACK 0 java.lang.ArrayIndexOutOfBoundsExcep tion: Array index out of range: 2 at java.lang.System.arraycopy(Native Method) at org.eclipse.emf.common.util.BasicEList.gr ow(BasicEList.java:736) &n bsp; at org.eclipse.emf.common.util.BasicEList.ad dUnique(BasicEList.java:422) &nb sp; at org.eclipse.emf.common.util.AbstractEList. add(AbstractEList.java:307) &nbs p; at org.eclipse.emf.common.notify.impl.BasicN otifierImpl$EAdapterList.add(BasicNotifierImpl. java:199) at org.eclipse.wst.common.componentcore.internal. StructureEdit.getEclipseResource(StructureEdit. java:252) at org.eclipse.wst.common.componentcore.internal. impl.ResourceTreeNode.findMatchingVirtual PathsSet(ResourceTreeNode.java:195) This exposes a race condition where the adapter List is not synchronized.
Created attachment 168309 [details] patch
Using pattern used many times - adding the synchronized adapter class to utilities for repeated use... EMF adapter class is NOT thread safe, and doesn't protect internal collection. This class does.
I approve of this patch
- 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. Thrown exceptions on startup - adopter product deems this as major - Is there a work-around? If so, why do you believe the work-around is insufficient? no workaround - How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Existing junit bucket run - no new test needed - Give a brief technical overview. Who has reviewed this fix? The same code has been in place on ReferencedXMIResourceImpl for a couple years with success(no regressions) This will protect (lock) the adapter collection during any access to its internal collection - What is the risk associated with this fix? no risk of deadlock because there is no outside call from the synchronized methods
Committed to HEAD for WTP 3.2 RC1
*** Bug 322339 has been marked as a duplicate of this bug. ***