Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-11-16 11:30:24 -0500
committerAlexander Kurtakov2018-03-09 09:11:34 -0500
commitac7a5b7a66b44e27bcc9a9b0d5db3a3fd76e496f (patch)
tree59f17a7a2c33a4253eb108c4034a7ca0ddd9cd91 /bundles
parent24340160c151ff44879ba7e15993493b7df8309a (diff)
downloadrt.equinox.p2-ac7a5b7a66b44e27bcc9a9b0d5db3a3fd76e496f.tar.gz
rt.equinox.p2-ac7a5b7a66b44e27bcc9a9b0d5db3a3fd76e496f.tar.xz
rt.equinox.p2-ac7a5b7a66b44e27bcc9a9b0d5db3a3fd76e496f.zip
Bug 448789 - Improved error logging for remediationOperation null ref
Avoids the NPE as reported in the bug and logs the situation. Change-Id: I4ea13466ec7c764b6d75c9b28c0cba57fc75c301 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java
index 1288341c1..4bc34eff6 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java
@@ -7,11 +7,13 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
+ * Karsten Thoms, itemis - Bug#448789
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.dialogs;
import java.util.*;
import java.util.List;
+import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.ui.*;
import org.eclipse.equinox.internal.p2.ui.model.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
@@ -364,6 +366,7 @@ public class RemediationGroup {
}
public void update(RemediationOperation operation) {
+ Assert.isNotNull(operation, "operation"); //$NON-NLS-1$
this.remediationOperation = operation;
currentRemedy = searchBestDefaultRemedy();
@@ -394,8 +397,11 @@ public class RemediationGroup {
}
Remedy searchRemedyMatchingUserChoices() {
- List<Remedy> remedies = remediationOperation.getRemedies();
- for (Remedy remedy : remedies) {
+ if (remediationOperation == null) {
+ ProvUIActivator.getDefault().getLog().log(new Status(IStatus.ERROR, ProvUIActivator.getContext().getBundle().getSymbolicName(), "RemediationOperation was not initialized yet.")); //$NON-NLS-1$
+ return null;
+ }
+ for (Remedy remedy : remediationOperation.getRemedies()) {
if (isContraintOK(ALLOWPARTIALINSTALL_INDEX, remedy.getConfig().allowPartialInstall) && isContraintOK(ALLOWDIFFERENTVERSION_INDEX, remedy.getConfig().allowDifferentVersion) && isContraintOK(ALLOWINSTALLEDUPDATE_INDEX, remedy.getConfig().allowInstalledUpdate) && isContraintOK(ALLOWINSTALLEDREMOVAL_INDEX, remedy.getConfig().allowInstalledRemoval)) {
if (remedy.getRequest() != null) {
return remedy;

Back to the top