Author: adrianc Date: Mon Jul 8 16:30:31 2013 New Revision: 1500824 URL: http://svn.apache.org/r1500824 Log: Merged revision(s) 1500772 from ofbiz/trunk:
Removed support for runtime nested expressions in FlexibleStringExpander.java. Modified: ofbiz/branches/release12.04/ (props changed) ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/test/FlexibleStringExpanderTests.java Propchange: ofbiz/branches/release12.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1500772 Modified: ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java?rev=1500824&r1=1500823&r2=1500824&view=diff ============================================================================== --- ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java (original) +++ ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java Mon Jul 8 16:30:31 2013 @@ -724,19 +724,6 @@ public abstract class FlexibleStringExpa } catch (Exception e) { Debug.logError("Error evaluating expression " + this + ": " + e, module); } - if (obj != null) { - try { - // Check for runtime nesting - String str = (String) obj; - if (str.contains(openBracket)) { - FlexibleStringExpander fse = FlexibleStringExpander.getInstance(str); - if (containsScript(fse)) { - throw new UnsupportedOperationException("Nested scripts are not supported"); - } - return fse.get(context, timeZone, locale); - } - } catch (ClassCastException e) {} - } return obj; } } Modified: ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/test/FlexibleStringExpanderTests.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/test/FlexibleStringExpanderTests.java?rev=1500824&r1=1500823&r2=1500824&view=diff ============================================================================== --- ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/test/FlexibleStringExpanderTests.java (original) +++ ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/string/test/FlexibleStringExpanderTests.java Mon Jul 8 16:30:31 2013 @@ -286,16 +286,6 @@ public class FlexibleStringExpanderTests List<String> testList = new ArrayList<String>(); testList.add("World"); testMap.put("testList", testList); - testMap.put("testScript", "${groovy:return null;}"); - UnsupportedOperationException caught = null; - try { - FlexibleStringExpander fse = FlexibleStringExpander.getInstance("${testScript}"); - fse.expandString(testMap); - } catch (UnsupportedOperationException e) { - caught = e; - } finally { - assertNotNull("UnsupportedOperationException thrown for nested script", caught); - } fseTest("null FlexibleStringExpander, null map", null, null, null, null, "", null, true); fseTest("null FlexibleStringExpander", null, testMap, null, null, "", null, true); fseTest("null context", "Hello World!", null, null, null, "Hello World!", null, false); @@ -305,9 +295,6 @@ public class FlexibleStringExpanderTests fseTest("empty FlexibleStringExpander", "", testMap, null, null, "", null, true); fseTest("UEL integration(nested): throw Exception", "${${throwException.value}}", testMap, "", false); fseTest("UEL integration: throw Exception", "${throwException.value}", testMap, null, null, "", null, false); - fseTest("hidden (runtime) nested replacement", "${nested}!", testMap, "Hello World!", false); - fseTest("hidden (runtime) nested null replacement", "Hello ${${nullVar}}World!", testMap, "Hello World!", false); - fseTest("hidden (runtime) nested null callreplacement", "Hello ${${groovy:" + FlexibleStringExpanderTests.class.getName() + ".StaticReturnNull()}}World!", testMap, "Hello World!", false); fseTest("UEL integration(nested): throw Exception", "${throw${exc}.value}", testMap, "", false); fseTest("UEL integration(nested): throw NPE", "${throwNPE${blank}.value}", testMap, "", false); fseTest("visible nested replacement", "${'Hello ${var}'}!", testMap, "Hello World!", false);