Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2010-05-06 18:30:50 +0000
committerPascal Rapicault2010-05-06 18:30:50 +0000
commit7ddfcef6a0ef782025cb911bcc30779c2cb6d49e (patch)
treef9750e2c0d6a08ce41c03498f1fd89ab3f7bf934 /bundles/org.eclipse.equinox.p2.director/src
parent1c59094b726b72c83359a13d537a978e4b5a9a07 (diff)
downloadrt.equinox.p2-7ddfcef6a0ef782025cb911bcc30779c2cb6d49e.tar.gz
rt.equinox.p2-7ddfcef6a0ef782025cb911bcc30779c2cb6d49e.tar.xz
rt.equinox.p2-7ddfcef6a0ef782025cb911bcc30779c2cb6d49e.zip
Bug 311802 - UnsupportedOperationException trying to install
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.director/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java44
1 files changed, 39 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java
index 77cc6c1e4..719546c08 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java
@@ -49,6 +49,12 @@ public abstract class Explanation implements Comparable<Explanation> {
public String toString() {
return NLS.bind(Messages.Explanation_patchedHardDependency, new Object[] {patch, iu, req});
}
+
+ @Override
+ public int shortAnswer() {
+ return Explanation.VIOLATED_PATCHED_HARD_REQUIREMENT;
+ }
+
}
public static class HardRequirement extends Explanation {
@@ -74,6 +80,11 @@ public abstract class Explanation implements Comparable<Explanation> {
public String toString() {
return NLS.bind(Messages.Explanation_hardDependency, iu, req);
}
+
+ @Override
+ public int shortAnswer() {
+ return VIOLATED_HARD_REQUIREMENT;
+ }
}
public static class IUInstalled extends Explanation {
@@ -94,6 +105,11 @@ public abstract class Explanation implements Comparable<Explanation> {
public IStatus toStatus() {
return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Explanation_alreadyInstalled, getUserReadableName(iu)));
}
+
+ @Override
+ public int shortAnswer() {
+ return IU_INSTALLED;
+ }
}
public static class IUToInstall extends Explanation {
@@ -114,6 +130,11 @@ public abstract class Explanation implements Comparable<Explanation> {
public IStatus toStatus() {
return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Explanation_toInstall, getUserReadableName(iu)));
}
+
+ @Override
+ public int shortAnswer() {
+ return IU_TO_INSTALL;
+ }
}
public static class NotInstallableRoot extends Explanation {
@@ -134,6 +155,11 @@ public abstract class Explanation implements Comparable<Explanation> {
protected int orderValue() {
return 2;
}
+
+ @Override
+ public int shortAnswer() {
+ return NON_INSTALLABLE_ROOT;
+ }
}
public static class MissingIU extends Explanation {
@@ -228,8 +254,6 @@ public abstract class Explanation implements Comparable<Explanation> {
}
- public static final int MISSING_REQUIREMENT = 1;
-
public static final Explanation OPTIONAL_REQUIREMENT = new Explanation() {
public int orderValue() {
@@ -239,9 +263,21 @@ public abstract class Explanation implements Comparable<Explanation> {
public String toString() {
return Messages.Explanation_optionalDependency;
}
+
+ @Override
+ public int shortAnswer() {
+ return OTHER_REASON;
+ }
};
+ public static final int MISSING_REQUIREMENT = 1;
public static final int VIOLATED_SINGLETON_CONSTRAINT = 2;
+ 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;
protected Explanation() {
super();
@@ -256,9 +292,7 @@ public abstract class Explanation implements Comparable<Explanation> {
protected abstract int orderValue();
- public int shortAnswer() {
- throw new UnsupportedOperationException();
- }
+ abstract public int shortAnswer();
/**
* Returns a representation of this explanation as a status object.

Back to the top