You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2008/11/11 03:15:22 UTC

svn commit: r712914 - in /ofbiz/trunk/applications/product/src/org/ofbiz: product/feature/ product/price/ product/product/ product/promo/ shipment/thirdparty/dhl/ shipment/thirdparty/ups/

Author: doogie
Date: Mon Nov 10 18:15:22 2008
New Revision: 712914

URL: http://svn.apache.org/viewvc?rev=712914&view=rev
Log:
s/StringBuffer/StringBuilder/g

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.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/ProductUtilServices.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java?rev=712914&r1=712913&r2=712914&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java Mon Nov 10 18:15:22 2008
@@ -210,7 +210,7 @@
             return "";
         }
         
-        StringBuffer outSb = new StringBuffer();
+        StringBuilder outSb = new StringBuilder();
         Iterator fbtIter = featureIdByType.entrySet().iterator();
         while (fbtIter.hasNext()) {
             Map.Entry entry = (Map.Entry) fbtIter.next();

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=712914&r1=712913&r2=712914&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java Mon Nov 10 18:15:22 2008
@@ -939,7 +939,7 @@
 
             // check all conditions
             boolean allTrue = true;
-            StringBuffer condsDescription = new StringBuffer();
+            StringBuilder condsDescription = new StringBuilder();
             List productPriceConds = delegator.findByAndCache("ProductPriceCond", UtilMisc.toMap("productPriceRuleId", productPriceRuleId));
             Iterator productPriceCondsIter = UtilMisc.toIterator(productPriceConds);
 
@@ -1069,7 +1069,7 @@
                     }
 
                     // add a orderItemPriceInfo element too, without orderId or orderItemId
-                    StringBuffer priceInfoDescription = new StringBuffer();
+                    StringBuilder priceInfoDescription = new StringBuilder();
 
                     priceInfoDescription.append(condsDescription.toString());
                     priceInfoDescription.append("[type:");
@@ -1372,7 +1372,7 @@
                         validPriceFound = true;
                     }
                     // add a orderItemPriceInfo element too, without orderId or orderItemId
