You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2008/11/11 03:12:01 UTC
svn commit: r712911 [1/2] - in
/ofbiz/trunk/applications/product/src/org/ofbiz: product/catalog/
product/category/ product/config/ product/feature/ product/inventory/
product/price/ product/product/ product/promo/ product/spreadsheetimport/
product/sto...
Author: doogie
Date: Mon Nov 10 18:12:00 2008
New Revision: 712911
URL: http://svn.apache.org/viewvc?rev=712911&view=rev
Log:
Switch as much as possible to FastList/FastMap/FastSet.
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductHelper.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/supplier/SupplierProductServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/test/StockMovesTest.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServicesTests.java
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java Mon Nov 10 18:12:00 2008
@@ -18,10 +18,8 @@
*******************************************************************************/
package org.ofbiz.product.catalog;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -29,6 +27,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import javolution.util.FastList;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilHttp;
@@ -58,7 +58,7 @@
}
public static List getAllCatalogIds(ServletRequest request) {
- List catalogIds = new ArrayList();
+ List catalogIds = FastList.newInstance();
List catalogs = null;
GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
try {
@@ -165,7 +165,7 @@
if (!fromSession) {
if (Debug.verboseOn()) Debug.logVerbose("[CatalogWorker.getCurrentCatalogId] Setting new catalog name: " + prodCatalogId, module);
session.setAttribute("CURRENT_CATALOG_ID", prodCatalogId);
- CategoryWorker.setTrail(request, new ArrayList());
+ CategoryWorker.setTrail(request, FastList.newInstance());
}
return prodCatalogId;
}
@@ -183,8 +183,8 @@
}
public static List getCatalogIdsAvailable(List partyCatalogs, List storeCatalogs) {
- List categoryIds = new LinkedList();
- List allCatalogLinks = new ArrayList((storeCatalogs == null ? 0 : storeCatalogs.size()) + (partyCatalogs == null ? 0 : partyCatalogs.size()));
+ List categoryIds = FastList.newInstance();
+ List allCatalogLinks = FastList.newInstance();
if (partyCatalogs != null) allCatalogLinks.addAll(partyCatalogs);
if (storeCatalogs != null) allCatalogLinks.addAll(storeCatalogs);
@@ -377,7 +377,7 @@
public static Collection getCatalogQuickaddCategories(ServletRequest request, String prodCatalogId) {
if (prodCatalogId == null || prodCatalogId.length() <= 0) return null;
- Collection categoryIds = new LinkedList();
+ Collection categoryIds = FastList.newInstance();
Collection prodCatalogCategories = getProdCatalogCategories(request, prodCatalogId, "PCCT_QUICK_ADD");
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java Mon Nov 10 18:12:00 2008
@@ -21,13 +21,14 @@
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
-import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilHttp;
@@ -143,7 +144,7 @@
GenericValue categoryContent = EntityUtil.getFirst(categoryContentList);
if (categoryContent != null) {
// when rendering the category content, always include the Product Category and ProductCategoryContent records that this comes from
- Map inContext = new HashMap();
+ Map inContext = FastMap.newInstance();
inContext.put("productCategory", productCategory);
inContext.put("categoryContent", categoryContent);
ContentWorker.renderContentAsText(dispatcher, delegator, categoryContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, false);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java Mon Nov 10 18:12:00 2008
@@ -19,12 +19,12 @@
package org.ofbiz.product.category;
import java.sql.Timestamp;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javolution.util.FastList;
+import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -348,7 +348,7 @@
}
}
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
result.put("viewIndex", new Integer(viewIndex));
result.put("viewSize", new Integer(viewSize));
result.put("lowIndex", new Integer(lowIndex));
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Mon Nov 10 18:12:00 2008
@@ -20,7 +20,6 @@
import java.util.Collection;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -91,7 +90,7 @@
public static void getCategoriesWithNoParent(ServletRequest request, String attributeName) {
GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
- Collection results = new LinkedList();
+ Collection results = FastList.newInstance();
try {
Collection allCategories = delegator.findList("ProductCategory", null, null, null, null, false);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java Mon Nov 10 18:12:00 2008
@@ -21,13 +21,14 @@
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
-import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilHttp;
@@ -138,7 +139,7 @@
GenericValue productConfigItemContent = EntityUtil.getFirst(productConfigItemContentList);
if (productConfigItemContent != null) {
// when rendering the product config item content, always include the ProductConfigItem and ProdConfItemContent records that this comes from
- Map inContext = new HashMap();
+ Map inContext = FastMap.newInstance();
inContext.put("productConfigItem", productConfigItem);
inContext.put("productConfigItemContent", productConfigItemContent);
ContentWorker.renderContentAsText(dispatcher, delegator, productConfigItemContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, false);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java Mon Nov 10 18:12:00 2008
@@ -18,15 +18,15 @@
*******************************************************************************/
package org.ofbiz.product.config;
-import java.util.ArrayList;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
+import javolution.util.FastList;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilHttp;
import org.ofbiz.base.util.UtilMisc;
@@ -138,7 +138,7 @@
if (ProductWorker.isVirtual((GenericDelegator)request.getAttribute("delegator"), selectedProdcutId)) {
if ("VV_FEATURETREE".equals(ProductWorker.getProductvirtualVariantMethod((GenericDelegator)request.getAttribute("delegator"), selectedProdcutId))) {
// get the selected features
- List <String> selectedFeatures = new LinkedList<String>();
+ List <String> selectedFeatures = FastList.newInstance();
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramName = (String)paramNames.nextElement();
@@ -184,12 +184,12 @@
if (configWrapper == null || (!configWrapper.isCompleted())) return;
String configId = null;
List questions = configWrapper.getQuestions();
- List configsToCheck = new LinkedList();
+ List configsToCheck = FastList.newInstance();
int selectedOptionSize = 0;
for (int i = 0; i < questions.size(); i++) {
String configItemId = null;
Long sequenceNum = null;
- List <ProductConfigWrapper.ConfigOption> selectedOptions = new ArrayList <ProductConfigWrapper.ConfigOption>();
+ List <ProductConfigWrapper.ConfigOption> selectedOptions = FastList.newInstance();
ConfigItem ci = (ConfigItem)questions.get(i);
List options = ci.getOptions();
if (ci.isStandard()) {
@@ -247,7 +247,7 @@
for (int i = 0; i < questions.size(); i++) {
String configItemId = null;
Long sequenceNum = null;
- List <ProductConfigWrapper.ConfigOption> selectedOptions = new ArrayList <ProductConfigWrapper.ConfigOption>();
+ List <ProductConfigWrapper.ConfigOption> selectedOptions = FastList.newInstance();
ConfigItem ci = (ConfigItem)questions.get(i);
List options = ci.getOptions();
if (ci.isStandard()) {
@@ -316,7 +316,7 @@
for (int i = 0; i < questions.size(); i++) {
String configItemId = null;
Long sequenceNum = null;
- List <ProductConfigWrapper.ConfigOption> selectedOptions = new ArrayList <ProductConfigWrapper.ConfigOption>();
+ List <ProductConfigWrapper.ConfigOption> selectedOptions = FastList.newInstance();
ConfigItem ci = (ConfigItem)questions.get(i);
List options = ci.getOptions();
if (ci.isStandard()) {
@@ -341,7 +341,7 @@
sequenceNum = ci.getConfigItemAssoc().getLong("sequenceNum");
Iterator selOpIt = selectedOptions.iterator();
while (selOpIt.hasNext()) {
- List toBeStored = new LinkedList();
+ List toBeStored = FastList.newInstance();
ConfigOption oneOption = (ConfigOption)selOpIt.next();
String configOptionId = oneOption.configOption.getString("configOptionId");
String description = oneOption.getComments();
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java Mon Nov 10 18:12:00 2008
@@ -20,14 +20,16 @@
package org.ofbiz.product.config;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.HashMap;
+import java.util.Set;
import java.util.Locale;
+
+import javolution.util.FastList;
import javolution.util.FastMap;
+import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
@@ -72,7 +74,7 @@
product = GenericValue.create(pcw.product);
basePrice = pcw.basePrice;
defaultPrice = pcw.defaultPrice;
- questions = new ArrayList();
+ questions = FastList.newInstance();
dispatcher = pcw.dispatcher;
productStoreId = pcw.productStoreId;
catalogId = pcw.catalogId;
@@ -106,20 +108,20 @@
if (price != null) {
basePrice = price.doubleValue();
}
- questions = new ArrayList();
- List questionsValues = new ArrayList();
+ questions = FastList.newInstance();
+ List questionsValues = FastList.newInstance();
if (product.getString("productTypeId") != null && product.getString("productTypeId").equals("AGGREGATED")) {
questionsValues = delegator.findByAnd("ProductConfig", UtilMisc.toMap("productId", productId), UtilMisc.toList("sequenceNum"));
questionsValues = EntityUtil.filterByDate(questionsValues);
Iterator questionsValuesIt = questionsValues.iterator();
- HashMap itemIds = new HashMap();
+ Set itemIds = FastSet.newInstance();
while (questionsValuesIt.hasNext()) {
ConfigItem oneQuestion = new ConfigItem((GenericValue)questionsValuesIt.next());
oneQuestion.setContent(locale, "text/html"); // TODO: mime-type shouldn't be hardcoded
- if (itemIds.containsKey(oneQuestion.getConfigItem().getString("configItemId"))) {
+ if (itemIds.contains(oneQuestion.getConfigItem().getString("configItemId"))) {
oneQuestion.setFirst(false);
} else {
- itemIds.put(oneQuestion.getConfigItem().getString("configItemId"), null);
+ itemIds.add(oneQuestion.getConfigItem().getString("configItemId"));
}
questions.add(oneQuestion);
List configOptions = delegator.findByAnd("ProductConfigOption", UtilMisc.toMap("configItemId", oneQuestion.getConfigItemAssoc().getString("configItemId")), UtilMisc.toList("sequenceNum"));
@@ -273,7 +275,7 @@
}
public List getSelectedOptions() {
- List selectedOptions = new ArrayList();
+ List selectedOptions = FastList.newInstance();
for (int i = 0; i < questions.size(); i++) {
ConfigItem ci = (ConfigItem)questions.get(i);
if (ci.isStandard()) {
@@ -292,7 +294,7 @@
}
public List getDefaultOptions() {
- List defaultOptions = new ArrayList();
+ List defaultOptions = FastList.newInstance();
for (int i = 0; i < questions.size(); i++) {
ConfigItem ci = (ConfigItem)questions.get(i);
ConfigOption co = ci.getDefault();
@@ -373,13 +375,13 @@
public ConfigItem(GenericValue questionAssoc) throws Exception {
configItemAssoc = questionAssoc;
configItem = configItemAssoc.getRelatedOne("ConfigItemProductConfigItem");
- options = new ArrayList();
+ options = FastList.newInstance();
}
public ConfigItem(ConfigItem ci) {
configItem = GenericValue.create(ci.configItem);
configItemAssoc = GenericValue.create(ci.configItemAssoc);
- options = new ArrayList();
+ options = FastList.newInstance();
for (int i = 0; i < ci.options.size(); i++) {
options.add(new ConfigOption((ConfigOption)ci.options.get(i)));
}
@@ -570,7 +572,7 @@
public ConfigOption(ConfigOption co) {
configOption = GenericValue.create(co.configOption);
- componentList = new ArrayList();
+ componentList = FastList.newInstance();
for (int i = 0; i < co.componentList.size(); i++) {
componentList.add(GenericValue.create((GenericValue)co.componentList.get(i)));
}
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java Mon Nov 10 18:12:00 2008
@@ -18,7 +18,6 @@
*******************************************************************************/
package org.ofbiz.product.feature;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -29,6 +28,7 @@
import javolution.util.FastList;
import javolution.util.FastMap;
+import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilHttp;
@@ -135,7 +135,7 @@
public static Map getAllFeaturesByType(GenericDelegator delegator, int perTypeMaxSize) {
Map productFeaturesByTypeMap = FastMap.newInstance();
try {
- Set typesWithOverflowMessages = new HashSet();
+ Set typesWithOverflowMessages = FastSet.newInstance();
EntityListIterator productFeatureEli = delegator.find("ProductFeature", null, null, null, UtilMisc.toList("description"), null);
GenericValue productFeature = null;
while ((productFeature = (GenericValue) productFeatureEli.next()) != null) {
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java Mon Nov 10 18:12:00 2008
@@ -18,14 +18,14 @@
*******************************************************************************/
package org.ofbiz.product.feature;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
@@ -58,7 +58,7 @@
* The optional productFeatureApplTypeId causes results to be filtered by this parameter--only used in conjunction with productId.
*/
public static Map getProductFeaturesByType(DispatchContext dctx, Map context) {
- Map results = new HashMap();
+ Map results = FastMap.newInstance();
GenericDelegator delegator = dctx.getDelegator();
/* because we might need to search either for product features or for product features of a product, the search code has to be generic.
@@ -94,7 +94,7 @@
if (entityToSearch.equals("ProductFeatureAndAppl") && productFeatureApplTypeId != null)
allFeatures = EntityUtil.filterByAnd(allFeatures, UtilMisc.toMap("productFeatureApplTypeId", productFeatureApplTypeId));
- List featureTypes = new ArrayList(); // or LinkedList?
+ List featureTypes = FastList.newInstance(); // or LinkedList?
Map featuresByType = new LinkedHashMap();
GenericValue feature = null;
for (Iterator featuresIter = allFeatures.iterator(); featuresIter.hasNext(); ) {
@@ -104,7 +104,7 @@
featureTypes.add(featureType);
}
if (!featuresByType.containsKey(featureType)) {
- featuresByType.put(featureType, new ArrayList());
+ featuresByType.put(featureType, FastList.newInstance());
}
List features = (List)featuresByType.get(featureType);
features.add(feature);
@@ -125,12 +125,12 @@
* Result: variantProductIds: a List of productIds of variants with those features
*/
public static Map getAllExistingVariants(DispatchContext dctx, Map context) {
- Map results = new HashMap();
+ Map results = FastMap.newInstance();
GenericDelegator delegator = dctx.getDelegator();
String productId = (String) context.get("productId");
List curProductFeatureAndAppls = (List) context.get("productFeatureAppls");
- List existingVariantProductIds = new ArrayList();
+ List existingVariantProductIds = FastList.newInstance();
try {
/*
@@ -184,14 +184,14 @@
* {defaultVariantProductId: id of this variant; curProductFeatureAndAppls: features applied to this variant; existingVariantProductIds: List of productIds which are already variants with these features }
*/
public static Map getVariantCombinations(DispatchContext dctx, Map context) {
- Map results = new HashMap();
+ Map results = FastMap.newInstance();
LocalDispatcher dispatcher = dctx.getDispatcher();
String productId = (String) context.get("productId");
try {
Map featuresResults = dispatcher.runSync("getProductFeaturesByType", UtilMisc.toMap("productId", productId));
- Map features = new HashMap();
+ Map features = FastMap.newInstance();
if (featuresResults.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_SUCCESS)) {
features = (Map) featuresResults.get("productFeaturesByType");
@@ -201,21 +201,21 @@
// need to keep 2 lists, oldCombinations and newCombinations, and keep swapping them after each looping. Otherwise, you'll get a
// concurrent modification exception
- List oldCombinations = new LinkedList();
+ List oldCombinations = FastList.newInstance();
// loop through each feature type
for (Iterator fi = features.keySet().iterator(); fi.hasNext(); ) {
String currentFeatureType = (String) fi.next();
List currentFeatures = (List) features.get(currentFeatureType);
- List newCombinations = new LinkedList();
+ List newCombinations = FastList.newInstance();
List combinations;
// start with either existing combinations or from scratch
if (oldCombinations.size() > 0) {
combinations = oldCombinations;
} else {
- combinations = new LinkedList();
+ combinations = FastList.newInstance();
}
// in both cases, use each feature of current feature type's idCode and
@@ -226,9 +226,9 @@
for (Iterator cFi = currentFeatures.iterator(); cFi.hasNext(); ) {
GenericEntity currentFeature = (GenericEntity) cFi.next();
if (currentFeature.getString("productFeatureApplTypeId").equals("SELECTABLE_FEATURE")) {
- Map newCombination = new HashMap();
- List newFeatures = new LinkedList();
- List newFeatureIds = new LinkedList();
+ Map newCombination = FastMap.newInstance();
+ List newFeatures = FastList.newInstance();
+ List newFeatureIds = FastList.newInstance();
if (currentFeature.getString("idCode") != null) {
newCombination.put("defaultVariantProductId", productId + currentFeature.getString("idCode"));
} else {
@@ -247,11 +247,11 @@
for (Iterator cFi = currentFeatures.iterator(); cFi.hasNext(); ) {
GenericEntity currentFeature = (GenericEntity) cFi.next();
if (currentFeature.getString("productFeatureApplTypeId").equals("SELECTABLE_FEATURE")) {
- Map newCombination = new HashMap();
+ Map newCombination = FastMap.newInstance();
// .clone() is important, or you'll keep adding to the same List for all the variants
// have to cast twice: once from get() and once from clone()
- List newFeatures = ((List) ((LinkedList) combination.get("curProductFeatureAndAppls")).clone());
- List newFeatureIds = ((List) ((LinkedList) combination.get("curProductFeatureIds")).clone());
+ List newFeatures = UtilMisc.makeListWritable((List) combination.get("curProductFeatureAndAppls"));
+ List newFeatureIds = UtilMisc.makeListWritable((List) combination.get("curProductFeatureIds"));
if (currentFeature.getString("idCode") != null) {
newCombination.put("defaultVariantProductId", combination.get("defaultVariantProductId") + currentFeature.getString("idCode"));
} else {
@@ -272,7 +272,7 @@
}
int defaultCodeCounter = 1;
- HashMap defaultVariantProductIds = new HashMap(); // this map will contain the codes already used (as keys)
+ Map defaultVariantProductIds = FastMap.newInstance(); // this map will contain the codes already used (as keys)
defaultVariantProductIds.put(productId, null);
// now figure out which of these combinations already have productIds associated with them
@@ -303,14 +303,14 @@
* Result: products (a List of Product GenericValues)
*/
public static Map getCategoryVariantProducts(DispatchContext dctx, Map context) {
- Map results = new HashMap();
+ Map results = FastMap.newInstance();
LocalDispatcher dispatcher = dctx.getDispatcher();
List productFeatures = (List) context.get("productFeatures");
String productCategoryId = (String) context.get("productCategoryId");
// get all the product members of the product category
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
try {
result = dispatcher.runSync("getProductCategoryMembers", UtilMisc.toMap("categoryId", productCategoryId));
} catch (GenericServiceException ex) {
@@ -321,13 +321,13 @@
List memberProducts = (List) result.get("categoryMembers");
if ((memberProducts != null) && (memberProducts.size() > 0)) {
// construct a Map of productFeatureTypeId -> productFeatureId from the productFeatures List
- Map featuresByType = new HashMap();
+ Map featuresByType = FastMap.newInstance();
for (Iterator pFi = productFeatures.iterator(); pFi.hasNext(); ) {
GenericValue nextFeature = (GenericValue) pFi.next();
featuresByType.put(nextFeature.getString("productFeatureTypeId"), nextFeature.getString("productFeatureId"));
}
- List products = new ArrayList(); // final list of variant products
+ List products = FastList.newInstance(); // final list of variant products
for (Iterator mPi = memberProducts.iterator(); mPi.hasNext(); ) {
// find variants for each member product of the category
GenericValue memberProduct = (GenericValue) mPi.next();
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java Mon Nov 10 18:12:00 2008
@@ -19,15 +19,14 @@
package org.ofbiz.product.inventory;
import java.sql.Timestamp;
-import java.util.ArrayList;
import java.util.Calendar;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javolution.util.FastList;
+import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -355,8 +354,8 @@
}
*/
- Map ordersToUpdate = new HashMap();
- Map ordersToCancel = new HashMap();
+ Map ordersToUpdate = FastMap.newInstance();
+ Map ordersToCancel = FastMap.newInstance();
// find all inventory items w/ a negative ATP
List inventoryItems = null;
@@ -469,7 +468,7 @@
Debug.log("We won't ship on time, getting notification info", module);
Map notifyItems = (Map) ordersToUpdate.get(orderId);
if (notifyItems == null) {
- notifyItems = new HashMap();
+ notifyItems = FastMap.newInstance();
}
notifyItems.put(orderItemSeqId, nextShipDate);
ordersToUpdate.put(orderId, notifyItems);
@@ -497,7 +496,7 @@
Debug.log("Flagging the item to auto-cancel", module);
Map cancelItems = (Map) ordersToCancel.get(orderId);
if (cancelItems == null) {
- cancelItems = new HashMap();
+ cancelItems = FastMap.newInstance();
}
cancelItems.put(orderItemSeqId, farPastPromised);
ordersToCancel.put(orderId, cancelItems);
@@ -519,7 +518,7 @@
}
// all items to cancel will also be in the notify list so start with that
- List ordersToNotify = new ArrayList();
+ List ordersToNotify = FastList.newInstance();
Set orderSet = ordersToUpdate.keySet();
Iterator orderIter = orderSet.iterator();
while (orderIter.hasNext()) {
@@ -578,11 +577,11 @@
// if there are none to cancel just create an empty map
if (cancelItems == null) {
- cancelItems = new HashMap();
+ cancelItems = FastMap.newInstance();
}
if (orderItems != null) {
- List toBeStored = new ArrayList();
+ List toBeStored = FastList.newInstance();
Iterator orderItemsIter = orderItems.iterator();
while (orderItemsIter.hasNext()) {
GenericValue orderItem = (GenericValue) orderItemsIter.next();
@@ -721,10 +720,10 @@
LocalDispatcher dispatcher = dctx.getDispatcher();
List orderItems = (List) context.get("orderItems");
String facilityId = (String) context.get("facilityId");
- Map atpMap = new HashMap();
- Map qohMap = new HashMap();
- Map mktgPkgAtpMap = new HashMap();
- Map mktgPkgQohMap = new HashMap();
+ Map atpMap = FastMap.newInstance();
+ Map qohMap = FastMap.newInstance();
+ Map mktgPkgAtpMap = FastMap.newInstance();
+ Map mktgPkgQohMap = FastMap.newInstance();
Map results = ServiceUtil.returnSuccess();
// get a list of all available facilities for looping
@@ -818,8 +817,8 @@
String minimumStock = (String)context.get("minimumStock");
String statusId = (String)context.get("statusId");
- Map result = new HashMap();
- Map resultOutput = new HashMap();
+ Map result = FastMap.newInstance();
+ Map resultOutput = FastMap.newInstance();
Map contextInput = UtilMisc.toMap("productId", productId, "facilityId", facilityId, "statusId", statusId);
GenericValue product = null;
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java Mon Nov 10 18:12:00 2008
@@ -21,9 +21,7 @@
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
@@ -88,7 +86,7 @@
GenericDelegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
GenericValue product = (GenericValue) context.get("product");
@@ -892,7 +890,7 @@
// productPriceRules = delegator.findByOr("ProductPriceRule", pprExprs);
productPriceRules = delegator.findList("ProductPriceRule", null, null, null, null, true);
- if (productPriceRules == null) productPriceRules = new LinkedList();
+ if (productPriceRules == null) productPriceRules = FastList.newInstance();
}
return productPriceRules;
@@ -1335,9 +1333,9 @@
public static Map calculatePurchasePrice(DispatchContext dctx, Map context) {
GenericDelegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
- List orderItemPriceInfos = new LinkedList();
+ List orderItemPriceInfos = FastList.newInstance();
boolean validPriceFound = false;
double price = 0.0;
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java Mon Nov 10 18:12:00 2008
@@ -20,15 +20,15 @@
import java.io.IOException;
import java.sql.Timestamp;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
+import javolution.util.FastList;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -86,7 +86,7 @@
Set stemSet = KeywordSearchUtil.getStemSet();
Map keywords = new TreeMap();
- List strings = new ArrayList(50);
+ List strings = FastList.newInstance();
int pidWeight = 1;
try {
@@ -205,7 +205,7 @@
KeywordSearchUtil.processKeywordsForIndex(str, keywords, separators, stopWordBagAnd, stopWordBagOr, removeStems, stemSet);
}
- List toBeStored = new LinkedList();
+ List toBeStored = FastList.newInstance();
Iterator kiter = keywords.entrySet().iterator();
while (kiter.hasNext()) {
Map.Entry entry = (Map.Entry) kiter.next();
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java Mon Nov 10 18:12:00 2008
@@ -21,13 +21,14 @@
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
-import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilHttp;
@@ -179,7 +180,7 @@
GenericValue productContent = EntityUtil.getFirst(productContentList);
if (productContent != null) {
// when rendering the product content, always include the Product and ProductContent records that this comes from
- Map inContext = new HashMap();
+ Map inContext = FastMap.newInstance();
inContext.put("product", product);
inContext.put("productContent", productContent);
ContentWorker.renderContentAsText(dispatcher, delegator, productContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, false);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java Mon Nov 10 18:12:00 2008
@@ -19,9 +19,7 @@
package org.ofbiz.product.product;
import java.sql.Timestamp;
-import java.util.HashSet;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -30,7 +28,9 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import javolution.util.FastList;
import javolution.util.FastMap;
+import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -91,7 +91,7 @@
EntityCondition condition = null;
if (!"Y".equals(doAll)) {
- List condList = new LinkedList();
+ List condList = FastList.newInstance();
condList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("autoCreateKeywords", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("autoCreateKeywords", EntityOperator.NOT_EQUAL, "N")));
if ("true".equals(UtilProperties.getPropertyValue("prodsearch", "index.ignore.variants"))) {
condList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("isVariant", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("isVariant", EntityOperator.NOT_EQUAL, "Y")));
@@ -198,7 +198,7 @@
*/
public static String updateProductAssoc(HttpServletRequest request, HttpServletResponse response) {
String errMsg = "";
- List errMsgList = new LinkedList();
+ List errMsgList = FastList.newInstance();
GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
Security security = (Security) request.getAttribute("security");
@@ -391,7 +391,7 @@
// just store a new empty list in the session
HttpSession session = request.getSession();
if (session != null) {
- session.setAttribute("lastViewedCategories", new LinkedList());
+ session.setAttribute("lastViewedCategories", FastList.newInstance());
}
return "success";
}
@@ -401,7 +401,7 @@
// just store a new empty list in the session
HttpSession session = request.getSession();
if (session != null) {
- session.setAttribute("lastViewedProducts", new LinkedList());
+ session.setAttribute("lastViewedProducts", FastList.newInstance());
}
return "success";
}
@@ -623,7 +623,7 @@
description = null;
}
- Set variantDescRemoveToRemoveOnVirtual = new HashSet();
+ Set variantDescRemoveToRemoveOnVirtual = FastSet.newInstance();
checkUpdateFeatureApplByDescription(variantProductId, variantProduct, description, productFeatureTypeId, productFeatureType, "STANDARD_FEATURE", nowTimestamp, delegator, null, variantDescRemoveToRemoveOnVirtual);
checkUpdateFeatureApplByDescription(productId, product, description, productFeatureTypeId, productFeatureType, "SELECTABLE_FEATURE", nowTimestamp, delegator, variantDescRemoveToRemoveOnVirtual, null);
@@ -666,7 +666,7 @@
GenericValue productFeatureAndAppl = null;
- Set descriptionsForThisType = new HashSet();
+ Set descriptionsForThisType = FastSet.newInstance();
List productFeatureAndApplList = EntityUtil.filterByDate(delegator.findByAnd("ProductFeatureAndAppl", UtilMisc.toMap("productId", productId,
"productFeatureApplTypeId", productFeatureApplTypeId, "productFeatureTypeId", productFeatureTypeId)), true);
if (productFeatureAndApplList.size() > 0) {
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java Mon Nov 10 18:12:00 2008
@@ -2052,8 +2052,8 @@
// make view-entity & EntityCondition
int index = 1;
- List entityConditionList = new LinkedList();
- List orderByList = new LinkedList();
+ List entityConditionList = new FastList.newInstance();
+ List orderByList = new FastList.newInstance();
List fieldsToSelect = UtilMisc.toList("productId");
DynamicViewEntity dynamicViewEntity = new DynamicViewEntity();
dynamicViewEntity.addMemberEntity("PROD", "Product");
@@ -2065,9 +2065,9 @@
List productCategoryIdList = null;
if (includeSubCategories) {
// find all sub-categories recursively, make a Set of productCategoryId
- Set productCategoryIdSet = new HashSet();
+ Set productCategoryIdSet = Fast.newInstance();
getAllSubCategoryIds(productCategoryId, productCategoryIdSet, delegator, nowTimestamp);
- productCategoryIdList = new ArrayList(productCategoryIdSet);
+ productCategoryIdList = UtilMisc.makeListWritable(productCategoryIdSet);
} else {
productCategoryIdList = UtilMisc.toList(productCategoryId);
}
@@ -2128,7 +2128,7 @@
dynamicViewEntity.addViewLink("PROD", entityAlias, Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
orderByList.add("-totalRelevancy");
fieldsToSelect.add("totalRelevancy");
- List keywordOrList = new LinkedList();
+ List keywordOrList = new FastList.newInstance();
Iterator keywordIter = keywordList.iterator();
while (keywordIter.hasNext()) {
String keyword = (String) keywordIter.next();
@@ -2175,8 +2175,8 @@
return null;
}
- ArrayList productIds = new ArrayList(100);
- Set productIdSet = new HashSet();
+ ArrayList productIds = FastList.newInstance();
+ Set productIdSet = Fast.newInstance();
GenericValue searchResult = null;
while ((searchResult = (GenericValue) eli.next()) != null) {
String productId = searchResult.getString("productId");
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java Mon Nov 10 18:12:00 2008
@@ -19,8 +19,6 @@
package org.ofbiz.product.product;
import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -30,6 +28,9 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilHttp;
@@ -217,7 +218,7 @@
}
GenericValue searchResultView = null;
- List searchResultList = new ArrayList();
+ List searchResultList = FastList.newInstance();
int numAdded = 0;
while ((searchResultView = (GenericValue) eli.next()) != null) {
String productId = searchResultView.getString("mainProductId");
@@ -402,7 +403,7 @@
public static String searchExportProductList(HttpServletRequest request, HttpServletResponse response) {
GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
String errMsg = null;
- List productExportList = new ArrayList();
+ List productExportList = FastList.newInstance();
try {
boolean beganTransaction = TransactionUtil.begin(DEFAULT_TX_TIMEOUT);
@@ -416,7 +417,7 @@
GenericValue searchResultView = null;
while ((searchResultView = (GenericValue) eli.next()) != null) {
- Map productMap = new HashMap();
+ Map productMap = FastMap.newInstance();
String productId = searchResultView.getString("mainProductId");
productMap.put("productId", productId);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Mon Nov 10 18:12:00 2008
@@ -22,8 +22,6 @@
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -36,6 +34,8 @@
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
+import javolution.util.FastMap;
+import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -370,7 +370,7 @@
String productStoreId = ProductStoreWorker.getProductStoreId(request);
if (productStoreId != null) {
// get a Set of all keywords in the search, if there are any...
- Set keywords = new HashSet();
+ Set keywords = FastSet.newInstance();
List constraintList = ProductSearchOptions.getConstraintList(session);
if (constraintList != null) {
Iterator constraintIter = constraintList.iterator();
@@ -950,7 +950,7 @@
String searchSortOrderString = searchGetSortOrderString(false, request);
// ========== populate the result Map
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
result.put("productIds", productIds);
result.put("viewIndex", new Integer(viewIndex));
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java Mon Nov 10 18:12:00 2008
@@ -28,6 +28,7 @@
import javolution.util.FastList;
import javolution.util.FastMap;
+import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -74,7 +75,7 @@
Locale locale = (Locale) context.get("locale");
String productId = (String) context.get("productId");
Map selectedFeatures = (Map) context.get("selectedFeatures");
- ArrayList products = new ArrayList();
+ List products = FastList.newInstance();
// All the variants for this products are retrieved
Map resVariants = prodFindAllVariants(dctx, context);
List variants = (List)resVariants.get("assocProducts");
@@ -83,7 +84,7 @@
while (variantsIt.hasNext()) {
// For every variant, all the standard features are retrieved
oneVariant = (GenericValue)variantsIt.next();
- Map feaContext = new HashMap();
+ Map feaContext = FastMap.newInstance();
feaContext.put("productId", oneVariant.get("productIdTo"));
feaContext.put("type", "STANDARD_FEATURE");
Map resFeatures = prodGetFeatures(dctx, feaContext);
@@ -188,20 +189,20 @@
GenericDelegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
- Map result = new HashMap();
- List featureOrder = new LinkedList((Collection) context.get("featureOrder"));
+ Map result = FastMap.newInstance();
+ List featureOrder = UtilMisc.makeListWritable((Collection) context.get("featureOrder"));
if (featureOrder == null || featureOrder.size() == 0) {
return ServiceUtil.returnError("Empty list of features passed");
}
Collection variants = (Collection) prodFindAllVariants(dctx, context).get("assocProducts");
- List virtualVariant = new ArrayList();
+ List virtualVariant = FastList.newInstance();
if (variants == null || variants.size() == 0) {
return ServiceUtil.returnSuccess();
}
- List items = new ArrayList();
+ List items = FastList.newInstance();
Iterator i = variants.iterator();
while (i.hasNext()) {
@@ -278,7 +279,7 @@
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource,"productservices.empty_list_of_selectable_features_found", locale));
}
- Map features = new HashMap();
+ Map features = FastMap.newInstance();
Iterator sFIt = selectableFeatures.iterator();
while (sFIt.hasNext()) {
@@ -287,7 +288,7 @@
String feature = v.getString("description");
if (!features.containsKey(featureType)) {
- List featureList = new LinkedList();
+ List featureList = FastList.newInstance();
featureList.add(feature);
features.put(featureType, featureList);
} else {
@@ -334,7 +335,7 @@
// * String type -- Type of feature (STANDARD_FEATURE, SELECTABLE_FEATURE)
// * String distinct -- Distinct feature (SIZE, COLOR)
GenericDelegator delegator = dctx.getDelegator();
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
String productId = (String) context.get("productId");
String distinct = (String) context.get("distinct");
String type = (String) context.get("type");
@@ -366,7 +367,7 @@
public static Map prodFindProduct(DispatchContext dctx, Map context) {
// * String productId -- Product ID to find
GenericDelegator delegator = dctx.getDelegator();
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
String productId = (String) context.get("productId");
Locale locale = (Locale) context.get("locale");
String errMsg = null;
@@ -416,7 +417,7 @@
// * String productId -- Current Product ID
// * String type -- Type of association (ie PRODUCT_UPGRADE, PRODUCT_COMPLEMENT, PRODUCT_VARIANT)
GenericDelegator delegator = dctx.getDelegator();
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
String productId = (String) context.get("productId");
String productIdTo = (String) context.get("productIdTo");
String type = (String) context.get("type");
@@ -500,8 +501,8 @@
// Builds a product feature tree
private static Map makeGroup(GenericDelegator delegator, Map featureList, List items, List order, int index)
throws IllegalArgumentException, IllegalStateException {
- //List featureKey = new ArrayList();
- Map tempGroup = new HashMap();
+ //List featureKey = FastList.newInstance();
+ Map tempGroup = FastMap.newInstance();
Map group = new LinkedHashMap();
String orderKey = (String) order.get(index);
@@ -609,7 +610,7 @@
// builds a variant sample (a single sku for a featureType)
private static Map makeVariantSample(GenericDelegator delegator, Map featureList, List items, String feature) {
- Map tempSample = new HashMap();
+ Map tempSample = FastMap.newInstance();
Map sample = new LinkedHashMap();
Iterator itemIt = items.iterator();
@@ -660,7 +661,7 @@
public static Map quickAddVariant(DispatchContext dctx, Map context) {
GenericDelegator delegator = dctx.getDelegator();
- Map result = new HashMap();
+ Map result = FastMap.newInstance();
Locale locale = (Locale) context.get("locale");
String errMsg=null;
String productId = (String) context.get("productId");
@@ -790,14 +791,14 @@
// separate variantProductIdsBag into a Set of variantProductIds
//note: can be comma, tab, or white-space delimited
- Set prelimVariantProductIds = new HashSet();
+ Set prelimVariantProductIds = FastSet.newInstance();
List splitIds = Arrays.asList(variantProductIdsBag.split("[,\\p{Space}]"));
Debug.logInfo("Variants: bag=" + variantProductIdsBag, module);
Debug.logInfo("Variants: split=" + splitIds, module);
prelimVariantProductIds.addAll(splitIds);
//note: should support both direct productIds and GoodIdentification entries (what to do if more than one GoodID? Add all?
- Map variantProductsById = new HashMap();
+ Map variantProductsById = FastMap.newInstance();
Iterator variantProductIdIter = prelimVariantProductIds.iterator();
while (variantProductIdIter.hasNext()) {
String variantProductId = (String) variantProductIdIter.next();
@@ -834,10 +835,10 @@
}
// Attach productFeatureIdOne, Two, Three to the new virtual and all variant products as a standard feature
- Set featureProductIds = new HashSet();
+ Set featureProductIds = FastSet.newInstance();
featureProductIds.add(productId);
featureProductIds.addAll(variantProductsById.keySet());
- Set productFeatureIds = new HashSet();
+ Set productFeatureIds = FastSet.newInstance();
productFeatureIds.add(productFeatureIdOne);
productFeatureIds.add(productFeatureIdTwo);
productFeatureIds.add(productFeatureIdThree);
@@ -1129,7 +1130,7 @@
}
if (UtilValidate.isNotEmpty(productsFound)) {
- LinkedList<GenericValue> productsList = new LinkedList<GenericValue>();
+ List<GenericValue> productsList = FastList.newInstance();
// gets the first productId of the List
product = EntityUtil.getFirst(productsFound);
// remove this productId
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java Mon Nov 10 18:12:00 2008
@@ -19,14 +19,15 @@
package org.ofbiz.product.product;
import java.sql.Timestamp;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Locale;
+import javolution.util.FastMap;
+import javolution.util.FastSet;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilDateTime;
@@ -629,7 +630,7 @@
boolean doSubCategories = !"N".equals(doSubCategoriesStr);
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
- Set productFeatureTypeIdsToExclude = new HashSet();
+ Set productFeatureTypeIdsToExclude = FastSet.newInstance();
String excludeProp = UtilProperties.getPropertyValue("prodsearch", "attach.feature.type.exclude");
if (UtilValidate.isNotEmpty(excludeProp)) {
List typeList = StringUtil.split(excludeProp, ",");
@@ -641,7 +642,7 @@
if (UtilValidate.isNotEmpty(includeProp)) {
List typeList = StringUtil.split(includeProp, ",");
if (typeList.size() > 0) {
- productFeatureTypeIdsToInclude = new HashSet(typeList);
+ productFeatureTypeIdsToInclude = UtilMisc.makeSetWritable(typeList);
}
}
@@ -676,7 +677,7 @@
}
// now get all features for this category and make associated feature groups
- Map productFeatureIdByTypeIdSetMap = new HashMap();
+ Map productFeatureIdByTypeIdSetMap = FastMap.newInstance();
List productCategoryMemberList = delegator.findByAnd("ProductCategoryMember", UtilMisc.toMap("productCategoryId", productCategoryId));
Iterator productCategoryMemberIter = productCategoryMemberList.iterator();
while (productCategoryMemberIter.hasNext()) {
@@ -700,7 +701,7 @@
}
Set productFeatureIdSet = (Set) productFeatureIdByTypeIdSetMap.get(productFeatureTypeId);
if (productFeatureIdSet == null) {
- productFeatureIdSet = new HashSet();
+ productFeatureIdSet = FastSet.newInstance();
productFeatureIdByTypeIdSetMap.put(productFeatureTypeId, productFeatureIdSet);
}
productFeatureIdSet.add(productFeatureId);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java Mon Nov 10 18:12:00 2008
@@ -18,11 +18,8 @@
*******************************************************************************/
package org.ofbiz.product.product;
-import java.util.ArrayList;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -43,6 +40,7 @@
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ModelService;
import javolution.util.FastList;
+import javolution.util.FastMap;
import javolution.util.FastSet;
/**
@@ -344,7 +342,7 @@
*/
public static Set getVariantDistinguishingFeatures(GenericValue variantProduct) throws GenericEntityException {
if (variantProduct == null) {
- return new HashSet();
+ return FastSet.newInstance();
}
if (!"Y".equals(variantProduct.getString("isVariant"))) {
throw new IllegalArgumentException("Cannot get distinguishing features for a product that is not a variant (ie isVariant!=Y).");
@@ -353,7 +351,7 @@
String virtualProductId = getVariantVirtualId(variantProduct);
// find all selectable features on the virtual product that are also standard features on the variant
- Set distFeatures = new HashSet();
+ Set distFeatures = FastSet.newInstance();
List variantDistinguishingFeatures = delegator.findByAndCache("ProductFeatureAndAppl", UtilMisc.toMap("productId", variantProduct.get("productId"), "productFeatureApplTypeId", "DISTINGUISHING_FEAT"));
// Debug.logInfo("Found variantDistinguishingFeatures: " + variantDistinguishingFeatures, module);
@@ -370,7 +368,7 @@
// Debug.logInfo("Found virtualSelectableFeatures: " + virtualSelectableFeatures, module);
Iterator virtualSelectableFeatureIter = UtilMisc.toIterator(EntityUtil.filterByDate(virtualSelectableFeatures));
- Set virtualSelectableFeatureIds = new HashSet();
+ Set virtualSelectableFeatureIds = FastSet.newInstance();
while (virtualSelectableFeatureIter != null && virtualSelectableFeatureIter.hasNext()) {
GenericValue virtualSelectableFeature = (GenericValue) virtualSelectableFeatureIter.next();
virtualSelectableFeatureIds.add(virtualSelectableFeature.get("productFeatureId"));
@@ -461,7 +459,7 @@
if (product == null) {
return null;
}
- List features = new ArrayList();
+ List features = FastList.newInstance();
try {
if (product != null) {
List productAppls;
@@ -507,7 +505,7 @@
if (product == null) {
return null;
}
- List <List<Map<String,String>>> featureTypeFeatures = new ArrayList<List<Map<String,String>>>();
+ List <List<Map<String,String>>> featureTypeFeatures = FastList.newInstance();
try {
if (product != null) {
GenericDelegator delegator = product.getDelegator();
@@ -517,14 +515,14 @@
List featuresSorted = (List) UtilMisc.sortMaps(features, order);
Iterator it = (Iterator) featuresSorted.iterator();
String oldType = null;
- List<Map<String,String>> featureList = new LinkedList<Map<String,String>>();
+ List<Map<String,String>> featureList = FastList.newInstance();
while(it.hasNext()) {
GenericValue productFeatureAppl = (GenericValue) it.next();
if (oldType == null || !oldType.equals(productFeatureAppl.getString("productFeatureTypeId"))) {
// use first entry for type and description
if (oldType != null) {
featureTypeFeatures.add(featureList);
- featureList = new LinkedList<Map<String,String>>();
+ featureList = FastList.newInstance();
}
GenericValue productFeatureType = delegator.findByPrimaryKey("ProductFeatureType", UtilMisc.toMap("productFeatureTypeId",
productFeatureAppl.getString("productFeatureTypeId")));
@@ -578,7 +576,7 @@
String featureType = appl.getString("productFeatureTypeId");
List features = (List) featureMap.get(featureType);
if (features == null) {
- features = new LinkedList();
+ features = FastList.newInstance();
}
features.add(appl);
featureMap.put(featureType, features);
@@ -619,7 +617,7 @@
}
public static List filterOrderAdjustments(List adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) {
- List newOrderAdjustmentsList = new LinkedList();
+ List newOrderAdjustmentsList = FastList.newInstance();
if (UtilValidate.isNotEmpty(adjustments)) {
Iterator adjIt = adjustments.iterator();
@@ -757,7 +755,7 @@
if (product == null) {
return null;
}
- List categories = new ArrayList();
+ List categories = FastList.newInstance();
try {
List categoryMembers = product.getRelated("ProductCategoryMember");
categoryMembers = EntityUtil.filterByDate(categoryMembers);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java Mon Nov 10 18:12:00 2008
@@ -38,7 +38,6 @@
import java.io.IOException;
import java.io.StringReader;
import java.sql.Timestamp;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -82,7 +81,7 @@
String productStoreId = (String) context.get("productStoreId");
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
- List condList = new LinkedList();
+ List condList = FastList.newInstance();
if (UtilValidate.isEmpty(productStoreId)) {
condList.add(EntityCondition.makeCondition("productStoreId", EntityOperator.EQUALS, productStoreId));
}
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductHelper.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductHelper.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductHelper.java Mon Nov 10 18:12:00 2008
@@ -19,9 +19,10 @@
package org.ofbiz.product.spreadsheetimport;
-import java.util.HashMap;
import java.util.Map;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.GenericDelegator;
@@ -34,7 +35,7 @@
// prepare the product map
public static Map prepareProduct(String productId) {
- Map fields = new HashMap();
+ Map fields = FastMap.newInstance();
fields.put("productId", productId);
fields.put("productTypeId", "FINISHED_GOOD");
fields.put("internalName", "Product_" + productId);
@@ -46,7 +47,7 @@
// prepare the inventoryItem map
public static Map prepareInventoryItem(String productId,
double quantityOnHand, String inventoryItemId) {
- Map fields = new HashMap();
+ Map fields = FastMap.newInstance();
fields.put("inventoryItemId", inventoryItemId);
fields.put("inventoryItemTypeId", "NON_SERIAL_INV_ITEM");
fields.put("productId", productId);
@@ -73,4 +74,4 @@
}
return productExists;
}
-}
\ No newline at end of file
+}
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java Mon Nov 10 18:12:00 2008
@@ -22,11 +22,12 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
@@ -58,11 +59,11 @@
*/
public static Map productImportFromSpreadsheet(DispatchContext dctx, Map context) {
GenericDelegator delegator = dctx.getDelegator();
- Map responseMsgs = new HashMap();
+ Map responseMsgs = FastMap.newInstance();
// System.getProperty("user.dir") returns the path upto ofbiz home
// directory
String path = System.getProperty("user.dir") + "/spreadsheet";
- List fileItems = new ArrayList();
+ List fileItems = FastList.newInstance();
if (path != null && path.length() > 0) {
File importDir = new File(path);
@@ -92,8 +93,8 @@
for (int i = 0; i < fileItems.size(); i++) {
// read all xls file and create workbook one by one.
File item = (File) fileItems.get(i);
- List products = new ArrayList();
- List inventoryItems = new ArrayList();
+ List products = FastList.newInstance();
+ List inventoryItems = FastList.newInstance();
POIFSFileSystem fs = null;
HSSFWorkbook wb = null;
try {
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java Mon Nov 10 18:12:00 2008
@@ -18,9 +18,7 @@
*******************************************************************************/
package org.ofbiz.product.store;
-import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -29,6 +27,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
@@ -212,7 +211,7 @@
public static List getAvailableStoreShippingMethods(GenericDelegator delegator, String productStoreId, GenericValue shippingAddress, List itemSizes, Map featureIdMap, double weight, double orderTotal) {
if (featureIdMap == null) {
- featureIdMap = new HashMap();
+ featureIdMap = FastMap.newInstance();
}
List shippingMethods = null;
try {
@@ -223,7 +222,7 @@
}
// clone the list for concurrent modification
- List returnShippingMethods = new LinkedList(shippingMethods);
+ List returnShippingMethods = UtilMisc.makeListWritable(shippingMethods);
if (shippingMethods != null) {
Iterator i = shippingMethods.iterator();
@@ -464,7 +463,7 @@
}
public static List getSurveys(GenericDelegator delegator, String productStoreId, String groupName, String productId, String surveyApplTypeId, String parentProductId) {
- List surveys = new LinkedList();
+ List surveys = FastList.newInstance();
List storeSurveys = null;
try {
storeSurveys = delegator.findByAndCache("ProductStoreSurveyAppl", UtilMisc.toMap("productStoreId", productStoreId, "surveyApplTypeId", surveyApplTypeId), UtilMisc.toList("sequenceNum"));
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java Mon Nov 10 18:12:00 2008
@@ -20,11 +20,12 @@
import java.sql.Timestamp;
import java.util.Calendar;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
@@ -136,7 +137,7 @@
return ServiceUtil.returnError("Error processing subscription update with ID [" + updateSubscriptionMap.get("subscriptionId") + "]", null, null, updateSubscriptionResult);
}
} else {
- Map createPartyRoleMap = new HashMap();
+ Map createPartyRoleMap = FastMap.newInstance();
if (UtilValidate.isNotEmpty(roleTypeId)) {
createPartyRoleMap.put("partyId", partyId);
createPartyRoleMap.put("roleTypeId", roleTypeId);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/supplier/SupplierProductServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/supplier/SupplierProductServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/supplier/SupplierProductServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/supplier/SupplierProductServices.java Mon Nov 10 18:12:00 2008
@@ -20,11 +20,13 @@
package org.ofbiz.product.supplier;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
@@ -53,7 +55,7 @@
* filtered by date and optionally by partyId, ordered with lowest price first
*/
public static Map getSuppliersForProduct(DispatchContext dctx, Map context) {
- Map results = new HashMap();
+ Map results = FastMap.newInstance();
GenericDelegator delegator = dctx.getDelegator();
GenericValue product = null;
@@ -125,7 +127,7 @@
* SupplierProduct entity for that supplier party and feature, and return it as convertedProductFeatures
*/
public static Map convertFeaturesForSupplier(DispatchContext dctx, Map context) {
- Map results = new HashMap();
+ Map results = FastMap.newInstance();
String partyId = (String) context.get("partyId");
Collection features = (Collection) context.get("productFeatures");
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/test/StockMovesTest.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/test/StockMovesTest.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/test/StockMovesTest.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/test/StockMovesTest.java Mon Nov 10 18:12:00 2008
@@ -27,9 +27,9 @@
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.base.util.UtilMisc;
-import java.util.ArrayList;
import java.util.Map;
import java.util.List;
+import javolution.util.FastList;
import javolution.util.FastMap;
/**
@@ -57,7 +57,7 @@
public void testStockMoves() throws Exception {
Map fsmnCtx = FastMap.newInstance();
Map stockMoveHandled = null;
- List warningList = new ArrayList();
+ List warningList = FastList.newInstance();
fsmnCtx.put("facilityId", "WebStoreWarehouse");
fsmnCtx.put("userLogin", userLogin);
@@ -82,4 +82,4 @@
ppsmCtx.put("userLogin", userLogin);
Map respMap3 = dispatcher.runSync("processPhysicalStockMove", ppsmCtx);
}
-}
\ No newline at end of file
+}
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java Mon Nov 10 18:12:00 2008
@@ -553,7 +553,7 @@
return packageSeq;
}
- List currentLines = new ArrayList(this.packLines);
+ List currentLines = UtilMisc.makeListWritable(this.packLines);
Iterator i = currentLines.iterator();
while (i.hasNext()) {
PackingSessionLine line = (PackingSessionLine) i.next();
@@ -915,7 +915,7 @@
packageSeqIds.add(new Integer(line.getPackageSeq()));
}
}
- return new ArrayList(packageSeqIds);
+ return UtilMisc.makeListWritable(packageSeqIds);
}
public void setPackageWeight(int packageSeqId, Double packageWeight) {
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java?rev=712911&r1=712910&r2=712911&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java Mon Nov 10 18:12:00 2008
@@ -21,7 +21,8 @@
import java.util.Map;
import java.util.List;
import java.util.Iterator;
-import java.util.ArrayList;
+
+import javolution.util.FastList;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.ServiceUtil;
@@ -51,8 +52,8 @@
if (orderHeaderList == null) {
// convert the ID list to headers
if (orderIdList != null) {
- List conditionList1 = new ArrayList();
- List conditionList2 = new ArrayList();
+ List conditionList1 = FastList.newInstance();
+ List conditionList2 = FastList.newInstance();
// we are only concerned about approved sales orders
conditionList2.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "ORDER_APPROVED"));