+1 for updating release 4.0 to 1.5 only. Cheers, Tim -- Tim Ruppert HotWax Media http://www.hotwaxmedia.com
o:801.649.6594 f:801.649.6595 On May 29, 2007, at 1:45 PM, Jacques Le Roux wrote:
Hi Scott, It's my mistake, but I'm a bit surprised because if you look athttps://issues.apache.org/jira/browse/OFBIZ-1035 you will see that I hadspotted this issues. At this time we were still using ant build files with source="1.4". And the changes Nicolas made allowed compilation,hence I did not look closer at the code. I should, obviously, looking at"BigDecimal valueOf(double)" from http://tinyurl.com/34y4j3.I wonder why the ant build accepted to compile but there is certainly an explanation I'm not aware. This is not the most inportant and the reasonof my reply. Now that we use source="1.5, should it not be better to restrict usageof the release 4.0 to jdk 1.5. This because such errors will become moreand more difficult to spot while the time will pass. What do you think, folks ? Jacques De : <[EMAIL PROTECTED]>Author: lektran Date: Tue May 29 00:11:12 2007 New Revision: 542435 URL: http://svn.apache.org/viewvc?view=rev&rev=542435 Log: Fixed some code that was incompatible with Java 1.4 Committers, please watch out for this when applying fixes to therelease branchofbiz/branches/release4.0/applications/product/src/org/ofbiz/ product/priModified:ce/PriceServices.javaofbiz/branches/release4.0/applications/product/src/org/ofbiz/ product/priModified:ce/PriceServices.javahttp://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/ product/src/org/ofbiz/product/price/PriceServices.java? view=diff&rev=542435&r1=542434&r2=542435URL:====================================================================== ========ofbiz/branches/release4.0/applications/product/src/org/ofbiz/ product/pri---ce/PriceServices.java (original)ofbiz/branches/release4.0/applications/product/src/org/ofbiz/ product/pri+++ce/PriceServices.java Tue May 29 00:11:12 2007@@ -621,8 +621,8 @@ // okay, now we have the calculated price, see if we shouldadd in tax and if so do itif ("Y".equals(checkIncludeVat) && productStore != null &&"Y".equals(productStore.getString("showPricesWithVatTax"))) {Map calcTaxForDisplayContext =UtilMisc.toMap("productStoreId", productStore.get("productStoreId"),- "productId", productId, "quantity",BigDecimal.valueOf(quantity),- "basePrice", BigDecimal.valueOf(((Double)result.get("price")).doubleValue()));+ "productId", productId, "quantity", newBigDecimal(quantity),+ "basePrice", new BigDecimal(((Double)result.get("price")).doubleValue()));if (UtilValidate.isNotEmpty(partyId)) { calcTaxForDisplayContext.put("billToPartyId",partyId);} @@ -633,25 +633,25 @@return ServiceUtil.returnError("Error calculatingVAT tax (with calcTaxForDisplay service)", null, null, calcTaxForDisplayResult);} // taxTotal, taxPercentage, priceWithTax - result.put("price", Double.valueOf(((BigDecimal)calcTaxForDisplayResult.get("priceWithTax")).doubleValue()));+ result.put("price", new Double(((BigDecimal)calcTaxForDisplayResult.get("priceWithTax")).doubleValue()));// based on the taxPercentage calculate the otheramounts, including: listPrice, defaultPrice, averageCost, promoPrice, competitivePriceBigDecimal taxPercentage = (BigDecimal)calcTaxForDisplayResult.get("taxPercentage");BigDecimal taxMultiplier =ONE_BASE.add(taxPercentage.divide(PERCENT_SCALE, taxCalcScale));if (result.get("listPrice") != null) { - result.put("listPrice", Double.valueOf(BigDecimal.valueOf(((Double)result.get("listPrice")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));+ result.put("listPrice", new Double( newBigDecimal(((Double)result.get("listPrice")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));} if (result.get("defaultPrice") != null) { - result.put("defaultPrice", Double.valueOf(BigDecimal.valueOf(((Double)result.get("defaultPrice")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));+ result.put("defaultPrice", new Double( newBigDecimal(((Double)result.get("defaultPrice")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));} if (result.get("averageCost") != null) { - result.put("averageCost", Double.valueOf(BigDecimal.valueOf(((Double)result.get("averageCost")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));+ result.put("averageCost", new Double( newBigDecimal(((Double)result.get("averageCost")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));} if (result.get("promoPrice") != null) { - result.put("promoPrice", Double.valueOf(BigDecimal.valueOf(((Double)result.get("promoPrice")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));+ result.put("promoPrice", new Double( newBigDecimal(((Double)result.get("promoPrice")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));} if (result.get("competitivePrice") != null) { - result.put("competitivePrice", Double.valueOf(BigDecimal.valueOf(((Double)result.get("competitivePrice")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));+ result.put("competitivePrice", new Double( newBigDecimal(((Double)result.get("competitivePrice")).doubleValue()).multiply (taxMultiplier).setScale( taxFinalScale, taxRounding ).doubleValue()));} } catch (GenericServiceException e) { String errMsg = "Error calculating VAT tax (withcalcTaxForDisplay service): " + e.toString();
smime.p7s
Description: S/MIME cryptographic signature
