]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionParameterPostProcessor.java
Reduce log verbosity
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / ExecutionParameterPostProcessor.java
index e56bfd388fd2cb76f7a05f4db53572e4acda01da..2ba426e13ebd1fe0f411378c9a2941af5611cf1c 100644 (file)
@@ -1,3 +1,19 @@
+/*\r
+ * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
 package org.argeo.slc.core.execution;\r
 \r
 import java.beans.PropertyDescriptor;\r
@@ -103,11 +119,15 @@ public class ExecutionParameterPostProcessor extends
                        String originalValue = tsv.getValue();\r
 \r
                        String convertedValue = resolveString(beanName, bean, originalValue);\r
+                       if (convertedValue == null)\r
+                               return null;\r
                        return convertedValue.equals(originalValue) ? value\r
                                        : new TypedStringValue(convertedValue);\r
                } else if (value instanceof String) {\r
                        String originalValue = value.toString();\r
                        String convertedValue = resolveString(beanName, bean, originalValue);\r
+                       if (convertedValue == null)\r
+                               return null;\r
                        return convertedValue.equals(originalValue) ? value\r
                                        : convertedValue;\r
                } else if (value instanceof ManagedMap) {\r
@@ -165,6 +185,10 @@ public class ExecutionParameterPostProcessor extends
        }\r
 \r
        private String resolveString(String beanName, Object bean, String strVal) {\r
+               // in case <null/> is passed\r
+               if (strVal == null)\r
+                       return null;\r
+\r
                String value = parseStringValue(bean, strVal, new HashSet<String>());\r
 \r
                if (value == null)\r
@@ -204,6 +228,10 @@ public class ExecutionParameterPostProcessor extends
                        Set<String> visitedPlaceholders)\r
                        throws BeanDefinitionStoreException {\r
 \r
+               // in case <null/> is passed\r
+               if (strVal == null)\r
+                       return null;\r
+\r
                StringBuffer buf = new StringBuffer(strVal);\r
 \r
                int startIndex = strVal.indexOf(placeholderPrefix);\r