Community
Participate
Working Groups
Using the AdminUI if I install an SDK into a profile and then try to install org.apache.commons.httpclient I'm getting the following stack trace: java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.set(ArrayList.java:339) at org.eclipse.equinox.internal.p2.director.SimplePlanner.sortOperations(SimplePlanner.java:90) at org.eclipse.equinox.internal.p2.director.SimplePlanner.generateOperations(SimplePlanner.java:78) at org.eclipse.equinox.internal.p2.director.SimplePlanner.getInstallPlan(SimplePlanner.java:67) at org.eclipse.equinox.p2.ui.operations.ProvisioningUtil.getInstallPlan(ProvisioningUtil.java:171) at org.eclipse.equinox.p2.ui.actions.InstallAction.validateOperation(InstallAction.java:71) at org.eclipse.equinox.internal.p2.ui.actions.ProfileModificationAction$1.run(ProfileModificationAction.java:65) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119) To install the SDK I'm using a local metadata repo generated from 3.4M4. To install org.apache.commons.httpclient I'm using an updatesite repo for test updates e.g. http://download.eclipse.org/eclipse/testUpdates/site.xml
Looking at the operands in "toSort" of SimplePlanner.sortOperations, I'm seeing: 1) install org.apache.commons.httpclient 2) uninstall org.eclipse.equinox.p2.core 3) uninstall org.eclipse.equinox.p2.metadata.generator (1) looks right but (2) and (3) don't. The profile contains just the SDK and does not have either p2 bundles in it so I'm a bit baffled.
I'll take ownership of that if you don't mind.
Great. One thing to add is that the p2 bundles are getting brought in because the pde.build bundle on testUpdates has a dependency on the generator but doesn't in M4. In other words, we're not just adding httpclient but also inadvertently updating at the same time. It's still a problem, it's just that there are more moving parts here than I had originally thought.
From bug 255340: ARRAY INDEX OUT OF BOUNDS EXCEPTION ----------------------------------- Next, I try to uninstall the Device Kit Core Feature because I would like to try to installing both features at the same time, but the uninstall does not work either. !ENTRY org.eclipse.equinox.p2.ui 4 0 2008-04-01 14:29:57.031 !MESSAGE Unexpected error encountered while preparing for the operation. !STACK 0 java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.set(Unknown Source) at org.eclipse.equinox.internal.p2.director.SimplePlanner.sortOperations(SimplePlanner.java:122) at org.eclipse.equinox.internal.p2.director.SimplePlanner.generateOperations(SimplePlanner.java:110) at org.eclipse.equinox.internal.p2.director.SimplePlanner.generateProvisioningPlan(SimplePlanner.java:48) at org.eclipse.equinox.internal.p2.director.SimplePlanner.getProvisioningPlan(SimplePlanner.java:367) at org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil.getProvisioningPlan(ProvisioningUtil.java:174) at org.eclipse.equinox.internal.provisional.p2.ui.actions.UninstallAction.getProvisioningPlan(UninstallAction.java:82) at org.eclipse.equinox.internal.provisional.p2.ui.actions.ProfileModificationAction$1.run(ProfileModificationAction.java:61) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
The problem stems from the resolution procedure used when we are attaching the CUs to not return the same result than what we get from the sat4j resolver. Then after that all the bets are off. Another thing I'm wondering is whether or not we can avoid the sorting. The ideal solution here may be to hook into sat4j to get the attachment information.
*** Bug 226092 has been marked as a duplicate of this bug. ***
I can verify that this is a problem when i try to remove Web Standard Tools from the list of installed Features: Eclipse C/C++ Development Tools Eclipse SDK Web Standard Tools (WST) Project The error appears as in comment #4.
We have re-written this method to read as follows. I'm not sure if it just hides the real bug, but it does alleviate the AIOOBException problem. private InstallableUnitOperand[] sortOperations(InstallableUnitOperand[] toSort, List installOrder, List uninstallOrder) { List sorted = new ArrayList(toSort.length); for (Iterator i = installOrder.iterator(); i.hasNext();) { IInstallableUnit iu = (IInstallableUnit) i.next(); for (int j = 0; j < toSort.length; j++) { InstallableUnitOperand operand = toSort[j]; if (operand.first() == null && iu.equals(operand.second())) { sorted.add(operand); break; } } } for (Iterator i = uninstallOrder.iterator(); i.hasNext();) { IInstallableUnit iu = (IInstallableUnit) i.next(); for (int j = 0; j < toSort.length; j++) { InstallableUnitOperand operand = toSort[j]; if (operand.second() == null && iu.equals(operand.first())) { sorted.add(operand); break; } } } for (int i = 0; i < toSort.length; i++) { InstallableUnitOperand operand = toSort[i]; if (operand.first() != null && operand.second() != null) { sorted.add(operand); } } return (InstallableUnitOperand[]) sorted.toArray(new InstallableUnitOperand[sorted.size()]); }
*** Bug 226543 has been marked as a duplicate of this bug. ***
New code from Jed released for the I-build.
*** Bug 226971 has been marked as a duplicate of this bug. ***
*** Bug 236595 has been marked as a duplicate of this bug. ***