-                    StringBuffer priceInfoDescription = new StringBuffer();
+                    StringBuilder priceInfoDescription = new StringBuilder();
                     priceInfoDescription.append("SupplierProduct ");
                     priceInfoDescription.append("[minimumOrderQuantity:");
                     priceInfoDescription.append("" + productSupplier.getDouble("minimumOrderQuantity").doubleValue());

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=712914&r1=712913&r2=712914&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java Mon Nov 10 18:15:22 2008
@@ -760,7 +760,7 @@
                     }
                     
                     /*
-                    StringBuffer lineMsg = new StringBuffer("Got search result line: ");
+                    StringBuilder lineMsg = new StringBuilder("Got search result line: ");
                     Iterator fieldsToSelectIter = fieldsToSelect.iterator();
                     while (fieldsToSelectIter.hasNext()) {
                         String fieldName = (String) fieldsToSelectIter.next();
@@ -900,7 +900,7 @@
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Error finding ProdCatalog information for constraint pretty print", module);
             }
-            StringBuffer ppBuf = new StringBuffer();            
+            StringBuilder ppBuf = new StringBuilder();            
             ppBuf.append(UtilProperties.getMessage(resource, "ProductCatalog", locale)+": ");
             if (prodCatalog != null) {                
                 ppBuf.append(prodCatalog.getString("catalogName"));
@@ -977,7 +977,7 @@
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Error finding ProductCategory information for constraint pretty print", module);
             }
-            StringBuffer ppBuf = new StringBuffer();            
+            StringBuilder ppBuf = new StringBuilder();            
             ppBuf.append(UtilProperties.getMessage(resource, "ProductCategory", locale)+": ");
             if (productCategory != null) {
                 String catInfo = CategoryContentWrapper.getProductCategoryContentAsText(productCategory, "CATEGORY_NAME", locale, null);
@@ -1059,7 +1059,7 @@
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Error finding ProductFeature and Type information for constraint pretty print", module);
             }
-            StringBuffer ppBuf = new StringBuffer();
+            StringBuilder ppBuf = new StringBuilder();
             if (productFeatureType == null) {                                
                 ppBuf.append(UtilProperties.getMessage(resource, "ProductFeature", locale)+": ");
                 ppBuf.append("[" + this.productFeatureId + "]");
@@ -1136,7 +1136,7 @@
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Error finding ProductFeatureCategory and Type information for constraint pretty print", module);
             }
-            StringBuffer ppBuf = new StringBuffer();
+            StringBuilder ppBuf = new StringBuilder();
             if (productFeatureCategory != null) {                                
                 ppBuf.append(UtilProperties.getMessage(resource, "ProductFeatureCategory", locale)+": ");
                 if(productFeatureCategory.get("description") != null) {
@@ -1213,7 +1213,7 @@
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Error finding ProductFeatureGroup and Type information for constraint pretty print", module);
             }
-            StringBuffer ppBuf = new StringBuffer();
+            StringBuilder ppBuf = new StringBuilder();
             if (productFeatureGroup != null) {
                 ppBuf.append(UtilProperties.getMessage(resource, "ProductFeatureGroup", locale) + ": ");
                 if(productFeatureGroup.get("description") != null) {
@@ -1281,7 +1281,7 @@
             }
 
             // add in productSearchConstraint, don't worry about the productSearchResultId or constraintSeqId, those will be fill in later
-            StringBuffer featureIdInfo = new StringBuffer();
+            StringBuilder featureIdInfo = new StringBuilder();
             Iterator featureIdIter = this.productFeatureIdSet.iterator();
             while (featureIdIter.hasNext()) {
                 String featureId = (String) featureIdIter.next();
@@ -1295,7 +1295,7 @@
         }
 
         public String prettyPrintConstraint(GenericDelegator delegator, boolean detailed, Locale locale) {
-            StringBuffer infoOut = new StringBuffer();
+            StringBuilder infoOut = new StringBuilder();
             try {
                 Iterator featureIdIter = this.productFeatureIdSet.iterator();
                 while (featureIdIter.hasNext()) {
@@ -1429,7 +1429,7 @@
 
         /** pretty print for log messages and even UI stuff */
         public String prettyPrintConstraint(GenericDelegator delegator, boolean detailed, Locale locale) {
-            StringBuffer ppBuf = new StringBuffer();
+            StringBuilder ppBuf = new StringBuilder();
             ppBuf.append(UtilProperties.getMessage(resource, "ProductKeywords", locale) + ": \"");
             ppBuf.append(this.keywordsString + "\", " + UtilProperties.getMessage(resource, "ProductKeywordWhere", locale) + " ");
             ppBuf.append(isAnd ? UtilProperties.getMessage(resource, "ProductKeywordAllWordsMatch", locale) : UtilProperties.getMessage(resource, "ProductKeywordAnyWordMatches", locale));            
@@ -1552,7 +1552,7 @@
         }
 
         public String prettyPrintConstraint(GenericDelegator delegator, boolean detailed, Locale locale) {
-            StringBuffer buff = new StringBuffer();
+            StringBuilder buff = new StringBuilder();
             buff.append("Product Store Mandatory Price Constraint: ");
             buff.append("Product Store Group ["+productStoreGroupId+"], ");
             buff.append("Product Price Type ["+productPriceTypeId+"], ");
@@ -1626,7 +1626,7 @@
                 // dummy constraint, no values
                 return null;
             }
-            StringBuffer msgBuf = new StringBuffer();
+            StringBuilder msgBuf = new StringBuilder();
             msgBuf.append(UtilProperties.getMessage(resource, "ListPriceRange", locale));
             msgBuf.append(": ");
             
@@ -1834,7 +1834,7 @@
                 return null;
             }
             
