Author: jleroux
Date: Mon Apr 19 09:23:10 2010 New Revision: 935487 URL: http://svn.apache.org/viewvc?rev=935487&view=rev Log: A patch from Bob Morley "Resolve java warnings exposed in Eclipse (Product part of OFBIZ-3100)" https://issues.apache.org/jira/browse/OFBIZ-3587 - OFBIZ-3587 Medium set of changes; most very trivial (adding suppress serial, filling in Collection generics signature, removing or commenting out unused variables, etc. Modified: 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/ProductConfigWorker.java ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapperException.java ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.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/ProductEvents.java ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.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/ProductWorker.java ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.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/packing/PackingSessionLine.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentEvents.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.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/UspsMockApiServlet.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 ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSessionLine.java 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -34,8 +34,6 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityConditionList; -import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.model.ModelEntity; import org.ofbiz.entity.util.EntityFindOptions; 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -25,7 +25,6 @@ import java.util.Map; import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import javax.servlet.jsp.PageContext; import javolution.util.FastList; 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletReq import javolution.util.FastList; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; @@ -139,7 +140,7 @@ public class ProductConfigWorker { if ("VV_FEATURETREE".equals(ProductWorker.getProductVirtualVariantMethod((Delegator)request.getAttribute("delegator"), selectedProductId))) { // get the selected features List<String> selectedFeatures = FastList.newInstance(); - Enumeration paramNames = request.getParameterNames(); + Enumeration<String> paramNames = UtilGenerics.cast(request.getParameterNames()); while (paramNames.hasMoreElements()) { String paramName = (String)paramNames.nextElement(); if (paramName.startsWith("FT" + k + "_" + cnt + "_" + variantIndex)) { 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -44,7 +44,7 @@ import org.ofbiz.service.LocalDispatcher /** * Product Config Wrapper: gets product config to display */ - +@SuppressWarnings("serial") public class ProductConfigWrapper implements Serializable { public static final String module = ProductConfigWrapper.class.getName(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapperException.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapperException.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapperException.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapperException.java Mon Apr 19 09:23:10 2010 @@ -19,6 +19,7 @@ package org.ofbiz.product.config; +@SuppressWarnings("serial") public class ProductConfigWrapperException extends Exception { /** Creates a new instance of ProductConfigWrapperException */ 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -32,7 +32,6 @@ import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityUtil; @@ -202,7 +201,6 @@ public class ProductFeatureServices { // loop through each feature type for (Map.Entry<String, List<GenericValue>> entry: features.entrySet()) { - String currentFeatureType = entry.getKey(); List<GenericValue> currentFeatures = entry.getValue(); List<Map<String, Object>> newCombinations = FastList.newInstance(); @@ -303,7 +301,7 @@ public class ProductFeatureServices { String productCategoryId = (String) context.get("productCategoryId"); // get all the product members of the product category - Map result; + Map<String, Object> result; try { result = dispatcher.runSync("getProductCategoryMembers", UtilMisc.toMap("categoryId", productCategoryId)); } catch (GenericServiceException ex) { Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java Mon Apr 19 09:23:10 2010 @@ -119,7 +119,7 @@ public class InventoryWorker { condList.add(EntityCondition.makeCondition("orderItemStatusId", EntityOperator.NOT_EQUAL, "ITEM_COMPLETED")); condList.add(EntityCondition.makeCondition("orderItemStatusId", EntityOperator.NOT_EQUAL, "ITEM_REJECTED")); condList.add(EntityCondition.makeCondition("orderItemStatusId", EntityOperator.NOT_EQUAL, "ITEM_CANCELLED")); - EntityConditionList conditions = EntityCondition.makeCondition(condList, EntityOperator.AND); + EntityConditionList<EntityCondition> conditions = EntityCondition.makeCondition(condList, EntityOperator.AND); Map<String, BigDecimal> results = FastMap.newInstance(); try { 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -39,8 +39,6 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityConditionList; -import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.product.product.ProductWorker; 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -20,7 +20,6 @@ package org.ofbiz.product.product; import java.io.IOException; import java.sql.Timestamp; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -1060,7 +1060,7 @@ public class ProductEvents { List<GenericValue> compareList = null; if (compareListObj == null) { compareList = FastList.newInstance(); - } else if (!(compareListObj instanceof List)) { + } else if (!(compareListObj instanceof List<?>)) { Debug.logWarning("Session attribute productCompareList contains something other than the expected product list, overwriting.", module); compareList = FastList.newInstance(); } else { 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -70,7 +70,7 @@ public class ProductSearch { public static final String resource = "ProductUiLabels"; public static final String resourceCommon = "CommonUiLabels"; - public static ArrayList parametricKeywordSearch(Map<?, String> featureIdByType, String keywordsString, Delegator delegator, String productCategoryId, String visitId, boolean anyPrefix, boolean anySuffix, boolean isAnd) { + public static ArrayList<String> parametricKeywordSearch(Map<?, String> featureIdByType, String keywordsString, Delegator delegator, String productCategoryId, String visitId, boolean anyPrefix, boolean anySuffix, boolean isAnd) { Set<String> featureIdSet = FastSet.newInstance(); if (featureIdByType != null) { featureIdSet.addAll(featureIdByType.values()); @@ -79,7 +79,7 @@ public class ProductSearch { return parametricKeywordSearch(featureIdSet, keywordsString, delegator, productCategoryId, true, visitId, anyPrefix, anySuffix, isAnd); } - public static ArrayList parametricKeywordSearch(Set<String> featureIdSet, String keywordsString, Delegator delegator, String productCategoryId, boolean includeSubCategories, String visitId, boolean anyPrefix, boolean anySuffix, boolean isAnd) { + public static ArrayList<String> parametricKeywordSearch(Set<String> featureIdSet, String keywordsString, Delegator delegator, String productCategoryId, boolean includeSubCategories, String visitId, boolean anyPrefix, boolean anySuffix, boolean isAnd) { List<ProductSearchConstraint> productSearchConstraintList = FastList.newInstance(); if (UtilValidate.isNotEmpty(productCategoryId)) { @@ -161,7 +161,7 @@ public class ProductSearch { public Set<String> includeCategoryIds = FastSet.newInstance(); public Set<String> excludeCategoryIds = FastSet.newInstance(); - public Set alwaysIncludeCategoryIds = FastSet.newInstance(); + public Set<String> alwaysIncludeCategoryIds = FastSet.newInstance(); public List<Set<String>> includeCategoryIdOrSetAndList = FastList.newInstance(); public List<Set<String>> alwaysIncludeCategoryIdOrSetAndList = FastList.newInstance(); @@ -821,6 +821,7 @@ public class ProductSearch { } + @SuppressWarnings("serial") public static class CatalogConstraint extends ProductSearchConstraint { public static final String constraintName = "Catalog"; protected String prodCatalogId; @@ -894,6 +895,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class CategoryConstraint extends ProductSearchConstraint { public static final String constraintName = "Category"; protected String productCategoryId; @@ -989,6 +991,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class FeatureConstraint extends ProductSearchConstraint { public static final String constraintName = "Feature"; protected String productFeatureId; @@ -1071,6 +1074,7 @@ public class ProductSearch { } + @SuppressWarnings("serial") public static class FeatureCategoryConstraint extends ProductSearchConstraint { public static final String constraintName = "FeatureCategory"; protected String productFeatureCategoryId; @@ -1151,6 +1155,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class FeatureGroupConstraint extends ProductSearchConstraint { public static final String constraintName = "FeatureGroup"; protected String productFeatureGroupId; @@ -1231,6 +1236,7 @@ public class ProductSearch { } + @SuppressWarnings("serial") public static class FeatureSetConstraint extends ProductSearchConstraint { public static final String constraintName = "Feature Set"; protected Set<String> productFeatureIdSet; @@ -1324,6 +1330,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class KeywordConstraint extends ProductSearchConstraint { public static final String constraintName = "Keyword"; protected String keywordsString; @@ -1444,6 +1451,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class LastUpdatedRangeConstraint extends ProductSearchConstraint { public static final String constraintName = "LastUpdatedRange"; protected Timestamp fromDate; @@ -1496,6 +1504,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class StoreGroupPriceConstraint extends ProductSearchConstraint { public static final String constraintName = "StoreGroupPrice"; protected String productStoreGroupId; @@ -1555,6 +1564,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class ListPriceRangeConstraint extends ProductSearchConstraint { public static final String constraintName = "ListPriceRange"; protected BigDecimal lowPrice; @@ -1661,6 +1671,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class SupplierConstraint extends ProductSearchConstraint { public static final String constraintName = "Supplier"; protected String supplierPartyId; @@ -1711,6 +1722,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class ExcludeVariantsConstraint extends ProductSearchConstraint { public static final String constraintName = "ExcludeVariants"; @@ -1742,6 +1754,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class AvailabilityDateConstraint extends ProductSearchConstraint { public static final String constraintName = "AvailabilityDate"; @@ -1773,6 +1786,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class GoodIdentificationConstraint extends ProductSearchConstraint { public static final String constraintName = "GoodIdentification"; protected String goodIdentificationTypeId; @@ -1797,7 +1811,7 @@ public class ProductSearch { productSearchContext.index++; - EntityComparisonOperator operator = EntityOperator.EQUALS; + EntityComparisonOperator<?,?> operator = EntityOperator.EQUALS; if (UtilValidate.isNotEmpty(include) && include == Boolean.FALSE) { operator = EntityOperator.NOT_EQUAL; @@ -1866,6 +1880,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class ProductFieldConstraint extends ProductSearchConstraint { public static final String constraintName = "ProductField"; protected String keyword; @@ -1913,6 +1928,7 @@ public class ProductSearch { // Result Sort Classes // ====================================================================== + @SuppressWarnings("serial") public static abstract class ResultSortOrder implements java.io.Serializable { public ResultSortOrder() { } @@ -1923,6 +1939,7 @@ public class ProductSearch { public abstract boolean isAscending(); } + @SuppressWarnings("serial") public static class SortKeywordRelevancy extends ResultSortOrder { public SortKeywordRelevancy() { } @@ -1952,6 +1969,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class SortProductField extends ResultSortOrder { protected String fieldName; protected boolean ascending; @@ -2008,6 +2026,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class SortProductPrice extends ResultSortOrder { protected String productPriceTypeId; protected String currencyUomId; @@ -2094,6 +2113,7 @@ public class ProductSearch { } } + @SuppressWarnings("serial") public static class SortProductFeature extends ResultSortOrder { protected String productFeatureTypeId; protected boolean ascending; 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -75,6 +75,7 @@ public class ProductSearchSession { public static final String module = ProductSearchSession.class.getName(); + @SuppressWarnings("serial") public static class ProductSearchOptions implements java.io.Serializable { protected List<ProductSearchConstraint> constraintList = null; protected String topProductCategoryId = null; @@ -848,7 +849,7 @@ public class ProductSearchSession { productSearchOptions.setPaging((String) parameters.get("PAGING")); } - public static Map getProductSearchResult(HttpServletRequest request, Delegator delegator, String prodCatalogId) { + public static Map<String, Object> getProductSearchResult(HttpServletRequest request, Delegator delegator, String prodCatalogId) { // ========== Create View Indexes int viewIndex = 0; 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -25,14 +25,19 @@ import java.io.RandomAccessFile; import java.math.BigDecimal; import java.nio.ByteBuffer; import java.sql.Timestamp; -import java.util.*; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; import javolution.util.FastList; import javolution.util.FastMap; import javolution.util.FastSet; import org.jdom.JDOMException; - import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilGenerics; @@ -44,13 +49,12 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityJoinOperator; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityUtil; -import org.ofbiz.product.image.ScaleImage; import org.ofbiz.product.catalog.CatalogWorker; import org.ofbiz.product.category.CategoryWorker; +import org.ofbiz.product.image.ScaleImage; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -83,7 +87,7 @@ public class ProductServices { // * Map selectedFeatures -- Selected features Delegator delegator = dctx.getDelegator(); Locale locale = (Locale) context.get("locale"); - Map selectedFeatures = UtilGenerics.checkMap(context.get("selectedFeatures")); + Map<String, String> selectedFeatures = UtilGenerics.checkMap(context.get("selectedFeatures")); List<GenericValue> products = FastList.newInstance(); // All the variants for this products are retrieved Map<String, Object> resVariants = prodFindAllVariants(dctx, context); @@ -135,10 +139,6 @@ public class ProductServices { public static Map<String, Object> prodFindDistinctVariants(DispatchContext dctx, Map<String, ? extends Object> context) { // * String productId -- Parent (virtual) product ID // * String feature -- Distinct feature name - Delegator delegator = dctx.getDelegator(); - String productId = (String) context.get("productId"); - String feature = (String) context.get("feature"); - return ServiceUtil.returnError("This service has not yet been implemented."); } 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -694,7 +694,7 @@ public class ProductWorker { * @deprecated use getCurrentProductCategories(GenericValue) instead */ @Deprecated - public static List<GenericValue> getCurrentProductCategories(@SuppressWarnings("unused") Delegator delegator, GenericValue product) { + public static List<GenericValue> getCurrentProductCategories(Delegator delegator, GenericValue product) { return getCurrentProductCategories(product); } 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -18,8 +18,18 @@ *******************************************************************************/ package org.ofbiz.product.promo; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.sql.Timestamp; +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; @@ -28,20 +38,13 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityConditionList; -import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityListIterator; -import org.ofbiz.service.*; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; -import java.sql.Timestamp; -import java.util.List; -import java.util.Map; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; +import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.GenericServiceException; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ModelService; +import org.ofbiz.service.ServiceUtil; /** * Promotions Services 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -27,7 +27,6 @@ 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; Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java Mon Apr 19 09:23:10 2010 @@ -39,7 +39,7 @@ public class ProductStoreSurveyWrapper e protected ProductStoreSurveyWrapper() {} - public ProductStoreSurveyWrapper(GenericValue productStoreSurveyAppl, String partyId, Map passThru, Map defaultValues) { + public ProductStoreSurveyWrapper(GenericValue productStoreSurveyAppl, String partyId, Map<String, Object> passThru, Map<String, Object> defaultValues) { this.productStoreSurveyAppl = productStoreSurveyAppl; if (this.productStoreSurveyAppl != null) { @@ -61,7 +61,7 @@ public class ProductStoreSurveyWrapper e this.checkParameters(); } - public ProductStoreSurveyWrapper(GenericValue productStoreSurveyAppl, String partyId, Map passThru) { + public ProductStoreSurveyWrapper(GenericValue productStoreSurveyAppl, String partyId, Map<String, Object> passThru) { this(productStoreSurveyAppl, partyId, passThru, null); } 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -24,7 +24,6 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import javolution.util.FastList; import javolution.util.FastMap; import org.ofbiz.base.util.Debug; 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -26,6 +26,7 @@ import java.util.Map; import javolution.util.FastList; import javolution.util.FastMap; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.entity.GenericValue; import org.ofbiz.service.testtools.OFBizTestCase; @@ -52,21 +53,21 @@ public class StockMovesTest extends OFBi public void testStockMoves() throws Exception { Map<String, Object> fsmnCtx = FastMap.newInstance(); - Map stockMoveHandled = null; - List warningList = FastList.newInstance(); + Map<?,?> stockMoveHandled = null; + List<?> warningList = FastList.newInstance(); fsmnCtx.put("facilityId", "WebStoreWarehouse"); fsmnCtx.put("userLogin", userLogin); Map<String, Object> respMap1 = dispatcher.runSync("findStockMovesNeeded", fsmnCtx); - stockMoveHandled = (Map) respMap1.get("stockMoveHandled"); - warningList = (List) respMap1.get("warningMessageList"); + stockMoveHandled = UtilGenerics.checkMap(respMap1.get("stockMoveHandled")); + warningList = UtilGenerics.checkList(respMap1.get("warningMessageList")); assertNull(warningList); if (stockMoveHandled != null) { fsmnCtx.put("stockMoveHandled", stockMoveHandled); } Map<String, Object> respMap2 = dispatcher.runSync("findStockMovesRecommended", fsmnCtx); - warningList = (List) respMap2.get("warningMessageList"); + warningList = UtilGenerics.checkList(respMap2.get("warningMessageList")); assertNull(warningList); Map<String, Object> ppsmCtx = FastMap.newInstance(); @@ -76,6 +77,6 @@ public class StockMovesTest extends OFBi ppsmCtx.put("targetLocationSeqId", "TLTLTLLL01"); ppsmCtx.put("quantityMoved", new BigDecimal("5")); ppsmCtx.put("userLogin", userLogin); - Map<String, Object> respMap3 = dispatcher.runSync("processPhysicalStockMove", ppsmCtx); + dispatcher.runSync("processPhysicalStockMove", ppsmCtx); } } 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -46,6 +46,7 @@ import org.ofbiz.service.GenericServiceE import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; +@SuppressWarnings("serial") public class PackingSession implements java.io.Serializable { public static final String module = PackingSession.class.getName(); @@ -983,7 +984,7 @@ public class PackingSession implements j setPackageWeight(packageSeqId, newPackageWeight); } - class ItemDisplay extends AbstractMap { + class ItemDisplay extends AbstractMap<Object, Object> { public GenericValue orderItem; public BigDecimal quantity; @@ -1016,7 +1017,7 @@ public class PackingSession implements j } @Override - public Set entrySet() { + public Set<Entry<Object, Object>> entrySet() { return null; } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java Mon Apr 19 09:23:10 2010 @@ -31,6 +31,7 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; +@SuppressWarnings("serial") public class PackingSessionLine implements java.io.Serializable { public final String module = PackingSessionLine.class.getName(); 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=935487&r1=935486&r2=935487&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 Apr 19 09:23:10 2010 @@ -18,25 +18,23 @@ *******************************************************************************/ package org.ofbiz.shipment.picklist; -import java.util.Map; import java.util.List; +import java.util.Map; import javolution.util.FastList; -import org.ofbiz.service.DispatchContext; -import org.ofbiz.service.ServiceUtil; -import org.ofbiz.entity.condition.EntityExpr; -import org.ofbiz.entity.condition.EntityOperator; -import org.ofbiz.entity.condition.EntityConditionList; -import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericEntityException; -import org.ofbiz.entity.GenericValue; -import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilGenerics; +import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.GenericEntityException; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.entity.condition.EntityOperator; +import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.ServiceUtil; public class PickListServices { Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentEvents.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentEvents.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentEvents.java Mon Apr 19 09:23:10 2010 @@ -94,7 +94,6 @@ public class ShipmentEvents { String shipmentId = request.getParameter("shipmentIdReceived"); String forceShipmentReceived = request.getParameter("forceShipmentReceived"); - String orderId = request.getParameter("orderId"); if (UtilValidate.isNotEmpty(shipmentId) && "Y".equals(forceShipmentReceived)) { try { Map<String, Object> inputMap = UtilMisc.<String, Object>toMap("shipmentId", shipmentId, "statusId", "PURCH_SHIP_RECEIVED"); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java Mon Apr 19 09:23:10 2010 @@ -18,28 +18,13 @@ *******************************************************************************/ package org.ofbiz.shipment.shipment; -import java.io.IOException; import java.math.BigDecimal; import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import javolution.util.FastMap; import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.UtilHttp; -import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; -import org.ofbiz.entity.util.EntityUtil; -import org.ofbiz.product.product.ProductWorker; -import org.ofbiz.service.GenericServiceException; -import org.ofbiz.service.LocalDispatcher; -import org.ofbiz.service.ModelService; /** * ShipmentWorker - Worker methods for Shipment and related entities Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java Mon Apr 19 09:23:10 2010 @@ -21,10 +21,6 @@ package org.ofbiz.shipment.thirdparty.dh import java.io.IOException; import java.io.StringWriter; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -41,20 +37,19 @@ import org.ofbiz.base.util.HttpClient; import org.ofbiz.base.util.HttpClientException; import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilDateTime; -import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; -import org.ofbiz.service.ModelService; import org.ofbiz.content.content.ContentWorker; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ModelService; import org.ofbiz.service.ServiceUtil; -import org.ofbiz.service.GenericServiceException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -156,14 +151,9 @@ public class DhlServices { Locale locale = (Locale) context.get("locale"); // some of these can be refactored - String upsRateInquireMode = (String) context.get("upsRateInquireMode"); - String carrierRoleTypeId = (String) context.get("carrierRoleTypeId"); String carrierPartyId = (String) context.get("carrierPartyId"); String shipmentMethodTypeId = (String) context.get("shipmentMethodTypeId"); String shippingContactMechId = (String) context.get("shippingContactMechId"); - List shippableItemInfo = UtilGenerics.checkList(context.get("shippableItemInfo")); - BigDecimal shippableTotal = (BigDecimal) context.get("shippableTotal"); - BigDecimal shippableQuantity = (BigDecimal) context.get("shippableQuantity"); BigDecimal shippableWeight = (BigDecimal) context.get("shippableWeight"); if (shipmentMethodTypeId.equals("NO_SHIPPING")) { @@ -311,21 +301,19 @@ public class DhlServices { return ServiceUtil.returnError(errorList); } // handle Response element info - Element responseElement = UtilXml.firstChildElement( - rateResponseElement, "Shipment"); - Element responseResultElement = UtilXml.firstChildElement( - responseElement, "Result"); - Element responseEstimateDetailElement = UtilXml.firstChildElement( - responseElement, "EstimateDetail"); + Element responseElement = UtilXml.firstChildElement(rateResponseElement, "Shipment"); + //Element responseResultElement = UtilXml.firstChildElement(responseElement, "Result"); + Element responseEstimateDetailElement = UtilXml.firstChildElement(responseElement, "EstimateDetail"); DhlServices.handleErrors(responseElement, errorList); if (UtilValidate.isNotEmpty(errorList)) { return ServiceUtil.returnError(errorList); } - String responseStatusCode = UtilXml.childElementValue( - responseResultElement, "Code"); - String responseStatusDescription = UtilXml.childElementValue( - responseResultElement, "Desc"); + + /* + String responseStatusCode = UtilXml.childElementValue(responseResultElement, "Code"); + String responseStatusDescription = UtilXml.childElementValue(responseResultElement, "Desc"); + */ String dateGenerated = UtilXml.childElementValue( responseEstimateDetailElement, "DateGenerated"); @@ -459,35 +447,27 @@ public class DhlServices { /* * Parse response from DHL registration request to get shipping key */ - public static Map<String, Object> handleDhlRegisterResponse( - Document registerResponseDocument) { + public static Map<String, Object> handleDhlRegisterResponse(Document registerResponseDocument) { List<Object> errorList = FastList.newInstance(); // process RegisterResponse - Element registerResponseElement = registerResponseDocument - .getDocumentElement(); + Element registerResponseElement = registerResponseDocument.getDocumentElement(); DhlServices.handleErrors(registerResponseElement, errorList); if (UtilValidate.isNotEmpty(errorList)) { return ServiceUtil.returnError(errorList); } // handle Response element info - Element responseElement = UtilXml.firstChildElement( - registerResponseElement, "Register"); - Element responseResultElement = UtilXml.firstChildElement( - responseElement, "Result"); + Element responseElement = UtilXml.firstChildElement(registerResponseElement, "Register"); + //Element responseResultElement = UtilXml.firstChildElement(responseElement, "Result"); DhlServices.handleErrors(responseElement, errorList); if (UtilValidate.isNotEmpty(errorList)) { return ServiceUtil.returnError(errorList); } - String responseStatusCode = UtilXml.childElementValue( - responseResultElement, "Code"); - String responseStatusDescription = UtilXml.childElementValue( - responseResultElement, "Desc"); - - String responseShippingKey = UtilXml.childElementValue(responseElement, - "ShippingKey"); - String responsePostalCode = UtilXml.childElementValue(responseElement, - "PostalCode"); + //String responseStatusCode = UtilXml.childElementValue(responseResultElement, "Code"); + //String responseStatusDescription = UtilXml.childElementValue(responseResultElement, "Desc"); + + String responseShippingKey = UtilXml.childElementValue(responseElement,"ShippingKey"); + //String responsePostalCode = UtilXml.childElementValue(responseElement,"PostalCode"); Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("shippingKey", responseShippingKey); @@ -506,7 +486,6 @@ public class DhlServices { GenericValue userLogin = (GenericValue) context.get("userLogin"); String shipmentId = (String) context.get("shipmentId"); String shipmentRouteSegmentId = (String) context.get("shipmentRouteSegmentId"); - Map<String, Object> result = FastMap.newInstance(); String shipmentConfirmResponseString = null; try { GenericValue shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId)); @@ -611,25 +590,26 @@ public class DhlServices { } // loop through Shipment segments (NOTE: only one supported, loop is here for future refactoring reference) - String length = null; - String width = null; - String height = null; BigDecimal packageWeight = null; for (GenericValue shipmentPackageRouteSeg: shipmentPackageRouteSegs) { GenericValue shipmentPackage = shipmentPackageRouteSeg.getRelatedOne("ShipmentPackage"); GenericValue shipmentBoxType = shipmentPackage.getRelatedOne("ShipmentBoxType"); + /* List<GenericValue> carrierShipmentBoxTypes = shipmentPackage.getRelated("CarrierShipmentBoxType", UtilMisc.toMap("partyId", "DHL"), null); GenericValue carrierShipmentBoxType = null; if (carrierShipmentBoxTypes.size() > 0) { carrierShipmentBoxType = carrierShipmentBoxTypes.get(0); } + */ // TODO: determine what default UoM is (assuming inches) - there should be a defaultDimensionUomId in Facility if (shipmentBoxType != null) { + /* GenericValue dimensionUom = shipmentBoxType.getRelatedOne("DimensionUom"); - length = shipmentBoxType.get("boxLength").toString(); - width = shipmentBoxType.get("boxWidth").toString(); - height = shipmentBoxType.get("boxHeight").toString(); + String length = shipmentBoxType.get("boxLength").toString(); + String width = shipmentBoxType.get("boxWidth").toString(); + String height = shipmentBoxType.get("boxHeight").toString(); + */ } // next step is weight determination, so skip if we have a billing weight @@ -778,7 +758,6 @@ public class DhlServices { // NOTE: Must VOID shipments on errors public static Map<String, Object> handleDhlShipmentConfirmResponse(String rateResponseString, GenericValue shipmentRouteSegment, List<GenericValue> shipmentPackageRouteSegs) throws GenericEntityException { - Map<String, Object> result = FastMap.newInstance(); GenericValue shipmentPackageRouteSeg = shipmentPackageRouteSegs.get(0); // TODO: figure out how to handle validation on return XML, which can be mangled @@ -843,6 +822,7 @@ public class DhlServices { return ServiceUtil.returnSuccess("DHL Shipment Confirmed."); } + /* private static BigDecimal getWeight(List<Map<String, Object>> shippableItemInfo) { BigDecimal totalWeight = BigDecimal.ZERO; if (shippableItemInfo != null) { @@ -853,6 +833,7 @@ public class DhlServices { } return totalWeight; } + */ public static Document createAccessRequestDocument() { return createAccessRequestDocument(shipmentPropertiesFile); @@ -919,6 +900,7 @@ public class DhlServices { } +@SuppressWarnings("serial") class DhlConnectException extends GeneralException { DhlConnectException() { super(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java Mon Apr 19 09:23:10 2010 @@ -950,6 +950,7 @@ public class FedexServices { } +@SuppressWarnings("serial") class FedexConnectException extends GeneralException { FedexConnectException() { super(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Mon Apr 19 09:23:10 2010 @@ -90,7 +90,6 @@ public class UpsServices { public static final String dateFormatString = "yyyyMMdd"; public static Map<String, Object> upsShipmentConfirm(DispatchContext dctx, Map<String, ? extends Object> context) { - Map<String, Object> result = FastMap.newInstance(); Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -430,7 +429,7 @@ public class UpsServices { UtilXml.addChildElementValue(serviceElement, "Code", carrierServiceCode, shipmentConfirmRequestDoc); // Child of Shipment: ShipmentServiceOptions - List internationalServiceCodes = UtilMisc.toList("07", "08", "54", "65"); + List<String> internationalServiceCodes = UtilMisc.toList("07", "08", "54", "65"); if (internationalServiceCodes.contains(carrierServiceCode)) { Element shipmentServiceOptionsElement = UtilXml.addChildElement(shipmentElement, "ShipmentServiceOptions", shipmentConfirmRequestDoc); Element internationalFormsElement = UtilXml.addChildElement(shipmentServiceOptionsElement, "InternationalForms", shipmentConfirmRequestDoc); @@ -1507,7 +1506,8 @@ public class UpsServices { } } - public static Map<String, Object> handleUpsTrackShipmentResponse(Document trackResponseDocument, GenericValue shipmentRouteSegment, List shipmentPackageRouteSegs) throws GenericEntityException { + public static Map<String, Object> handleUpsTrackShipmentResponse(Document trackResponseDocument, GenericValue shipmentRouteSegment, + List<GenericValue> shipmentPackageRouteSegs) throws GenericEntityException { // process TrackResponse, update data as needed Element trackResponseElement = trackResponseDocument.getDocumentElement(); @@ -1524,7 +1524,7 @@ public class UpsServices { if ("1".equals(responseStatusCode)) { // TODO: handle other response elements - Element shipmentElement = UtilXml.firstChildElement(trackResponseElement, "Shipment"); + //Element shipmentElement = UtilXml.firstChildElement(trackResponseElement, "Shipment"); //Element shipperElement = UtilXml.firstChildElement(shipmentElement, "Shipper"); //String shipperNumber = UtilXml.childElementValue(shipperElement, "ShipperNumber"); @@ -1535,9 +1535,11 @@ public class UpsServices { //String shipmentIdentificationNumber = UtilXml.childElementValue(shipmentElement, "ShipmentIdentificationNumber"); + /* List<? extends Element> packageElements = UtilXml.childElementList(shipmentElement, "Package"); for (Element packageElement: packageElements) { } + */ /* <Package> <TrackingNumber>1Z12345E1512345676</TrackingNumber> @@ -2680,9 +2682,8 @@ public class UpsServices { Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module); } } - String shipmentAcceptResponseString = null; try { - shipmentAcceptResponseString = sendUpsRequest("ShipAccept", acceptXmlString.toString()); + sendUpsRequest("ShipAccept", acceptXmlString.toString()); } catch (UpsConnectException e) { String uceErrMsg = "Error sending UPS request for UPS Service ShipAccept: " + e.toString(); Debug.logError(e, uceErrMsg, module); @@ -2812,8 +2813,8 @@ public class UpsServices { // shipment info Element shipmentElement = UtilXml.addChildElement(rateRequestElement, "Shipment", rateRequestDoc); - Element rateInformationElement = UtilXml.addChildElement(shipmentElement, "RateInformation", rateRequestDoc); - Element negotiatedRatesIndicatorElement = UtilXml.addChildElement(rateInformationElement, "NegotiatedRatesIndicator", rateRequestDoc); + //Element rateInformationElement = UtilXml.addChildElement(shipmentElement, "RateInformation", rateRequestDoc); + //Element negotiatedRatesIndicatorElement = UtilXml.addChildElement(rateInformationElement, "NegotiatedRatesIndicator", rateRequestDoc); Element shipperElement = UtilXml.addChildElement(shipmentElement, "Shipper", rateRequestDoc); UtilXml.addChildElementValue(shipperElement, "Name", UtilValidate.isNotEmpty(originPostalAddress.getString("toName")) ? originPostalAddress.getString("toName") : "", rateRequestDoc); @@ -3078,6 +3079,7 @@ public class UpsServices { } +@SuppressWarnings("serial") class UpsConnectException extends GeneralException { UpsConnectException() { super(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java Mon Apr 19 09:23:10 2010 @@ -44,6 +44,7 @@ import org.xml.sax.SAXException; /** * USPS Webtools API Mock API Servlet */ +@SuppressWarnings("serial") public class UspsMockApiServlet extends HttpServlet { public static final String module = UspsMockApiServlet.class.getName(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Mon Apr 19 09:23:10 2010 @@ -1565,7 +1565,7 @@ public class UspsServices { for (GenericValue shipmentPackageRouteSeg : shipmentPackageRouteSegs) { Document packageDocument = (Document) requestDocument.cloneNode(true); - Element packageRootElement = requestDocument.getDocumentElement(); + //Element packageRootElement = requestDocument.getDocumentElement(); // This is our reference and can be whatever we want. For lack of a better alternative we'll use shipmentId:shipmentPackageSeqId:shipmentRouteSegmentId String fromCustomsReference = shipmentRouteSegment.getString("shipmentId") + ":" + shipmentRouteSegment.getString("shipmentRouteSegmentId"); fromCustomsReference = StringUtils.join( @@ -1787,6 +1787,7 @@ public class UspsServices { } } +@SuppressWarnings("serial") class UspsRequestException extends GeneralException { UspsRequestException() { super(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServicesTests.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServicesTests.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServicesTests.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServicesTests.java Mon Apr 19 09:23:10 2010 @@ -24,17 +24,12 @@ import java.util.Map; import javolution.util.FastMap; -import junit.framework.TestCase; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.entity.Delegator; -import org.ofbiz.service.GenericDispatcher; -import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ModelService; import org.ofbiz.service.testtools.OFBizTestCase; - /** * Tests for USPS Webtools API services * Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java Mon Apr 19 09:23:10 2010 @@ -41,6 +41,7 @@ import org.ofbiz.service.GenericDispatch import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; +@SuppressWarnings("serial") public class VerifyPickSession implements Serializable { public static final String module = VerifyPickSession.class.getName(); @@ -298,8 +299,6 @@ public class VerifyPickSession implement } public String complete(String orderId, Locale locale) throws GeneralException { - String invoiceId = null; - String invoiceItemSeqId = null; this.checkVerifiedQty(orderId, locale); // check reserved quantity, it should be equal to verified quantity this.checkReservedQty(orderId, locale); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java Mon Apr 19 09:23:10 2010 @@ -33,6 +33,7 @@ import org.ofbiz.entity.GenericValue; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; +@SuppressWarnings("serial") public class VerifyPickSessionRow implements Serializable { protected String orderId = null; Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java Mon Apr 19 09:23:10 2010 @@ -126,7 +126,6 @@ public class WeightPackageServices { } public static Map<String, Object> completePackage(DispatchContext dctx, Map<String, ? extends Object> context) { - Delegator delegator = dctx.getDelegator(); WeightPackageSession weightPackageSession = (WeightPackageSession) context.get("weightPackageSession"); Locale locale = (Locale) context.get("locale"); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java Mon Apr 19 09:23:10 2010 @@ -42,6 +42,7 @@ import org.ofbiz.service.GenericDispatch import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; +@SuppressWarnings("serial") public class WeightPackageSession implements Serializable { public static final String module = WeightPackageSession.class.getName(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSessionLine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSessionLine.java?rev=935487&r1=935486&r2=935487&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSessionLine.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSessionLine.java Mon Apr 19 09:23:10 2010 @@ -20,7 +20,6 @@ package org.ofbiz.shipment.weightPackage import java.math.BigDecimal; import java.util.Map; -import java.io.Serializable; import javolution.util.FastMap; @@ -30,6 +29,7 @@ import org.ofbiz.entity.GenericValue; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; +@SuppressWarnings("serial") public class WeightPackageSessionLine implements java.io.Serializable { protected String orderId = null; |
Free forum by Nabble | Edit this page |