Author: taher
Date: Fri Oct 23 05:52:25 2015 New Revision: 1710122 URL: http://svn.apache.org/viewvc?rev=1710122&view=rev Log: another round of javolution removal in achieving OFBIZ-5169 Remove javolution reference from multiple java source files and a few BIRT reports. I had to replace the FastList with a LinkedList in SolrProductSearch.getSideDeepCategories(..) because it uses the implementation methods getLast() and removeFirst() REF https://issues.apache.org/jira/browse/OFBIZ-5169 Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubAuthenticator.java ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubUserGroupMapper.java ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInAuthenticator.java ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInUserGroupMapper.java ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/Burndown.rptdesign ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/ProjectAndSprintChart.rptdesign ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/CategoryUtil.java ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/ProductUtil.java ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrProductSearch.java ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrUtil.java Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Fri Oct 23 05:52:25 2015 @@ -33,8 +33,6 @@ import java.util.Locale; import java.util.Map; import java.util.Set; -import javolution.util.FastList; - import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilFormatOut; @@ -3015,7 +3013,7 @@ public class OrderReadHelper { } public List<BigDecimal> getShippableSizes(String shipGrouSeqId) { - List<BigDecimal> shippableSizes = FastList.newInstance(); + List<BigDecimal> shippableSizes = new ArrayList<BigDecimal>(); List<GenericValue> validItems = getValidOrderItems(shipGrouSeqId); if (validItems != null) { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java Fri Oct 23 05:52:25 2015 @@ -38,7 +38,6 @@ import org.ofbiz.service.GenericServiceE * * The following third-party libraries (can be found in OFBiz) also need to be on the client's classpath: * commons-collections.jar - * javolution.jar * jdbm.jar * log4j.jar * Modified: ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubAuthenticator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubAuthenticator.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubAuthenticator.java (original) +++ ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubAuthenticator.java Fri Oct 23 05:52:25 2015 @@ -18,6 +18,7 @@ *******************************************************************************/ package org.ofbiz.passport.user; +import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.io.IOException; @@ -55,8 +56,6 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilValidate; -import javolution.util.FastMap; - /** * GitHub OFBiz Authenticator */ @@ -250,7 +249,7 @@ public class GitHubAuthenticator impleme private String createUser(Map<String, Object> userMap, GenericValue system) throws AuthenticatorException { // create person + userLogin - Map<String, Serializable> createPersonUlMap = FastMap.newInstance(); + Map<String, Serializable> createPersonUlMap = new HashMap<String, Serializable>(); String userLoginId = delegator.getNextSeqId("UserLogin"); if (userMap.containsKey("name")) { // use github's name as OFBiz's lastName @@ -286,7 +285,7 @@ public class GitHubAuthenticator impleme // create email if (userMap.containsKey("email")) { - Map<String, Serializable> createEmailMap = FastMap.newInstance(); + Map<String, Serializable> createEmailMap = new HashMap<String, Serializable>(); createEmailMap.put("emailAddress", (String) userMap.get("email")); createEmailMap.put("contactMechPurposeTypeId", "PRIMARY_EMAIL"); createEmailMap.put("partyId", partyId); @@ -315,7 +314,7 @@ public class GitHubAuthenticator impleme // add it to the user if it exists if (secGroup != null) { - Map<String, Serializable> createSecGrpMap = FastMap.newInstance(); + Map<String, Serializable> createSecGrpMap = new HashMap<String, Serializable>(); createSecGrpMap.put("userLoginId", userLoginId); createSecGrpMap.put("groupId", securityGroup); createSecGrpMap.put("fromDate", now); Modified: ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubUserGroupMapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubUserGroupMapper.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubUserGroupMapper.java (original) +++ ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/GitHubUserGroupMapper.java Fri Oct 23 05:52:25 2015 @@ -18,6 +18,8 @@ *******************************************************************************/ package org.ofbiz.passport.user; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Properties; import java.util.Arrays; @@ -25,9 +27,6 @@ import java.util.Set; import org.ofbiz.base.util.UtilProperties; -import javolution.util.FastList; -import javolution.util.FastSet; - /** * GitHub UserGroupMapper */ @@ -41,7 +40,7 @@ public class GitHubUserGroupMapper { public GitHubUserGroupMapper(String group) { if (groups == null) { - groups = FastList.newInstance(); + groups = new ArrayList<String>(); } groups.add(group); } @@ -49,7 +48,7 @@ public class GitHubUserGroupMapper { public Set<String> getSecurityGroups() { Properties props = UtilProperties.getProperties(GitHubAuthenticator.props); - Set<String> secGroups = FastSet.newInstance(); + Set<String> secGroups = new HashSet<String>(); boolean running = true; int index = 1; Modified: ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInAuthenticator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInAuthenticator.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInAuthenticator.java (original) +++ ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInAuthenticator.java Fri Oct 23 05:52:25 2015 @@ -18,6 +18,7 @@ *******************************************************************************/ package org.ofbiz.passport.user; +import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.io.IOException; @@ -56,8 +57,6 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import javolution.util.FastMap; - /** * LinkedIn OFBiz Authenticator */ @@ -260,7 +259,7 @@ public class LinkedInAuthenticator imple Map<String, String> userInfo = parseLinkedInUserInfo(user); // create person + userLogin - Map<String, Serializable> createPersonUlMap = FastMap.newInstance(); + Map<String, Serializable> createPersonUlMap = new HashMap<String, Serializable>(); String userLoginId = delegator.getNextSeqId("UserLogin"); if (userInfo.containsKey("firstName")) { createPersonUlMap.put("firstName", userInfo.get("firstName")); @@ -298,7 +297,7 @@ public class LinkedInAuthenticator imple // create email if (userInfo.containsKey("emailAddress")) { - Map<String, Serializable> createEmailMap = FastMap.newInstance(); + Map<String, Serializable> createEmailMap = new HashMap<String, Serializable>(); createEmailMap.put("emailAddress", userInfo.get("emailAddress")); createEmailMap.put("contactMechPurposeTypeId", "PRIMARY_EMAIL"); createEmailMap.put("partyId", partyId); @@ -327,7 +326,7 @@ public class LinkedInAuthenticator imple // add it to the user if it exists if (secGroup != null) { - Map<String, Serializable> createSecGrpMap = FastMap.newInstance(); + Map<String, Serializable> createSecGrpMap = new HashMap<String, Serializable>(); createSecGrpMap.put("userLoginId", userLoginId); createSecGrpMap.put("groupId", securityGroup); createSecGrpMap.put("fromDate", now); @@ -437,7 +436,7 @@ public class LinkedInAuthenticator imple } public static Map<String, String> parseLinkedInUserInfo(Document userInfo) { - Map<String, String> results = FastMap.newInstance(); + Map<String, String> results = new HashMap<String, String>(); NodeList persons = userInfo.getElementsByTagName("person"); if (UtilValidate.isEmpty(persons) || persons.getLength() <= 0) { return results; Modified: ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInUserGroupMapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInUserGroupMapper.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInUserGroupMapper.java (original) +++ ofbiz/trunk/specialpurpose/passport/src/org/ofbiz/passport/user/LinkedInUserGroupMapper.java Fri Oct 23 05:52:25 2015 @@ -18,6 +18,8 @@ *******************************************************************************/ package org.ofbiz.passport.user; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Properties; import java.util.Arrays; @@ -25,9 +27,6 @@ import java.util.Set; import org.ofbiz.base.util.UtilProperties; -import javolution.util.FastList; -import javolution.util.FastSet; - /** * LinkedIn UserGroupMapper */ @@ -41,7 +40,7 @@ public class LinkedInUserGroupMapper { public LinkedInUserGroupMapper(String group) { if (groups == null) { - groups = FastList.newInstance(); + groups = new ArrayList<String>(); } groups.add(group); } @@ -49,7 +48,7 @@ public class LinkedInUserGroupMapper { public Set<String> getSecurityGroups() { Properties props = UtilProperties.getProperties(LinkedInAuthenticator.props); - Set<String> secGroups = FastSet.newInstance(); + Set<String> secGroups = new HashSet<String>(); boolean running = true; int index = 1; Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/Burndown.rptdesign URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/Burndown.rptdesign?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/Burndown.rptdesign (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/Burndown.rptdesign Fri Oct 23 05:52:25 2015 @@ -25,7 +25,6 @@ importPackage(Packages.java.math); importPackage(Packages.java.sql); importPackage(Packages.java.text); importPackage(Packages.java.util); -importPackage(Packages.javolution.util); importPackage(Packages.org.ofbiz.base.util); importPackage(Packages.org.ofbiz.entity.condition); @@ -47,7 +46,7 @@ var countHoliday = 0; while (countHoliday < dayNumber) { var conditionTimestampFrom = new Timestamp(actualStartDate.getTime() + (countHoliday*1000*60*60*24)); // get public holiday - var holidayConds = FastList.newInstance(); + var holidayConds = new ArrayList(); holidayConds.add(EntityCondition.makeCondition("workEffortTypeId",EntityOperator.EQUALS, "PUBLIC_HOLIDAY")); holidayConds.add(EntityCondition.makeCondition("estimatedStartDate", EntityOperator.EQUALS, conditionTimestampFrom)); var fieldsToSelect = UtilMisc.toSet("workEffortId","estimatedStartDate"); @@ -236,7 +235,7 @@ remainActualHours = BigDecimal.ZERO; averageHours = previousAverageHours; -holidays = FastList.newInstance(); +holidays = new ArrayList(); reportContext.getAppContext().put("holidays", holidays); ]]></method> <method name="fetch"><![CDATA[if (dayCount >= dayNumber || currentDay >= 0) return false; @@ -253,7 +252,7 @@ if (nowTimestamp.getTime() >= conditionT } // get public holiday -var holidayConds = FastList.newInstance(); +var holidayConds = new ArrayList(); holidayConds.add(EntityCondition.makeCondition("workEffortTypeId",EntityOperator.EQUALS, "PUBLIC_HOLIDAY")); holidayConds.add(EntityCondition.makeCondition("estimatedStartDate", EntityOperator.EQUALS, conditionTimestampFrom)); var fieldsToSelect = UtilMisc.toSet("workEffortId","estimatedStartDate"); @@ -281,7 +280,7 @@ for (i=0; i<backlogItems.size(); i++) { // get all task from backlog item var backlogItem = backlogItems.get(i); var custRequestId = backlogItem.get("custRequestId"); - var conds = FastList.newInstance(); + var conds = new ArrayList(); conds.add(EntityCondition.makeCondition("custRequestId", custRequestId)); conds.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.NOT_EQUAL, "SCRUM_SPRINT")); var tasks = delegator.findList("CustRequestAndWorkEffort", EntityCondition.makeCondition(conds), null, null, null, false); @@ -303,7 +302,7 @@ for (i=0; i<backlogItems.size(); i++) { } } // get all time entries from task - var timeEntryConds = FastList.newInstance(); + var timeEntryConds = new ArrayList(); timeEntryConds.add(EntityCondition.makeCondition("workEffortId", workEffortId)); timeEntryConds.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, conditionTimestampFrom)); timeEntryConds.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, conditionTimestampTo)); Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/ProjectAndSprintChart.rptdesign URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/ProjectAndSprintChart.rptdesign?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/ProjectAndSprintChart.rptdesign (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/reports/ProjectAndSprintChart.rptdesign Fri Oct 23 05:52:25 2015 @@ -24,7 +24,6 @@ under the License. importPackage(Packages.java.sql); importPackage(Packages.java.text); importPackage(Packages.java.util); -importPackage(Packages.javolution.util); importPackage(Packages.org.ofbiz.base.util); importPackage(Packages.org.ofbiz.entity.condition); module = "ProjectAndSprintChart.rptdesign"; @@ -129,7 +128,7 @@ productId = params["productId"].value; <property name="dataSource">Data Source</property> <method name="open"><![CDATA[ - resultList = FastList.newInstance(); + resultList = new ArrayList(); var projectList = null; try{ var projectList = delegator.findByAnd("WorkEffortAndProduct", UtilMisc.toMap("productId", productId, "workEffortTypeId", "SCRUM_PROJECT"), null, false); Modified: ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/CategoryUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/CategoryUtil.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/CategoryUtil.java (original) +++ ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/CategoryUtil.java Fri Oct 23 05:52:25 2015 @@ -18,11 +18,10 @@ *******************************************************************************/ package org.ofbiz.solr; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import javolution.util.FastList; - import org.apache.commons.lang.StringUtils; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilMisc; @@ -48,7 +47,7 @@ public abstract class CategoryUtil { * This method is a supplement to CatalogWorker methods. */ public static List<String> getCatalogIdsByCategoryId(Delegator delegator, String productCategoryId) { - List<String> catalogIds = FastList.newInstance(); + List<String> catalogIds = new ArrayList<String>(); List<GenericValue> catalogs = null; try { EntityCondition condition = EntityCondition.makeCondition(UtilMisc.toMap("productCategoryId", productCategoryId)); @@ -67,23 +66,23 @@ public abstract class CategoryUtil { public static List<List<String>> getCategoryTrail(String productCategoryId, DispatchContext dctx) { GenericDelegator delegator = (GenericDelegator) dctx.getDelegator(); - List<List<String>> trailElements = FastList.newInstance(); + List<List<String>> trailElements = new ArrayList<List<String>>(); String parentProductCategoryId = productCategoryId; while (UtilValidate.isNotEmpty(parentProductCategoryId)) { // find product category rollup try { - List<EntityCondition> rolllupConds = FastList.newInstance(); + List<EntityCondition> rolllupConds = new ArrayList<EntityCondition>(); rolllupConds.add(EntityCondition.makeCondition("productCategoryId", parentProductCategoryId)); rolllupConds.add(EntityUtil.getFilterByDateExpr()); List<GenericValue> productCategoryRollups = delegator.findList("ProductCategoryRollup", EntityCondition.makeCondition(rolllupConds), null, UtilMisc.toList("-fromDate"), null, true); if (UtilValidate.isNotEmpty(productCategoryRollups)) { - List<List<String>> trailElementsAux = FastList.newInstance(); + List<List<String>> trailElementsAux = new ArrayList<List<String>>(); trailElementsAux.addAll(trailElements); // add only categories that belong to the top category to trail for (GenericValue productCategoryRollup : productCategoryRollups) { String trailCategoryId = productCategoryRollup.getString("parentProductCategoryId"); parentProductCategoryId = trailCategoryId; - List<String> trailElement = FastList.newInstance(); + List<String> trailElement = new ArrayList<String>(); if (!trailElements.isEmpty()) { for (List<String> trailList : trailElementsAux) { trailElement.add(trailCategoryId); @@ -106,7 +105,7 @@ public abstract class CategoryUtil { } } if (trailElements.size() == 0) { - List<String> trailElement = FastList.newInstance(); + List<String> trailElement = new ArrayList<String>(); trailElement.add(productCategoryId); trailElements.add(trailElement); } Modified: ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/ProductUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/ProductUtil.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/ProductUtil.java (original) +++ ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/ProductUtil.java Fri Oct 23 05:52:25 2015 @@ -27,9 +27,6 @@ import java.util.Locale; 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.UtilMisc; import org.ofbiz.entity.GenericDelegator; @@ -117,7 +114,7 @@ public abstract class ProductUtil { dispatchContext.put("category", trails); // Get the catalogs that have associated the categories - List<String> catalogs = FastList.newInstance(); + List<String> catalogs = new ArrayList<String>(); for (String trail : trails) { String productCategoryId = (trail.split("/").length > 0) ? trail.split("/")[1] : trail; List<String> catalogMembers = CategoryUtil.getCatalogIdsByCategoryId(delegator, productCategoryId); @@ -154,7 +151,7 @@ public abstract class ProductUtil { if (isPhysical) dispatchContext.put("isPhysical", isPhysical); - FastMap<String, String> title = new FastMap<String, String>(); + Map<String, String> title = new HashMap<String, String>(); String detitle = productContentDe.get("PRODUCT_NAME", "html").toString(); if (detitle != null) title.put("de", detitle); @@ -172,7 +169,7 @@ public abstract class ProductUtil { title.put("fr", (String) product.get("productName")); dispatchContext.put("title", title); - Map<String, String> description = new FastMap<String, String>(); + Map<String, String> description = new HashMap<String, String>(); String dedescription = productContentDe.get("DESCRIPTION", "html").toString(); if (dedescription != null) description.put("de", dedescription); @@ -184,7 +181,7 @@ public abstract class ProductUtil { description.put("fr", frdescription); dispatchContext.put("description", description); - FastMap<String, String> longDescription = new FastMap<String, String>(); + Map<String, String> longDescription = new HashMap<String, String>(); String delongDescription = productContentDe.get("LONG_DESCRIPTION", "html").toString(); if (delongDescription != null) longDescription.put("de", delongDescription); Modified: ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrProductSearch.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrProductSearch.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrProductSearch.java (original) +++ ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrProductSearch.java Fri Oct 23 05:52:25 2015 @@ -24,14 +24,13 @@ import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; -import javolution.util.FastList; -import javolution.util.FastMap; - import org.apache.commons.lang.StringUtils; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServerException; @@ -366,7 +365,7 @@ public abstract class SolrProductSearch LocalDispatcher dispatcher = dctx.getDispatcher(); try { - Map<String, Object> dispatchMap = FastMap.newInstance(); + Map<String, Object> dispatchMap = new HashMap<String, Object>(); if (UtilValidate.isNotEmpty(context.get("productCategoryId"))){ String productCategoryId = (String) context.get("productCategoryId"); dispatchMap.put("query", "cat:*" + productCategoryId+"*"); @@ -409,7 +408,7 @@ public abstract class SolrProductSearch if (context.get("query") == null || context.get("query").equals("")) context.put("query", "*:*"); - Map<String, Object> dispatchMap = FastMap.newInstance(); + Map<String, Object> dispatchMap = new HashMap<String, Object>(); if (context.get("viewSize") != null) dispatchMap.put("viewSize", Integer.parseInt(((String) context.get("viewSize")))); if (context.get("viewIndex") != null) @@ -422,7 +421,7 @@ public abstract class SolrProductSearch Map<String, Object> searchResult = dispatcher.runSync("runSolrQuery", dispatchMap); QueryResponse queryResult = (QueryResponse) searchResult.get("queryResult"); - List<List<String>> suggestions = FastList.newInstance(); + List<List<String>> suggestions = new ArrayList<List<String>>(); if (queryResult.getSpellCheckResponse() != null && queryResult.getSpellCheckResponse().getSuggestions() != null) { Iterator<Suggestion> iter = queryResult.getSpellCheckResponse().getSuggestions().iterator(); while (iter.hasNext()) { @@ -441,16 +440,16 @@ public abstract class SolrProductSearch result.put("isCorrectlySpelled", isCorrectlySpelled); Map<String, Integer> facetQuery = queryResult.getFacetQuery(); - Map<String, String> facetQueries = FastMap.newInstance(); + Map<String, String> facetQueries = new HashMap<String, String>(); for (String fq : facetQuery.keySet()) { if (facetQuery.get(fq).intValue() > 0) facetQueries.put(fq, fq.replaceAll("^.*\\u005B(.*)\\u005D", "$1") + " (" + facetQuery.get(fq).intValue() + ")"); } - Map<String, Map<String, Long>> facetFields = FastMap.newInstance(); + Map<String, Map<String, Long>> facetFields = new HashMap<String, Map<String, Long>>(); List<FacetField> facets = queryResult.getFacetFields(); for (FacetField facet : facets) { - Map<String, Long> facetEntry = FastMap.newInstance(); + Map<String, Long> facetEntry = new HashMap<String, Long>(); List<FacetField.Count> facetEntries = facet.getValues(); if (UtilValidate.isNotEmpty(facetEntries)) { for (FacetField.Count fcount : facetEntries) @@ -503,7 +502,7 @@ public abstract class SolrProductSearch QueryResponse cat = (QueryResponse) query.get("rows"); result = ServiceUtil.returnSuccess(); result.put("numFound", (long) 0); - Map<String, Object> categories = FastMap.newInstance(); + Map<String, Object> categories = new HashMap<String, Object>(); List<FacetField> catList = (List<FacetField>) cat.getFacetFields(); for (Iterator<FacetField> catIterator = catList.iterator(); catIterator.hasNext();) { FacetField field = (FacetField) catIterator.next(); @@ -541,7 +540,7 @@ public abstract class SolrProductSearch String productCategoryId = (String) context.get("productCategoryId") != null ? CategoryUtil.getCategoryNameWithTrail((String) context.get("productCategoryId"),dctx) : null; result = ServiceUtil.returnSuccess(); - Map<String, List<Map<String, Object>>> catLevel = FastMap.newInstance(); + Map<String, List<Map<String, Object>>> catLevel = new HashMap<String, List<Map<String, Object>>>(); Debug.logInfo("productCategoryId: "+productCategoryId, module); //Add toplevel categories @@ -559,7 +558,7 @@ public abstract class SolrProductSearch //Debug.logInfo("categoryPath: "+categoryPath + " facetQuery: "+facetQuery,module); Map<String, Object> query = SolrUtil.categoriesAvailable(catalogId, categoryPath, null, facetQuery,false, 0, 0); QueryResponse cat = (QueryResponse) query.get("rows"); - List<Map<String, Object>> categories = FastList.newInstance(); + List<Map<String, Object>> categories = new ArrayList<Map<String, Object>>(); List<FacetField> catList = (List<FacetField>) cat.getFacetFields(); @@ -570,8 +569,8 @@ public abstract class SolrProductSearch for (Iterator<Count> catIter = catL.iterator(); catIter.hasNext();) { FacetField.Count f = (FacetField.Count) catIter.next(); if (f.getCount() > 0) { - Map<String, Object> catMap = FastMap.newInstance(); - FastList<String> iName = FastList.newInstance(); + Map<String, Object> catMap = new HashMap<String, Object>(); + LinkedList<String> iName = new LinkedList<String>(); iName.addAll(Arrays.asList(f.getName().split("/"))); //Debug.logInfo("topLevel "+topLevel,""); // int l = Integer.parseInt((String) iName.getFirst()); @@ -621,7 +620,7 @@ public abstract class SolrProductSearch client = new HttpSolrClient(SolrUtil.solrUrl); // now lets fetch all products - List<Map<String, Object>> solrDocs = FastList.newInstance(); + List<Map<String, Object>> solrDocs = new ArrayList<Map<String, Object>>(); List<GenericValue> products = delegator.findList("Product", null, null, null, null, true); int numDocs = 0; if (products != null) { Modified: ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrUtil.java?rev=1710122&r1=1710121&r2=1710122&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrUtil.java (original) +++ ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/SolrUtil.java Fri Oct 23 05:52:25 2015 @@ -18,13 +18,12 @@ *******************************************************************************/ package org.ofbiz.solr; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; -import javolution.util.FastMap; - import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrRequest.METHOD; import org.apache.solr.client.solrj.impl.HttpSolrClient; @@ -188,7 +187,7 @@ public abstract class SolrUtil { public static Map<String, Object> categoriesAvailable(String catalogId, String categoryId, String productId, String facetPrefix, boolean displayproducts, int viewIndex, int viewSize) { // create the data model - Map<String, Object> result = FastMap.newInstance(); + Map<String, Object> result = new HashMap<String, Object>(); HttpSolrClient client = null; QueryResponse returnMap = new QueryResponse(); try { |
Free forum by Nabble | Edit this page |