Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2013-01-20 20:27:58 -0500
committerPascal Rapicault2013-01-20 20:32:57 -0500
commitd81a08fef5a310b3ef4fedb8ab625972b0c18b58 (patch)
treeafac84802cf81ad215afbabbc339256e51101c95 /bundles/org.eclipse.equinox.p2.engine/src
parent91c54478e49e4764e02f677c1b1bc6e6ce09b265 (diff)
downloadrt.equinox.p2-d81a08fef5a310b3ef4fedb8ab625972b0c18b58.tar.gz
rt.equinox.p2-d81a08fef5a310b3ef4fedb8ab625972b0c18b58.tar.xz
rt.equinox.p2-d81a08fef5a310b3ef4fedb8ab625972b0c18b58.zip
Null handling in the return valuev20130121-013257
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.engine/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java7
2 files changed, 9 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java
index eed4c31cf..2ab439531 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java
@@ -75,13 +75,14 @@ public class ParameterizedProvisioningAction extends ProvisioningAction {
actualParameters.put(variableName, value);
if (value instanceof Value) {
- if (allowInfixReplacement == false && variableBeginIndex == 0 && variableEndIndex == parameterValue.length() - 1)
- return value;
+ if (allowInfixReplacement == false && variableBeginIndex == 0 && variableEndIndex == parameterValue.length() - 1) {
+ return ((Value<?>) value).getValue();
+ }
Value<?> result = (Value<?>) value;
- if (result.getClazz() == String.class)
+ if (result.getClazz() == String.class) {
value = result.getValue();
- else
+ } else
throw new RuntimeException("The type of the variable is expected to be a String"); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java
index ccc05effb..a981318e9 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java
@@ -17,7 +17,8 @@ import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
-import org.eclipse.equinox.p2.engine.spi.*;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
+import org.eclipse.equinox.p2.engine.spi.Touchpoint;
import org.eclipse.osgi.util.NLS;
public abstract class Phase {
@@ -170,7 +171,7 @@ public abstract class Phase {
parameters = touchpointToTouchpointOperandParameters.get(touchpoint);
}
- if (lastResult != null && lastResult != Value.NO_VALUE) {
+ if (lastResult != null) {
parameters = new HashMap<String, Object>(parameters);
parameters.put(LAST_RESULT_INTERNAL_NAME, lastResult);
}
@@ -180,7 +181,7 @@ public abstract class Phase {
try {
session.recordActionExecute(action, parameters);
actionStatus = action.execute(parameters);
- lastResult = action.getResult().getValue();
+ lastResult = action.getResult();
} catch (RuntimeException e) {
if (!forced)
throw e;

Back to the top