Author: jacopoc
Date: Sat Dec 9 03:29:27 2006 New Revision: 484971 URL: http://svn.apache.org/viewvc?view=rev&rev=484971 Log: Minor code cleanups from Stefan Huehner (OFBIZ-537). Modified: incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java Modified: incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java (original) +++ incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java Sat Dec 9 03:29:27 2006 @@ -681,7 +681,7 @@ String formattedString = null; if (newAmount != null) { double amountDouble = newAmount.doubleValue() * 100; - formattedString = new String(new Integer(new Double(amountDouble).intValue()).toString()); + formattedString = Integer.toString(new Double(amountDouble).intValue()); } return formattedString; } Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original) +++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Sat Dec 9 03:29:27 2006 @@ -1333,7 +1333,7 @@ Double unitPrice = returnItem.getDouble("returnPrice"); if (quantity != null && unitPrice != null) { itemTotal = (quantity.doubleValue() * unitPrice.doubleValue()); - GenericValue newItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemSeqId", new Integer(itemCount).toString())); + GenericValue newItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemSeqId", Integer.toString(itemCount))); newItem.set("orderItemTypeId", orderItem.get("orderItemTypeId")); newItem.set("productId", orderItem.get("productId")); Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java (original) +++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java Sat Dec 9 03:29:27 2006 @@ -573,7 +573,7 @@ int len = cart.size(); String[] arr = new String[len]; for (int i = 0; i < len; i++) { - arr[i] = new Integer(i).toString(); + arr[i] = Integer.toString(i); } return arr; } Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java (original) +++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java Sat Dec 9 03:29:27 2006 @@ -479,7 +479,7 @@ // format the number Double taxAmount = new Double(formatCurrency(taxCalc)); - adjustments.add(delegator.makeValue("OrderAdjustment", UtilMisc.toMap("amount", taxAmount, "orderAdjustmentTypeId", "SALES_TAX", "comments", new Double(taxRate).toString(), "description", "Sales Tax (" + stateCode + ")"))); + adjustments.add(delegator.makeValue("OrderAdjustment", UtilMisc.toMap("amount", taxAmount, "orderAdjustmentTypeId", "SALES_TAX", "comments", Double.toString(taxRate), "description", "Sales Tax (" + stateCode + ")"))); return adjustments; } Modified: incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java (original) +++ incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java Sat Dec 9 03:29:27 2006 @@ -108,7 +108,7 @@ // get the check digit int check = UtilValidate.getLuhnCheckDigit(clubId); - clubId = clubId + new Integer(check).toString(); + clubId = clubId + Integer.toString(check); return clubId; } Modified: incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java (original) +++ incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Sat Dec 9 03:29:27 2006 @@ -1554,7 +1554,7 @@ UtilXml.addChildElementValue(packagingTypeElement, "Description", "Unknown PackagingType", requestDoc); UtilXml.addChildElementValue(packageElement, "Description", "Package Description", requestDoc); Element packageWeightElement = UtilXml.addChildElement(packageElement, "PackageWeight", requestDoc); - UtilXml.addChildElementValue(packageWeightElement, "Weight", new Double(packageWeight).toString(), requestDoc); + UtilXml.addChildElementValue(packageWeightElement, "Weight", Double.toString(packageWeight), requestDoc); } } Modified: incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java (original) +++ incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java Sat Dec 9 03:29:27 2006 @@ -1008,7 +1008,7 @@ } public static String appendCheckDigit(String stPassed) { - String checkDigit = new Integer(getLuhnCheckDigit(stPassed)).toString(); + String checkDigit = Integer.toString(getLuhnCheckDigit(stPassed)); return stPassed + checkDigit; } Modified: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original) +++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Sat Dec 9 03:29:27 2006 @@ -717,7 +717,7 @@ Journal.appendNode(line, "td", "desc", item.getName()); Journal.appendNode(line, "td", "qty", UtilFormatOut.formatQuantity(quantity)); Journal.appendNode(line, "td", "price", UtilFormatOut.formatPrice(subTotal)); - Journal.appendNode(line, "td", "index", new Integer(cart.getItemIndex(item)).toString()); + Journal.appendNode(line, "td", "index", Integer.toString(cart.getItemIndex(item))); if (adjustment != 0) { // append the promo info XModel promo = Journal.appendNode(model, "tr", "", ""); @@ -784,7 +784,7 @@ Journal.appendNode(paymentLine, "td", "desc", descString); Journal.appendNode(paymentLine, "td", "qty", "-"); Journal.appendNode(paymentLine, "td", "price", UtilFormatOut.formatPrice(-1 * amount)); - Journal.appendNode(paymentLine, "td", "index", new Integer(i).toString()); + Journal.appendNode(paymentLine, "td", "index", Integer.toString(i)); } } } Modified: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java?view=diff&rev=484971&r1=484970&r2=484971 ============================================================================== --- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java (original) +++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java Sat Dec 9 03:29:27 2006 @@ -410,7 +410,7 @@ expandMap.put("userId", trans.getUserId()); expandMap.put("orderId", trans.getOrderId()); expandMap.put("dateStamp", dateString); - expandMap.put("drawerNo", new Integer(trans.getDrawerNumber()).toString()); + expandMap.put("drawerNo", Integer.toString(trans.getDrawerNumber())); expandMap.put("taxTotal", UtilFormatOut.padString(UtilFormatOut.formatPrice(trans.getTaxTotal()), priceLength[type], false, ' ')); expandMap.put("grandTotal", UtilFormatOut.padString(UtilFormatOut.formatPrice(trans.getGrandTotal()), priceLength[type], false, ' ')); expandMap.put("totalPayments", UtilFormatOut.padString(UtilFormatOut.formatPrice(trans.getPaymentTotal()), priceLength[type], false, ' ')); |
Free forum by Nabble | Edit this page |