]> 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 5b28534ba43063ceedf61849c9a1f836ecc5ef17..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
@@ -86,7 +102,6 @@ public class ExecutionParameterPostProcessor extends
                                        placeholder).toString();\r
 \r
                else {// execution\r
-                       log.debug("Bean class: " + bean.getClass());\r
                        // next call fail if no execution context available\r
                        Object obj = executionContext.getVariable(placeholder);\r
                        if (obj != null) {\r
@@ -104,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
@@ -159,13 +178,17 @@ public class ExecutionParameterPostProcessor extends
                        }\r
                        return entriesModified ? newContent : value;\r
                } else {\r
-                       //log.debug(beanName + ": " + value.getClass() + " : " + value);\r
+                       // log.debug(beanName + ": " + value.getClass() + " : " + value);\r
                        return value;\r
                }\r
 \r
        }\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
@@ -205,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