Bug 412873 - [regression] ArrayIndexOutOfBoundsException when starting Eclipse with a review open
Summary: [regression] ArrayIndexOutOfBoundsException when starting Eclipse with a revi...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 7
: P2 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Miles Parker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-12 12:13 EDT by Tomasz Zarna CLA
Modified: 2013-08-13 13:15 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2013-07-12 12:13:35 EDT
It's a reincarnation of bug 408761, still occurring in 2.0. Running of master [1], starting Eclipse with a review already open:

java.lang.ArrayIndexOutOfBoundsException: 2
	at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.java:118)
	at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList.java:418)
	at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:301)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.add(BasicNotifierImpl.java:193)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.RemoteEmfConsumer.<init>(RemoteEmfConsumer.java:124)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.AbstractRemoteEmfFactory.getConsumerForLocalKey(AbstractRemoteEmfFactory.java:183)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetContentIdRemoteFactory.pull(PatchSetContentIdRemoteFactory.java:40)
	at org.eclipse.mylyn.internal.gerrit.core.remote.PatchSetContentIdRemoteFactory.pull(PatchSetContentIdRemoteFactory.java:1)
	at org.eclipse.mylyn.reviews.core.spi.remote.emf.RemoteEmfConsumer.pull(RemoteEmfConsumer.java:164)
	at org.eclipse.mylyn.reviews.core.spi.remote.JobRemoteService$1.run(JobRemoteService.java:60)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

[1] https://git.eclipse.org/c/mylyn/org.eclipse.mylyn.reviews.git/commit/?id=c603cfc349a6deed355ea6388166665d71c8fb96
Comment 1 Steffen Pingel CLA 2013-07-12 13:06:06 EDT
This doesn't surprise me considering that the model is accessed from a job. Miles, how was this "fixed" last time?
Comment 2 Miles Parker CLA 2013-07-15 12:57:50 EDT
Its not the same issue if you look at the stack trace. The other one was driven by a call to pull user. Really, we shouldn't need true remote acess at all. I'll take a look today.
Comment 3 Miles Parker CLA 2013-07-15 14:14:28 EDT
https://git.eclipse.org/r/#/c/14571/

Unfortunatly, I can't reproduce issue so I can't effectivly test, but this should do it. Tomek, can you verify that this addresses your issue?
Comment 4 Miles Parker CLA 2013-07-16 18:53:41 EDT
Ok, *that* wasn't the right way to solve it. See bug 413124. Back to the drawing board...
Comment 5 Miles Parker CLA 2013-07-16 19:19:36 EDT
https://git.eclipse.org/r/#/c/14605/

Everyone: Given prior issue (which wasn't easy to reproduce) we'll want to verify this one carefully. While it shouldn't carry any risk deadlock, because we're no longer adding the adapters synchronously, it's *possible* that we might introduce subtle updating issues with this change. I haven't seen anything, so just a note to be on the lookout for that.
Comment 6 Miles Parker CLA 2013-07-19 13:16:14 EDT
I've gone ahead and submitted this change. That will give us a chance to evaluate behaviour prior to 2.0.1 release. We can back this one out as well is we see issues, but I don't anticipate any problems.