Community
Participate
Working Groups
Build ID: I20100504-0800 (win32) OS: Windows Server 2008 Sun 1.6 JDK for Windows I tried to install all features in a Linux Tools drop [1] which has os=linux filters in some of the features. I got an error dialogue with "java.lang.UnsupportedOperationException" and no details when I click "<< Details". The stack trace is: !ENTRY org.eclipse.equinox.p2.ui 4 0 2010-05-05 21:33:09.063 !MESSAGE !STACK 0 java.lang.UnsupportedOperationException at org.eclipse.equinox.internal.p2.director.Explanation.shortAnswer(Explanation.java:260) at org.eclipse.equinox.internal.provisional.p2.director.RequestStatus.getShortExplanation (RequestStatus.java:81) at org.eclipse.equinox.p2.operations.InstallOperation.missingRequirement (InstallOperation.java:174) at org.eclipse.equinox.p2.operations.InstallOperation.access$0(InstallOperation.java:169) at org.eclipse.equinox.p2.operations.InstallOperation$1.getSecondPassProvisioningContext(InstallOperation.java:161) at org.eclipse.equinox.internal.p2.operations.PlannerResolutionJob.runModal(PlannerResolutionJob.java:90) at org.eclipse.equinox.p2.operations.ProfileChangeOperation.resolveModal(ProfileChangeOperation.java:115) at org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard$1.run(ProvisioningOperationWizard.java:206) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) [1] https://build.eclipse.org/hudson/job/cbi-linuxtools-Helios/158/artifact/build/I201005041513/linuxtools-Update-I201005041513.zip
*** Bug 311804 has been marked as a duplicate of this bug. ***
I will check what can be done here.
Created attachment 167272 [details] Provides a short answer for all explanations Here is a fix for that bug. The default behavior of Explanation.shortAnswer() was to throw an UnsupportedOperationException. because only missing requirements and singleton violations could be the cause of a resolving error. We added several explanations recently without providing a specific short answer, including the NonInstallableRoot explanation. I propose to force all explanations to return a specific short answer by making shortAnswer() abstract in Explanation and creating new constants: public static final int MISSING_REQUIREMENT = 1; // EXISTING public static final int VIOLATED_SINGLETON_CONSTRAINT = 2; // EXISTING public static final int IU_INSTALLED = 3; public static final int IU_TO_INSTALL = 4; public static final int VIOLATED_HARD_REQUIREMENT = 5; public static final int VIOLATED_PATCHED_HARD_REQUIREMENT = 6; public static final int NON_INSTALLABLE_ROOT = 7; public static final int OTHER_REASON = 100; Those constants are currently in Explanation, but they should likely move as an enum for instance outside that class.
Patch reviewed and released