Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java?rev=1635878&r1=1635877&r2=1635878&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java Fri Oct 31 23:13:03 2014 @@ -20,8 +20,10 @@ package org.ofbiz.widget.tree; import java.io.IOException; import java.io.StringWriter; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Map; @@ -29,9 +31,6 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.xml.parsers.ParserConfigurationException; -import javolution.util.FastList; -import javolution.util.FastMap; - import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.StringUtil; @@ -43,11 +42,6 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.MapStack; import org.ofbiz.base.util.string.FlexibleStringExpander; -import org.ofbiz.widget.WidgetWorker; -import org.ofbiz.widget.screen.ModelScreen; -import org.ofbiz.widget.screen.ScreenFactory; -import org.ofbiz.widget.screen.ScreenStringRenderer; -import org.ofbiz.widget.screen.ScreenRenderException; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -56,6 +50,11 @@ import org.ofbiz.entity.model.ModelField import org.ofbiz.entity.util.EntityListIterator; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.widget.ModelWidget; +import org.ofbiz.widget.WidgetWorker; +import org.ofbiz.widget.screen.ModelScreen; +import org.ofbiz.widget.screen.ScreenFactory; +import org.ofbiz.widget.screen.ScreenRenderException; +import org.ofbiz.widget.screen.ScreenStringRenderer; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -71,8 +70,8 @@ public class ModelTree extends ModelWidg protected String rootNodeName; protected String defaultRenderStyle; protected FlexibleStringExpander defaultWrapStyleExdr; - protected List<ModelNode> nodeList = FastList.newInstance(); - protected Map<String, ModelNode> nodeMap = FastMap.newInstance(); + protected List<ModelNode> nodeList = new ArrayList<ModelNode>(); + protected Map<String, ModelNode> nodeMap = new HashMap<String, ModelNode>(); protected Delegator delegator; protected LocalDispatcher dispatcher; protected FlexibleStringExpander expandCollapseRequestExdr; @@ -227,6 +226,7 @@ public class ModelTree extends ModelWidg * different tree elements; implementing your own makes it possible to * use the same tree definitions for many types of tree UIs */ + @SuppressWarnings("rawtypes") public void renderTreeString(StringBuffer buf, Map<String, Object> context, TreeStringRenderer treeStringRenderer) throws GeneralException { Map<String, Object> parameters = UtilGenerics.checkMap(context.get("parameters")); @@ -246,10 +246,10 @@ public class ModelTree extends ModelWidg context.put("rootEntityId", trail.get(0)); context.put(defaultPkName, trail.get(0)); } else { - trail = FastList.newInstance(); + trail = new LinkedList<String>(); } context.put("targetNodeTrail", trail); - context.put("currentNodeTrail", FastList.newInstance()); + context.put("currentNodeTrail", new LinkedList()); StringWriter writer = new StringWriter(); try { node.renderNodeString(writer, context, treeStringRenderer, 0); @@ -282,8 +282,8 @@ public class ModelTree extends ModelWidg protected Label label; protected Link link; protected Image image; - protected List<ModelSubNode> subNodeList = FastList.newInstance(); - protected List<ModelTreeAction> actions = FastList.newInstance(); + protected List<ModelSubNode> subNodeList = new ArrayList<ModelSubNode>(); + protected List<ModelTreeAction> actions = new ArrayList<ModelTreeAction>(); protected String name; protected ModelTree modelTree; protected List<Object []> subNodeValues; @@ -545,7 +545,7 @@ public class ModelTree extends ModelWidg } public void getChildren(Map<String, Object> context) { - this.subNodeValues = FastList.newInstance(); + this.subNodeValues = new ArrayList<Object []>(); for (ModelSubNode subNode: subNodeList) { String nodeName = subNode.getNodeName(context); ModelNode node = modelTree.nodeMap.get(nodeName); @@ -699,7 +699,7 @@ public class ModelTree extends ModelWidg protected ModelNode rootNode; protected FlexibleStringExpander nodeNameExdr; - protected List<ModelTreeAction> actions = FastList.newInstance(); + protected List<ModelTreeAction> actions = new ArrayList<ModelTreeAction>(); protected ListIterator<? extends Map<String, ? extends Object>> listIterator; public ModelSubNode() {} @@ -813,7 +813,7 @@ public class ModelTree extends ModelWidg protected boolean secure = false; protected boolean encode = false; protected String linkType; - protected List<WidgetWorker.Parameter> parameterList = FastList.newInstance(); + protected List<WidgetWorker.Parameter> parameterList = new ArrayList<WidgetWorker.Parameter>(); public Link() { setText(null); @@ -936,7 +936,7 @@ public class ModelTree extends ModelWidg } public Map<String, String> getParameterMap(Map<String, Object> context) { - Map<String, String> fullParameterMap = FastMap.newInstance(); + Map<String, String> fullParameterMap = new HashMap<String, String>(); /* leaving this here... may want to add it at some point like the hyperlink element: Map<String, String> addlParamMap = this.parametersMapAcsr.get(context); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java?rev=1635878&r1=1635877&r2=1635878&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java Fri Oct 31 23:13:03 2014 @@ -18,6 +18,8 @@ *******************************************************************************/ package org.ofbiz.widget.tree; +import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Locale; @@ -25,9 +27,6 @@ import java.util.Map; import java.util.TimeZone; import java.util.regex.PatternSyntaxException; -import javolution.util.FastList; -import javolution.util.FastMap; - import org.ofbiz.base.util.BshUtil; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; @@ -128,6 +127,7 @@ public abstract class ModelTreeAction { } } + @SuppressWarnings("rawtypes") @Override public void runAction(Map<String, Object> context) { String globalStr = this.globalExdr.expandString(context); @@ -142,9 +142,9 @@ public abstract class ModelTreeAction { } if (UtilValidate.isNotEmpty(this.type)) { if ("NewMap".equals(this.type)) { - newValue = FastMap.newInstance(); + newValue = new HashMap(); } else if ("NewList".equals(this.type)) { - newValue = FastList.newInstance(); + newValue = new LinkedList(); } else { try { newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), (Locale) context.get("locale"), true); @@ -264,7 +264,7 @@ public abstract class ModelTreeAction { if (autoFieldMapBool) { serviceContext = this.modelTree.getDispatcher().getDispatchContext().makeValidContext(serviceNameExpanded, ModelService.IN_PARAM, context); } else { - serviceContext = FastMap.newInstance(); + serviceContext = new HashMap<String, Object>(); } if (this.fieldMap != null) { Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java?rev=1635878&r1=1635877&r2=1635878&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java Fri Oct 31 23:13:03 2014 @@ -19,13 +19,13 @@ package org.ofbiz.widget.tree; import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TimeZone; -import javolution.util.FastList; - import org.apache.oro.text.regex.MalformedPatternException; import org.apache.oro.text.regex.Pattern; import org.apache.oro.text.regex.PatternMatcher; @@ -77,7 +77,7 @@ public class ModelTreeCondition { } public static List<TreeCondition> readSubConditions(ModelTree modelTree, Element conditionElement) { - List<TreeCondition> condList = FastList.newInstance(); + List<TreeCondition> condList = new ArrayList<TreeCondition>(); for (Element subElement: UtilXml.childElementList(conditionElement)) { condList.add(readCondition(modelTree, subElement)); } @@ -323,7 +323,7 @@ public class ModelTreeCondition { fieldVal = ""; } - List<Object> messages = FastList.newInstance(); + List<Object> messages = new LinkedList<Object>(); Boolean resultBool = BaseCompare.doRealCompare(fieldVal, value, operator, type, format, messages, null, null, true); if (messages.size() > 0) { messages.add(0, "Error with comparison in if-compare between field [" + fieldAcsr.toString() + "] with value [" + fieldVal + "] and value [" + value + "] with operator [" + operator + "] and type [" + type + "]: "); @@ -374,7 +374,7 @@ public class ModelTreeCondition { fieldVal = ""; } - List<Object> messages = FastList.newInstance(); + List<Object> messages = new LinkedList<Object>(); Boolean resultBool = BaseCompare.doRealCompare(fieldVal, toFieldVal, operator, type, format, messages, null, null, false); if (messages.size() > 0) { messages.add(0, "Error with comparison in if-compare-field between field [" + fieldAcsr.toString() + "] with value [" + fieldVal + "] and to-field [" + toFieldVal.toString() + "] with value [" + toFieldVal + "] with operator [" + operator + "] and type [" + type + "]: "); |
Free forum by Nabble | Edit this page |