summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2013-01-20 21:18:25 (EST)
committerPascal Rapicault2013-01-20 21:18:25 (EST)
commitf3c8538ab4bda75b610b2537288a2a4bddb5ed07 (patch)
tree21ad7f9aa8ff331417c363999ff488eae32d1d69
parent02137aec58e3f298dd6ccbc7dacf369f3a80e4ed (diff)
downloadrt.equinox.p2-f3c8538ab4bda75b610b2537288a2a4bddb5ed07.zip
rt.equinox.p2-f3c8538ab4bda75b610b2537288a2a4bddb5ed07.tar.gz
rt.equinox.p2-f3c8538ab4bda75b610b2537288a2a4bddb5ed07.tar.bz2
Revert "Null handling in the return value"
-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
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/plugin.xml16
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java2
4 files changed, 7 insertions, 27 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 2ab4395..eed4c31 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,14 +75,13 @@ public class ParameterizedProvisioningAction extends ProvisioningAction {
actualParameters.put(variableName, value);
if (value instanceof Value) {
- if (allowInfixReplacement == false && variableBeginIndex == 0 && variableEndIndex == parameterValue.length() - 1) {
- return ((Value<?>) value).getValue();
- }
+ if (allowInfixReplacement == false && variableBeginIndex == 0 && variableEndIndex == parameterValue.length() - 1)
+ return value;
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 a981318..ccc05ef 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,8 +17,7 @@ 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.ProvisioningAction;
-import org.eclipse.equinox.p2.engine.spi.Touchpoint;
+import org.eclipse.equinox.p2.engine.spi.*;
import org.eclipse.osgi.util.NLS;
public abstract class Phase {
@@ -171,7 +170,7 @@ public abstract class Phase {
parameters = touchpointToTouchpointOperandParameters.get(touchpoint);
}
- if (lastResult != null) {
+ if (lastResult != null && lastResult != Value.NO_VALUE) {
parameters = new HashMap<String, Object>(parameters);
parameters.put(LAST_RESULT_INTERNAL_NAME, lastResult);
}
@@ -181,7 +180,7 @@ public abstract class Phase {
try {
session.recordActionExecute(action, parameters);
actionStatus = action.execute(parameters);
- lastResult = action.getResult();
+ lastResult = action.getResult().getValue();
} catch (RuntimeException e) {
if (!forced)
throw e;
diff --git a/bundles/org.eclipse.equinox.p2.tests/plugin.xml b/bundles/org.eclipse.equinox.p2.tests/plugin.xml
index 70f56fb..cec9954 100644
--- a/bundles/org.eclipse.equinox.p2.tests/plugin.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/plugin.xml
@@ -53,22 +53,6 @@
version="1.0.0">
</action>
</extension>
- <extension
- point="org.eclipse.equinox.p2.engine.actions">
- <action
- class="org.eclipse.equinox.p2.tests.engine.VariableTest2$Action"
- name="test.actionForVariableTesting2"
- version="1.0.0">
- </action>
- </extension>
- <extension
- point="org.eclipse.equinox.p2.engine.actions">
- <action
- class="org.eclipse.equinox.p2.tests.engine.VariableTest3$Action"
- name="test.actionForVariableTesting3"
- version="1.0.0">
- </action>
- </extension>
<extension
point="org.eclipse.equinox.p2.engine.actions">
<action
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java
index 1248def..c420ed9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java
@@ -38,8 +38,6 @@ public class AllTests extends TestCase {
suite.addTestSuite(TouchpointTest.class);
suite.addTestSuite(ProvisioningEventTest.class);
suite.addTestSuite(VariableTest.class);
- suite.addTestSuite(VariableTest2.class);
- suite.addTestSuite(VariableTest3.class);
return suite;
}