Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2019-01-29 05:10:59 -0500
committerMarvin Mueller2019-01-29 05:10:59 -0500
commite098048e2130a2ef8d95518c27e9fd7908c0d930 (patch)
treefab45c8d11adcd58210a659cf4975aca56f31282
parent2e909fb51a0701b36e1ef63aa0b01e2dac4b2ff5 (diff)
downloadorg.eclipse.jubula.core-e098048e2130a2ef8d95518c27e9fd7908c0d930.tar.gz
org.eclipse.jubula.core-e098048e2130a2ef8d95518c27e9fd7908c0d930.tar.xz
org.eclipse.jubula.core-e098048e2130a2ef8d95518c27e9fd7908c0d930.zip
Fix for Bug 543923
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/ModelParamValueConverter.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/ModelParamValueConverter.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/ModelParamValueConverter.java
index c67d685d1..41bc72be2 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/ModelParamValueConverter.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/ModelParamValueConverter.java
@@ -94,6 +94,13 @@ public class ModelParamValueConverter extends ParamValueConverter {
String refGuid =
RefToken.extractCore(refToken.getModelString());
if (refGuid.equals(guid)) {
+ List<IParamValueToken> tokens = getTokens();
+ for (IParamValueToken iParamValueToken : tokensCopy) {
+ if (iParamValueToken instanceof FunctionToken) {
+ removeTokenFromFunction(
+ (FunctionToken) iParamValueToken, token);
+ }
+ }
getTokens().remove(token);
isRefRemoved = true;
}
@@ -108,6 +115,29 @@ public class ModelParamValueConverter extends ParamValueConverter {
/**
+ * recursive going through the functions and deleting all nested tokens
+ * @param ftoken the function token
+ * @param tokenToDelete the token which should be removed
+ */
+ private void removeTokenFromFunction(FunctionToken ftoken,
+ IParamValueToken tokenToDelete) {
+ IParamValueToken[] nestedTokens = ftoken.getNestedTokens();
+ for (int i = 0; i < nestedTokens.length; i++) {
+ IParamValueToken valueToken = nestedTokens[i];
+ if (valueToken instanceof FunctionToken) {
+ removeTokenFromFunction((FunctionToken) valueToken,
+ tokenToDelete);
+ }
+ if (valueToken.equals(tokenToDelete)) {
+ nestedTokens[i] = new SimpleValueToken("DELETED", i, //$NON-NLS-1$
+ ftoken.getParamDescription());
+ }
+
+ }
+
+ }
+
+ /**
* replaces an old guid with a new guid in all available RefTokens, which
* contain a modelstring containing the given old guid
* @param map key: old Guid, value: new Guid

Back to the top