Bug 115359 - ArrayStoreException during feature install
Summary: ArrayStoreException during feature install
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 blocker (vote)
Target Milestone: 3.1.2   Edit
Assignee: Platform-Update-Inbox CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
: 129372 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-07 13:11 EST by Doug MacDonald CLA Friend
Modified: 2006-04-24 23:40 EDT (History)
6 users (show)

See Also:


Attachments
debug screen shot (1.40 MB, image/bmp)
2005-11-07 13:17 EST, Doug MacDonald CLA Friend
no flags Details
patch for Feature (681 bytes, patch)
2005-11-07 13:51 EST, Branko Tripkovic CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Doug MacDonald CLA Friend 2005-11-07 13:11:02 EST
I have a feature that includes a linux, win32, nl1, and nl2 child features 
(listed in that order). When installing the feature on a win32 platform, an 
ArrayStoreException (see trace below) is thrown which causes the feature to be 
disabled.

java.lang.ArrayStoreException
	at java.util.ArrayList.toArray(ArrayList.java:337)
	at org.eclipse.update.core.Feature.getRawIncludedFeatureReferences
(Feature.java:631)
	at org.eclipse.update.core.Feature.getIncludedFeatureReferences
(Feature.java:1039)
	at org.eclipse.update.internal.core.ConfiguredSite.configure
(ConfiguredSite.java:247)
	at org.eclipse.update.internal.core.ConfiguredSite.install
(ConfiguredSite.java:157)
	at org.eclipse.update.internal.core.ConfiguredSite.install
(ConfiguredSite.java:86)
	at org.eclipse.update.internal.operations.InstallOperation.execute
(InstallOperation.java:72)
	at com.ibm.rcp.update.UpdateChecker.doInstallOperation
(UpdateChecker.java:1155)
	at com.ibm.rcp.update.UpdateChecker.doDiscreteInstallOperations
(UpdateChecker.java:1094)
	at com.ibm.rcp.update.UpdateChecker.updateSilently
(UpdateChecker.java:1045)
	at com.ibm.rcp.update.UpdateChecker.doCheck(UpdateChecker.java:785)
	at com.ibm.rcp.update.UpdateManager.doUpdate(UpdateManager.java:251)
	at 
com.ibm.rcp.update.UpdateManagerProvider$UpdateProvisioningOperation.launchUpda
teManager(UpdateManagerProvider.java:107)
	at 
com.ibm.rcp.update.UpdateManagerProvider$UpdateProvisioningOperation.run
(UpdateManagerProvider.java:60)
	at com.ibm.rcp.pagebuilder.requirements.DefaultFeatureHandler.run
(DefaultFeatureHandler.java:231)
	at 
com.ibm.rcp.pagebuilder.requirements.PageRequirementsManager$RequirementsOperat
ion.run(PageRequirementsManager.java:315)
	at 
com.ibm.rcp.install.personality.InstallProvisioningPage$CDInstallTask.run
(InstallProvisioningPage.java:329)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:113)

This is caused by the following:
The TargetFeature's included feature refs list contains the following: 
UpdateSiteIncludedFeatureReference (linux feature), IncludedFeatureReference 
(win32 feature), UpdateSiteIncludedFeatureReference (nl1 feature), 
UpdateSiteIncludedFeatureReference (nl2 feature) (in that order). When 
Feature.getRawIncludedFeatureReferences is called, it tries to create an array 
of type UpdateSiteIncludedFeatureReference (first listed feature reference) 
and fails because the second listed feature reference is an 
IncludedFeatureReference.

Note that if the win32 child feature was listed first and you installed on 
win32, then the array would be an IncludedFeatureReference array and we would 
not have any problems.

I'll attach a screen shot of my debug env.
Comment 1 Doug MacDonald CLA Friend 2005-11-07 13:17:57 EST
Created attachment 29451 [details]
debug screen shot
Comment 2 Branko Tripkovic CLA Friend 2005-11-07 13:51:18 EST
Created attachment 29456 [details]
patch for Feature

Doug,
I created this patch that I believe will solve your problem. To try it out get
update core source from eclipse CVS and apply this patch to
src/org/eclipse/update/core/Feature.java. If you don't have time for this it
should be in the next nightly build.
Comment 3 Mike Wilson CLA Friend 2005-12-07 11:20:23 EST
Can we backport this fix to the 3.1.x stream?
Comment 4 Dejan Glozic CLA Friend 2005-12-15 11:12:17 EST
Seems simple enough - I think we can.
Comment 5 Dejan Glozic CLA Friend 2005-12-15 15:29:34 EST
Fixed in HEAD and backported to 3.1.2. 
Comment 6 Dejan Glozic CLA Friend 2006-04-24 23:40:26 EDT
*** Bug 129372 has been marked as a duplicate of this bug. ***