Author: jonesde
Date: Wed Mar 7 16:56:54 2007 New Revision: 515870 URL: http://svn.apache.org/viewvc?view=rev&rev=515870 Log: Applied patch from Joe Eckard to fix error message list handling; small change to use FastList instead of LinkedList; Jira #OFBIZ-792 Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java?view=diff&rev=515870&r1=515869&r2=515870 ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java Wed Mar 7 16:56:54 2007 @@ -19,9 +19,10 @@ package org.ofbiz.minilang.method.conditional; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; +import javolution.util.FastList; + import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.string.FlexibleStringExpander; @@ -42,7 +43,7 @@ protected FlexibleStringExpander titleExdr; /** List of Conditional objects */ - protected List conditionalList = new LinkedList(); + protected List conditionalList = FastList.newInstance(); public Assert(Element element, SimpleMethod simpleMethod) { super(element, simpleMethod); @@ -60,6 +61,11 @@ public boolean exec(MethodContext methodContext) { List messages = (List) errorListAcsr.get(methodContext); + if (messages == null) { + messages = FastList.newInstance(); + errorListAcsr.put(methodContext, messages); + } + String title = this.titleExdr.expandString(methodContext.getEnvMap()); // check each conditional and if fails generate a message to add to the error list Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java?view=diff&rev=515870&r1=515869&r2=515870 ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java Wed Mar 7 16:56:54 2007 @@ -18,19 +18,17 @@ *******************************************************************************/ package org.ofbiz.minilang.method.entityops; -import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.List; -import javax.xml.parsers.ParserConfigurationException; +import javolution.util.FastList; import org.ofbiz.base.location.FlexibleLocation; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.GenericDelegator; -import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.util.EntityDataAssert; import org.ofbiz.entity.util.EntitySaxReader; import org.ofbiz.minilang.SimpleMethod; @@ -38,7 +36,6 @@ import org.ofbiz.minilang.method.MethodContext; import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; -import org.xml.sax.SAXException; /** * Uses the delegator to find entity values by a primary key @@ -68,6 +65,11 @@ public boolean exec(MethodContext methodContext) { List messages = (List) errorListAcsr.get(methodContext); + if (messages == null) { + messages = FastList.newInstance(); + errorListAcsr.put(methodContext, messages); + } + String location = this.locationExdr.expandString(methodContext.getEnvMap()); String delegatorName = this.delegatorNameExdr.expandString(methodContext.getEnvMap()); |
Free forum by Nabble | Edit this page |