Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 264845 - [Contributions] WorkbenchServiceRegistry fails with ArrayStoreException
Summary: [Contributions] WorkbenchServiceRegistry fails with ArrayStoreException
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Prakash Rangaraj CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-13 09:14 EST by Matthias Kempka CLA
Modified: 2009-06-03 13:48 EDT (History)
3 users (show)

See Also:


Attachments
Patch v01 (5.47 KB, patch)
2009-02-16 23:58 EST, Prakash Rangaraj CLA
no flags Details | Diff
Patch v02 (2.15 KB, patch)
2009-02-24 03:24 EST, Prakash Rangaraj CLA
pwebster: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Kempka CLA 2009-02-13 09:14:51 EST
Build ID: 1.2.0.20081221-2301


I'm starting a RAP application and receive an ArrayStoreException almost immediately (see below). Likely this is due to some extension that does not provide a class with the correct type. IMHO this case should be checked and ignored (or failed upon) with a log entry that enables the client to find out what he is doing wrong.

java.lang.ArrayStoreException
	at java.lang.System.arraycopy(Native Method)
	at java.util.ArrayList.toArray(ArrayList.java:304)
	at org.eclipse.ui.internal.services.WorkbenchServiceRegistry.getSourceProviders(WorkbenchServiceRegistry.java:140)
	at org.eclipse.ui.internal.services.SourceProviderService.readRegistry(SourceProviderService.java:104)
	at org.eclipse.ui.internal.Workbench$38.runWithException(Workbench.java:1598)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:32)
	at org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync(UICallBackManager.java:135)
	at org.eclipse.swt.widgets.Display$2.run(Display.java:652)
	at org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler.runNonUIThreadWithFakeContext(UICallBackServiceHandler.java:457)
	at org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeContext(UICallBack.java:44)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:650)
	at org.eclipse.ui.internal.StartupThreading.runWithoutExceptions(StartupThreading.java:110)
	at org.eclipse.ui.internal.Workbench.initializeDefaultServices(Workbench.java:1594)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:1294)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2309)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2200)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:425)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:333)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:408)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at com.yoxos.server.build.rap.BuildWorkbench.createUI(BuildWorkbench.java:17)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:228)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:116)
	at java.lang.Thread.run(Thread.java:613)
Comment 1 Benjamin Muskalla CLA 2009-02-13 10:17:47 EST
Any steps to reproduce?
Comment 2 Benjamin Muskalla CLA 2009-02-14 19:00:59 EST
I don't think we can do anything about this - this is the original workbench code.
Moving to Platform/UI.
Comment 3 Matthias Kempka CLA 2009-02-16 06:00:19 EST
The reason for this error was:
I had both the rap workbench plug-in and the rcp workbench plug-in in my target platform, and they both provided a CurrentSelectionSourceProvider. Only their super classes where not the same.
Obviously this is a problem on my side, but tracking it down would have gone a lot faster with a type check + error message in a way like this:

"Plug-in \"org.eclipse.ui.workbench\" provided class \"CurrentSelectionSourceProvider\" which is not a subclass of \"AbstractSourceProvider\""
Comment 4 Prakash Rangaraj CLA 2009-02-16 23:58:48 EST
Created attachment 125850 [details]
Patch v01

Patch to do the check and log if the class is of wrong type
Comment 5 Paul Webster CLA 2009-02-23 12:53:34 EST
Prakash, we don't want to widen the scope of the extension point.  I think we should add logging in getSourceProviders() around where we do createExecutableExtension(*) so that we can log the incorrect class and throw it away.

PW
Comment 6 Prakash Rangaraj CLA 2009-02-24 03:24:51 EST
Created attachment 126524 [details]
Patch v02

(In reply to comment #5)
> Prakash, we don't want to widen the scope of the extension point.  I think we
> should add logging in getSourceProviders() around where we do
> createExecutableExtension(*) so that we can log the incorrect class and throw
> it away.

    Done that way
Comment 7 Paul Webster CLA 2009-02-25 09:30:26 EST
(In reply to comment #6)
> Created an attachment (id=126524) [details]
> Patch v02

Released to HEAD >20090225

Thanx, Prakash.

PW
Comment 8 Prakash Rangaraj CLA 2009-03-11 02:24:40 EDT
Verified in I20090310-0100