From: Mathieu Baudier Date: Thu, 9 Jul 2009 19:22:55 +0000 (+0000) Subject: Workaround to issue with inner beans / frozen parameters X-Git-Tag: argeo-slc-2.1.7~1668 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=9f0c9b3c49a556b671e6b1b6d88cf83357d1f028;p=gpl%2Fargeo-slc.git Workaround to issue with inner beans / frozen parameters git-svn-id: https://svn.argeo.org/slc/trunk@2717 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java index 8f13609dc..d8429d192 100644 --- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java +++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java @@ -27,6 +27,9 @@ public class DefaultExecutionFlowDescriptorConverter implements ExecutionFlowDescriptorConverter, ApplicationContextAware { public final static String REF_VALUE_TYPE_BEAN_NAME = "beanName"; + /** Workaround for https://www.spartadn.com/bugzilla/show_bug.cgi?id=206 */ + private final static String REF_VALUE_IS_FROZEN = "__frozen"; + private final static Log log = LogFactory .getLog(DefaultExecutionFlowDescriptorConverter.class); @@ -38,7 +41,13 @@ public class DefaultExecutionFlowDescriptorConverter implements Map convertedValues = new HashMap(); if (values != null) { - for (String key : values.keySet()) { + values: for (String key : values.keySet()) { + ExecutionSpecAttribute attribute = executionFlowDescriptor + .getExecutionSpec().getAttributes().get(key); + + if (attribute.getIsFrozen()) + continue values; + Object value = values.get(key); if (value instanceof PrimitiveValue) { PrimitiveValue primitiveValue = (PrimitiveValue) value; @@ -77,7 +86,7 @@ public class DefaultExecutionFlowDescriptorConverter implements Assert.notNull(executionSpec.getName()); Map values = new TreeMap(); - for (String key : executionSpec.getAttributes().keySet()) { + attrs: for (String key : executionSpec.getAttributes().keySet()) { ExecutionSpecAttribute attribute = executionSpec .getAttributes().get(key); @@ -95,8 +104,12 @@ public class DefaultExecutionFlowDescriptorConverter implements // all necessary information is in the spec } } else if (attribute instanceof RefSpecAttribute) { - values.put(key, buildRefValue((RefSpecAttribute) attribute, - executionFlow, key)); + if (attribute.getIsFrozen()) { + values.put(key, new RefValue(REF_VALUE_IS_FROZEN)); + } else + values.put(key, buildRefValue( + (RefSpecAttribute) attribute, executionFlow, + key)); } else { throw new SlcException("Unkown spec attribute type " + attribute.getClass());