-            StringBuffer msgBuf = new StringBuffer();
+            StringBuilder msgBuf = new StringBuilder();
             
             if (UtilValidate.isNotEmpty(include) && include == Boolean.FALSE) {
                 msgBuf.append(UtilProperties.getMessage(resourceCommon, "CommonExclude", locale));

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=712914&r1=712913&r2=712914&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Mon Nov 10 18:15:22 2008
@@ -970,7 +970,7 @@
         return makeSearchParametersString(getProductSearchOptions(session));
     }
     public static String makeSearchParametersString(ProductSearchOptions productSearchOptions) {
-        StringBuffer searchParamString = new StringBuffer();
+        StringBuilder searchParamString = new StringBuilder();
 
         List constraintList = productSearchOptions.getConstraintList();
         Iterator constraintIter = constraintList.iterator();

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java?rev=712914&r1=712913&r2=712914&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java Mon Nov 10 18:15:22 2008
@@ -603,7 +603,7 @@
 while (allCatIter.hasNext()) {
    cat = allCatIter.next();
    if (UtilValidate.isEmpty(cat.getString("description"))) {
-       StringBuffer description = new StringBuffer(cat.getString("longDescription").toLowerCase());
+       StringBuilder description = new StringBuilder(cat.getString("longDescription").toLowerCase());
        description.setCharAt(0, Character.toUpperCase(description.charAt(0)));
        for (int i=0; i<description.length() - 1; i++) {
            if (description.charAt(i) == ' ') {

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=712914&r1=712913&r2=712914&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java Mon Nov 10 18:15:22 2008
@@ -403,7 +403,7 @@
                     if (UtilValidate.isNotEmpty(distFeatures)) {
                         // Debug.logInfo("Found distinguishing features: " + distFeatures, module);
                         
-                        StringBuffer nameBuf = new StringBuffer();
+                        StringBuilder nameBuf = new StringBuilder();
                         Iterator distFeatIter = distFeatures.iterator();
                         while (distFeatIter.hasNext()) {
                             GenericValue productFeature = (GenericValue) distFeatIter.next();

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=712914&r1=712913&r2=712914&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java Mon Nov 10 18:15:22 2008
@@ -57,7 +57,7 @@
         //GenericValue promoItem = null;
         //GenericValue newItem = null;
 
-        StringBuffer bankOfNumbers = new StringBuffer();
+        StringBuilder bankOfNumbers = new StringBuilder();
         for (long i = 0; i < quantity.longValue(); i++) {
             Map createProductPromoCodeMap = null;
             try {

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=712914&r1=712913&r2=712914&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 Nov 10 18:15:22 2008
@@ -814,7 +814,7 @@
         
         // TODO: this is a temporary hack to replace the newlines so that Base64 likes the input This is NOT platform independent
         int size = encodedImageString.length();
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < size; i++) {
             if (encodedImageString.charAt(i) == '\n')
                 continue;
@@ -889,7 +889,7 @@
         if (UtilValidate.isNotEmpty(faultElements)) {
             Iterator errorElementIter = faultElements.iterator();
             while (errorElementIter.hasNext()) {
-                StringBuffer errorMessageBuf = new StringBuffer();
+                StringBuilder errorMessageBuf = new StringBuilder();
                 Element errorElement = (Element) errorElementIter.next();
 
                 String errorCode = UtilXml.childElementValue(errorElement,

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=712914&r1=712913&r2=712914&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 Nov 10 18:15:22 2008
@@ -196,7 +196,7 @@
             }
             String ordersDescription = "";
             if (orderIdSet.size() > 1) {
-                StringBuffer odBuf = new StringBuffer("Orders ");
+                StringBuilder odBuf = new StringBuilder("Orders ");
                 Iterator orderIdIter = orderIdSet.iterator();
                 while (orderIdIter.hasNext()) {
                     String orderId = (String) orderIdIter.next();
@@ -535,7 +535,7 @@
             // connect to UPS server, send AccessRequest to auth
             // send ShipmentConfirmRequest String
             // get ShipmentConfirmResponse String back
-            StringBuffer xmlString = new StringBuffer();
+            StringBuilder xmlString = new StringBuilder();
             // TODO: note that we may have to append <?xml version="1.0"?> before each string
             xmlString.append(accessRequestString);
             xmlString.append(shipmentConfirmRequestString);
@@ -696,7 +696,7 @@
                 
             // -=-=-=- Okay, now done with that, just return any extra info...
             
-            StringBuffer successString = new StringBuffer("The UPS ShipmentConfirm succeeded");
+            StringBuilder successString = new StringBuilder("The UPS ShipmentConfirm succeeded");
             if (errorList.size() > 0) {
                 // this shouldn't happen much, but handle it anyway
                 successString.append(", but the following occurred: ");
@@ -796,7 +796,7 @@
             // connect to UPS server, send AccessRequest to auth
             // send ShipmentConfirmRequest String
             // get ShipmentConfirmResponse String back
-            StringBuffer xmlString = new StringBuffer();
+            StringBuilder xmlString = new StringBuilder();
             // TODO: note that we may have to append <?xml version="1.0"?> before each string
             xmlString.append(accessRequestString);
             xmlString.append(shipmentAcceptRequestString);
@@ -1063,7 +1063,7 @@
             }
                 
             // -=-=-=- Okay, now done with that, just return any extra info...
-            StringBuffer successString = new StringBuffer("The UPS ShipmentAccept succeeded");
+            StringBuilder successString = new StringBuilder("The UPS ShipmentAccept succeeded");
             if (errorList.size() > 0) {
                 // this shouldn't happen much, but handle it anyway
                 successString.append(", but the following occurred: ");
@@ -1158,7 +1158,7 @@
             // connect to UPS server, send AccessRequest to auth
             // send ShipmentConfirmRequest String
             // get ShipmentConfirmResponse String back
-            StringBuffer xmlString = new StringBuffer();
+            StringBuilder xmlString = new StringBuilder();
             // TODO: note that we may have to append <?xml version="1.0"?> before each string
             xmlString.append(accessRequestString);
             xmlString.append(voidShipmentRequestString);
@@ -1251,7 +1251,7 @@
             shipmentRouteSegment.store();
             
             // -=-=-=- Okay, now done with that, just return any extra info...
-            StringBuffer successString = new StringBuffer("The UPS VoidShipment succeeded; the StatusType is: [" + statusTypeCode + ":" + statusTypeDescription + "], the StatusCode is: [" + statusCodeCode + ":" + statusCodeDescription + "]");
+            StringBuilder successString = new StringBuilder("The UPS VoidShipment succeeded; the StatusType is: [" + statusTypeCode + ":" + statusTypeDescription + "], the StatusCode is: [" + statusCodeCode + ":" + statusCodeDescription + "]");
             if (errorList.size() > 0) {
                 // this shouldn't happen much, but handle it anyway
                 successString.append(", but the following occurred: ");
@@ -1349,7 +1349,7 @@
             // connect to UPS server, send AccessRequest to auth
             // send ShipmentConfirmRequest String
             // get ShipmentConfirmResponse String back
-            StringBuffer xmlString = new StringBuffer();
+            StringBuilder xmlString = new StringBuilder();
             // TODO: note that we may have to append <?xml version="1.0"?> before each string
             xmlString.append(accessRequestString);
             xmlString.append(trackRequestString);
@@ -1481,7 +1481,7 @@
 
 
             // -=-=-=- Okay, now done with that, just return any extra info...
-            StringBuffer successString = new StringBuffer("The UPS TrackShipment succeeded");
+            StringBuilder successString = new StringBuilder("The UPS TrackShipment succeeded");
             if (errorList.size() > 0) {
                 // this shouldn't happen much, but handle it anyway
                 successString.append(", but the following occurred: ");
@@ -1789,7 +1789,7 @@
         List errorElements = UtilXml.childElementList(responseElement, "Error");
         Iterator errorElementIter = errorElements.iterator();
         while (errorElementIter.hasNext()) {
-            StringBuffer errorMessageBuf = new StringBuffer();
+            StringBuilder errorMessageBuf = new StringBuilder();
             Element errorElement = (Element) errorElementIter.next();
 
             String errorSeverity = UtilXml.childElementValue(errorElement, "ErrorSeverity");
@@ -2087,7 +2087,7 @@
         }
 
         // prepare the access/inquire request string
-        StringBuffer xmlString = new StringBuffer();
+        StringBuilder xmlString = new StringBuilder();
         xmlString.append(accessRequestString);
         xmlString.append(rateRequestString);
         if (Debug.verboseOn()) Debug.logVerbose(xmlString.toString(), module);       
@@ -2178,7 +2178,7 @@
         }
 
         // prepare the request string
-        StringBuffer xmlString = new StringBuffer();
+        StringBuilder xmlString = new StringBuilder();
         xmlString.append(accessRequestString);
         xmlString.append(avRequestString);
         Debug.logInfo(xmlString.toString(), module);