Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571) No functional change. We read at http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html : <<Using the integer fields in this class (such as ROUND_HALF_UP) to represent rounding mode is largely obsolete; the enumeration values of the RoundingMode enum, (such as RoundingMode.HALF_UP) should be used instead.>> That's an easy global replacement. But it also needs to import the RoundingMode class. It was 26 files so I decided to rather clean all the imports in all files with the help of Eclipse. This is a 1st step. I will need to closely look at 2 special class: UtilNumber and Calculate. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804953 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+11
-11
@@ -25,24 +25,24 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ofbiz.service.DispatchContext;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtil;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
|
||||
import org.apache.ofbiz.order.order.OrderReadHelper;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtil;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.order.finaccount.FinAccountHelper;
|
||||
import org.apache.ofbiz.order.order.OrderReadHelper;
|
||||
import org.apache.ofbiz.service.DispatchContext;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
|
||||
/**
|
||||
* FinAccountProductServices - Financial Accounts created from product purchases (i.e. gift certificates)
|
||||
|
||||
+4
-3
@@ -19,6 +19,7 @@
|
||||
package org.apache.ofbiz.accounting.tax;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -449,15 +450,15 @@ public class TaxAuthorityServices {
|
||||
// itemQuantity = 3;
|
||||
// taxAmountIncludedInFullPrice = (43-(43/(1+(20/100))))*3 = 21.51
|
||||
taxAdjValue.set("orderAdjustmentTypeId", "VAT_TAX");
|
||||
BigDecimal taxAmountIncludedInFullPrice = itemPrice.subtract(itemPrice.divide(BigDecimal.ONE.add(taxRate.divide(PERCENT_SCALE, 4, BigDecimal.ROUND_HALF_UP)), 2, BigDecimal.ROUND_HALF_UP)).multiply(itemQuantity);
|
||||
BigDecimal taxAmountIncludedInFullPrice = itemPrice.subtract(itemPrice.divide(BigDecimal.ONE.add(taxRate.divide(PERCENT_SCALE, 4, RoundingMode.HALF_UP)), 2, RoundingMode.HALF_UP)).multiply(itemQuantity);
|
||||
// If 1 quantity has 50% discount then itemAmount = 107.5 otherwise 129 (In case of no discount)
|
||||
// Net price for each item
|
||||
// netItemPrice = itemAmount / quantity = 107.5 / 3 = 35.833333333
|
||||
BigDecimal netItemPrice = itemAmount.divide(itemQuantity, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal netItemPrice = itemAmount.divide(itemQuantity, RoundingMode.HALF_UP);
|
||||
// Calculate tax on the discounted price, be sure to round to 2 decimal places before multiplying by quantity
|
||||
// netTax = (netItemPrice - netItemPrice / (1 + (taxRate/100))) * quantity
|
||||
// netTax = (35.833333333-(35.833333333/(1+(20/100))))*3 = 17.92
|
||||
BigDecimal netTax = netItemPrice.subtract(netItemPrice.divide(BigDecimal.ONE.add(taxRate.divide(PERCENT_SCALE, 4, BigDecimal.ROUND_HALF_UP)), 2, BigDecimal.ROUND_HALF_UP)).multiply(itemQuantity);
|
||||
BigDecimal netTax = netItemPrice.subtract(netItemPrice.divide(BigDecimal.ONE.add(taxRate.divide(PERCENT_SCALE, 4, RoundingMode.HALF_UP)), 2, RoundingMode.HALF_UP)).multiply(itemQuantity);
|
||||
//Subtract net tax from base tax (taxAmountIncludedFullPrice) to get the negative promotion tax adjustment amount
|
||||
// discountedSalesTax = 17.92 - 21.51 = −3.59 (If no discounted item quantity then discountedSalesTax will be ZERO)
|
||||
discountedSalesTax = netTax.subtract(taxAmountIncludedInFullPrice);
|
||||
|
||||
+2
-2
@@ -22,8 +22,6 @@ package org.apache.ofbiz.accounting.thirdparty.clearcommerce;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
@@ -31,6 +29,8 @@ import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
import org.apache.ofbiz.service.testtools.OFBizTestCase;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class CCServicesTest extends OFBizTestCase {
|
||||
|
||||
public static final String module = CCServicesTest.class.getName();
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ package org.apache.ofbiz.accounting.thirdparty.eway;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
@@ -94,7 +95,7 @@ public class GatewayResponse {
|
||||
public BigDecimal getTransactionAmount() {
|
||||
BigDecimal amt = new BigDecimal(getReturnAmount());
|
||||
amt = amt.divide(new BigDecimal(100));
|
||||
return amt.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
return amt.setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public boolean getTrxnStatus() {
|
||||
|
||||
+12
-12
@@ -256,10 +256,10 @@ public class PayPalServices {
|
||||
}
|
||||
String estimateLabel = shipMethod.getString("partyId") + " - " + shipMethod.getString("description");
|
||||
encoder.add("L_SHIPINGPOPTIONLABEL" + line, estimateLabel);
|
||||
encoder.add("L_SHIPPINGOPTIONAMOUNT" + line, estimate.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
encoder.add("L_SHIPPINGOPTIONAMOUNT" + line, estimate.setScale(2, RoundingMode.HALF_UP).toPlainString());
|
||||
// Just make this first one default for now
|
||||
encoder.add("L_SHIPPINGOPTIONISDEFAULT" + line, line == 0 ? "true" : "false");
|
||||
encoder.add("L_TAXAMT" + line, cart.getTotalSalesTax().setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
encoder.add("L_TAXAMT" + line, cart.getTotalSalesTax().setScale(2, RoundingMode.HALF_UP).toPlainString());
|
||||
line++;
|
||||
}
|
||||
String responseMsg = null;
|
||||
@@ -317,14 +317,14 @@ public class PayPalServices {
|
||||
for (ShoppingCartItem item : cart.items()) {
|
||||
encoder.add("L_NUMBER" + line, item.getProductId());
|
||||
encoder.add("L_NAME" + line, item.getName());
|
||||
encoder.add("L_AMT" + line, item.getBasePrice().setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
encoder.add("L_AMT" + line, item.getBasePrice().setScale(2, RoundingMode.HALF_UP).toPlainString());
|
||||
encoder.add("L_QTY" + line, item.getQuantity().toBigInteger().toString());
|
||||
line++;
|
||||
BigDecimal otherAdjustments = item.getOtherAdjustments();
|
||||
if (otherAdjustments.compareTo(BigDecimal.ZERO) != 0) {
|
||||
encoder.add("L_NUMBER" + line, item.getProductId());
|
||||
encoder.add("L_NAME" + line, item.getName() + " Adjustments");
|
||||
encoder.add("L_AMT" + line, otherAdjustments.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
encoder.add("L_AMT" + line, otherAdjustments.setScale(2, RoundingMode.HALF_UP).toPlainString());
|
||||
encoder.add("L_QTY" + line, "1");
|
||||
line++;
|
||||
}
|
||||
@@ -333,7 +333,7 @@ public class PayPalServices {
|
||||
if (otherAdjustments.compareTo(BigDecimal.ZERO) != 0) {
|
||||
encoder.add("L_NUMBER" + line, "N/A");
|
||||
encoder.add("L_NAME" + line, "Order Adjustments");
|
||||
encoder.add("L_AMT" + line, otherAdjustments.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
encoder.add("L_AMT" + line, otherAdjustments.setScale(2, RoundingMode.HALF_UP).toPlainString());
|
||||
encoder.add("L_QTY" + line, "1");
|
||||
line++;
|
||||
}
|
||||
@@ -657,7 +657,7 @@ public class PayPalServices {
|
||||
String paymentMethodId = (String) outMap.get("paymentMethodId");
|
||||
|
||||
cart.clearPayments();
|
||||
BigDecimal maxAmount = cart.getGrandTotal().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal maxAmount = cart.getGrandTotal().setScale(2, RoundingMode.HALF_UP);
|
||||
cart.addPaymentAmount(paymentMethodId, maxAmount, true);
|
||||
|
||||
return ServiceUtil.returnSuccess();
|
||||
@@ -695,9 +695,9 @@ public class PayPalServices {
|
||||
encoder.add("AMT", processAmount.setScale(2).toPlainString());
|
||||
encoder.add("CURRENCYCODE", orh.getCurrency());
|
||||
BigDecimal grandTotal = orh.getOrderGrandTotal();
|
||||
BigDecimal shippingTotal = orh.getShippingTotal().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal taxTotal = orh.getTaxTotal().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal subTotal = grandTotal.subtract(shippingTotal).subtract(taxTotal).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal shippingTotal = orh.getShippingTotal().setScale(2, RoundingMode.HALF_UP);
|
||||
BigDecimal taxTotal = orh.getTaxTotal().setScale(2, RoundingMode.HALF_UP);
|
||||
BigDecimal subTotal = grandTotal.subtract(shippingTotal).subtract(taxTotal).setScale(2, RoundingMode.HALF_UP);
|
||||
encoder.add("ITEMAMT", subTotal.toPlainString());
|
||||
encoder.add("SHIPPINGAMT", shippingTotal.toPlainString());
|
||||
encoder.add("TAXAMT", taxTotal.toPlainString());
|
||||
@@ -759,7 +759,7 @@ public class PayPalServices {
|
||||
NVPEncoder encoder = new NVPEncoder();
|
||||
encoder.add("METHOD", "DoAuthorization");
|
||||
encoder.add("TRANSACTIONID", payPalPaymentMethod.getString("transactionId"));
|
||||
encoder.add("AMT", processAmount.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
encoder.add("AMT", processAmount.setScale(2, RoundingMode.HALF_UP).toPlainString());
|
||||
encoder.add("TRANSACTIONENTITY", "Order");
|
||||
String currency = (String) context.get("currency");
|
||||
if (currency == null) {
|
||||
@@ -816,7 +816,7 @@ public class PayPalServices {
|
||||
NVPEncoder encoder = new NVPEncoder();
|
||||
encoder.add("METHOD", "DoCapture");
|
||||
encoder.add("AUTHORIZATIONID", authTrans.getString("referenceNum"));
|
||||
encoder.add("AMT", captureAmount.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
encoder.add("AMT", captureAmount.setScale(2, RoundingMode.HALF_UP).toPlainString());
|
||||
encoder.add("CURRENCYCODE", authTrans.getString("currencyUomId"));
|
||||
encoder.add("COMPLETETYPE", "NotComplete");
|
||||
|
||||
@@ -920,7 +920,7 @@ public class PayPalServices {
|
||||
encoder.add("TRANSACTIONID", captureTrans.getString("referenceNum"));
|
||||
encoder.add("REFUNDTYPE", "Partial");
|
||||
encoder.add("CURRENCYCODE", captureTrans.getString("currencyUomId"));
|
||||
encoder.add("AMT", refundAmount.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
|
||||
encoder.add("AMT", refundAmount.setScale(2, RoundingMode.HALF_UP).toPlainString());
|
||||
encoder.add("NOTE", "Order #" + orderPaymentPreference.getString("orderId"));
|
||||
NVPDecoder decoder = null;
|
||||
try {
|
||||
|
||||
+5
-5
@@ -68,7 +68,7 @@ public class SecurePayPaymentServices {
|
||||
int amont;
|
||||
|
||||
if (enableamountround.equals("Y")) {
|
||||
newAmount = new BigDecimal(processAmount.setScale(0, BigDecimal.ROUND_HALF_UP)+".00");
|
||||
newAmount = new BigDecimal(processAmount.setScale(0, RoundingMode.HALF_UP)+".00");
|
||||
} else {
|
||||
newAmount = processAmount;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public class SecurePayPaymentServices {
|
||||
int amont;
|
||||
|
||||
if (enableamountround.equals("Y")) {
|
||||
newAmount = new BigDecimal(captureAmount.setScale(0, BigDecimal.ROUND_HALF_UP)+".00");
|
||||
newAmount = new BigDecimal(captureAmount.setScale(0, RoundingMode.HALF_UP)+".00");
|
||||
} else {
|
||||
newAmount = captureAmount;
|
||||
}
|
||||
@@ -242,7 +242,7 @@ public class SecurePayPaymentServices {
|
||||
int amont;
|
||||
|
||||
if (enableamountround.equals("Y")) {
|
||||
newAmount = new BigDecimal(releaseAmount.setScale(0, BigDecimal.ROUND_HALF_UP)+".00");
|
||||
newAmount = new BigDecimal(releaseAmount.setScale(0, RoundingMode.HALF_UP)+".00");
|
||||
} else {
|
||||
newAmount = releaseAmount;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ public class SecurePayPaymentServices {
|
||||
BigDecimal newAmount = null;
|
||||
|
||||
if (enableamountround.equals("Y")) {
|
||||
newAmount = new BigDecimal(refundAmount.setScale(0, BigDecimal.ROUND_HALF_UP)+".00");
|
||||
newAmount = new BigDecimal(refundAmount.setScale(0, RoundingMode.HALF_UP)+".00");
|
||||
} else {
|
||||
newAmount = refundAmount;
|
||||
}
|
||||
@@ -401,7 +401,7 @@ public class SecurePayPaymentServices {
|
||||
int amont;
|
||||
|
||||
if (enableamountround.equals("Y")) {
|
||||
newAmount = new BigDecimal(creditAmount.setScale(0, BigDecimal.ROUND_HALF_UP)+".00");
|
||||
newAmount = new BigDecimal(creditAmount.setScale(0, RoundingMode.HALF_UP)+".00");
|
||||
} else {
|
||||
newAmount = creditAmount;
|
||||
}
|
||||
|
||||
@@ -23,15 +23,15 @@ import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
|
||||
+3
-3
@@ -27,12 +27,12 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.webapp.stats.VisitHandler;
|
||||
import org.apache.ofbiz.content.content.ContentSearch.ResultSortOrder;
|
||||
import org.apache.ofbiz.content.content.ContentSearch.ContentSearchConstraint;
|
||||
import org.apache.ofbiz.content.content.ContentSearch.ContentSearchContext;
|
||||
import org.apache.ofbiz.content.content.ContentSearch.ResultSortOrder;
|
||||
import org.apache.ofbiz.content.content.ContentSearchSession.ContentSearchOptions;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.webapp.stats.VisitHandler;
|
||||
|
||||
|
||||
public class ContentSearchEvents {
|
||||
|
||||
+2
-2
@@ -32,10 +32,10 @@ import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.util.UtilHttp;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.content.content.ContentSearch.ContentSearchConstraint;
|
||||
import org.apache.ofbiz.content.content.ContentSearch.ResultSortOrder;
|
||||
import org.apache.ofbiz.content.content.ContentSearch.SortKeywordRelevancy;
|
||||
import org.apache.ofbiz.content.content.ContentSearch.ContentSearchConstraint;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
|
||||
public class ContentSearchSession {
|
||||
|
||||
|
||||
+1
-1
@@ -26,8 +26,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilHttp;
|
||||
import org.apache.ofbiz.webapp.control.ConfigXMLReader;
|
||||
import org.apache.ofbiz.webapp.control.RequestHandler;
|
||||
import org.apache.ofbiz.webapp.control.ConfigXMLReader.RequestMap;
|
||||
import org.apache.ofbiz.webapp.control.RequestHandler;
|
||||
import org.apache.ofbiz.webapp.control.WebAppConfigurationException;
|
||||
import org.apache.ofbiz.webapp.event.EventHandlerException;
|
||||
|
||||
|
||||
+5
-5
@@ -29,6 +29,11 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilCodec;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.webapp.WebAppUtil;
|
||||
|
||||
import freemarker.core.Environment;
|
||||
import freemarker.ext.beans.BeanModel;
|
||||
@@ -38,11 +43,6 @@ import freemarker.template.SimpleNumber;
|
||||
import freemarker.template.SimpleScalar;
|
||||
import freemarker.template.TemplateModelException;
|
||||
import freemarker.template.TemplateTransformModel;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.webapp.WebAppUtil;
|
||||
|
||||
public class OfbizContentAltUrlTransforms implements TemplateTransformModel {
|
||||
public final static String module = OfbizContentAltUrlTransforms.class.getName();
|
||||
|
||||
@@ -22,8 +22,10 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
|
||||
+3
-2
@@ -20,6 +20,7 @@
|
||||
package org.apache.ofbiz.manufacturing.bom;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -671,10 +672,10 @@ public class BOMServices {
|
||||
productDepth = BigDecimal.ONE;
|
||||
}
|
||||
|
||||
BigDecimal firstMaxNumOfProducts = boxWidth.subtract(totalWidth).divide(productDepth, 0, BigDecimal.ROUND_FLOOR);
|
||||
BigDecimal firstMaxNumOfProducts = boxWidth.subtract(totalWidth).divide(productDepth, 0, RoundingMode.FLOOR);
|
||||
if (firstMaxNumOfProducts.compareTo(BigDecimal.ZERO) == 0) firstMaxNumOfProducts = BigDecimal.ONE;
|
||||
//
|
||||
BigDecimal maxNumOfProducts = boxWidth.divide(productDepth, 0, BigDecimal.ROUND_FLOOR);
|
||||
BigDecimal maxNumOfProducts = boxWidth.divide(productDepth, 0, RoundingMode.FLOOR);
|
||||
if (maxNumOfProducts.compareTo(BigDecimal.ZERO) == 0) maxNumOfProducts = BigDecimal.ONE;
|
||||
|
||||
BigDecimal remQuantity = quantity;
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@
|
||||
package org.apache.ofbiz.manufacturing.jobshopmgt;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
@@ -207,7 +208,7 @@ public class ProductionRun {
|
||||
for (Iterator<GenericValue> iter = productionRunComponents.iterator(); iter.hasNext();) {
|
||||
GenericValue component = iter.next();
|
||||
componentQuantity = component.getBigDecimal("estimatedQuantity");
|
||||
component.set("estimatedQuantity", componentQuantity.divide(previousQuantity, 10, BigDecimal.ROUND_HALF_UP).multiply(newQuantity).doubleValue());
|
||||
component.set("estimatedQuantity", componentQuantity.divide(previousQuantity, 10, RoundingMode.HALF_UP).multiply(newQuantity).doubleValue());
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
+2
-2
@@ -31,14 +31,14 @@ import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.webapp.stats.VisitHandler;
|
||||
import org.apache.ofbiz.webapp.website.WebSiteWorker;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.product.category.CategoryWorker;
|
||||
import org.apache.ofbiz.webapp.stats.VisitHandler;
|
||||
import org.apache.ofbiz.webapp.website.WebSiteWorker;
|
||||
|
||||
/**
|
||||
* Events used for maintaining TrackingCode related information
|
||||
|
||||
@@ -21,6 +21,7 @@ package org.apache.ofbiz.order.order;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -42,7 +43,6 @@ import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Order Events
|
||||
|
||||
+17
-3
@@ -18,15 +18,29 @@
|
||||
*/
|
||||
package org.apache.ofbiz.order.requirement;
|
||||
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.ofbiz.base.util.*;
|
||||
import org.apache.ofbiz.entity.condition.*;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.condition.EntityCondition;
|
||||
import org.apache.ofbiz.entity.condition.EntityConditionList;
|
||||
import org.apache.ofbiz.entity.condition.EntityExpr;
|
||||
import org.apache.ofbiz.entity.condition.EntityOperator;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtil;
|
||||
import org.apache.ofbiz.order.order.OrderReadHelper;
|
||||
|
||||
+3
-2
@@ -21,6 +21,7 @@ package org.apache.ofbiz.order.shoppingcart;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -3794,7 +3795,7 @@ public class ShoppingCart implements Iterable<ShoppingCartItem>, Serializable {
|
||||
Delegator delegator = this.getDelegator();
|
||||
List<GenericValue> allOpPrefs = new LinkedList<GenericValue>();
|
||||
BigDecimal remainingAmount = this.getGrandTotal().subtract(this.getPaymentTotal());
|
||||
remainingAmount = remainingAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
remainingAmount = remainingAmount.setScale(2, RoundingMode.HALF_UP);
|
||||
if (getBillingAccountId() != null && this.billingAccountAmt.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
BigDecimal billingAccountAvailableAmount = CheckOutHelper.availableAccountBalance(getBillingAccountId(), dispatcher);
|
||||
if (this.billingAccountAmt.compareTo(BigDecimal.ZERO) == 0 && billingAccountAvailableAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
@@ -5072,7 +5073,7 @@ public class ShoppingCart implements Iterable<ShoppingCartItem>, Serializable {
|
||||
minimumOrderPrice = EntityUtil.getFirst(minimumOrderPriceList).getBigDecimal("price");
|
||||
}
|
||||
if (itemBasePrice != null && minimumOrderPrice.compareTo(itemBasePrice) > 0) {
|
||||
minQuantity = minimumOrderPrice.divide(itemBasePrice, 0, BigDecimal.ROUND_UP);
|
||||
minQuantity = minimumOrderPrice.divide(itemBasePrice, 0, RoundingMode.UP);
|
||||
}
|
||||
return minQuantity;
|
||||
}
|
||||
|
||||
+5
-4
@@ -20,6 +20,7 @@ package org.apache.ofbiz.order.shoppingcart.product;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -410,7 +411,7 @@ public final class ProductPromoWorker {
|
||||
|
||||
// set a max limit on how many times each promo can be run, for cases where there is no use limit this will be the use limit
|
||||
//default to 2 times the number of items in the cart
|
||||
long maxUseLimit = cart.getTotalQuantity().multiply(BigDecimal.valueOf(2)).setScale(0, BigDecimal.ROUND_CEILING).longValue();
|
||||
long maxUseLimit = cart.getTotalQuantity().multiply(BigDecimal.valueOf(2)).setScale(0, RoundingMode.CEILING).longValue();
|
||||
maxUseLimit = Math.max(1, maxUseLimit);
|
||||
|
||||
try {
|
||||
@@ -958,7 +959,7 @@ public final class ProductPromoWorker {
|
||||
|
||||
BigDecimal basePrice = cartItem.getBasePrice();
|
||||
// get a rough price, round it up to an integer
|
||||
BigDecimal quantityNeeded = amountNeeded.divide(basePrice, generalRounding).setScale(0, BigDecimal.ROUND_CEILING);
|
||||
BigDecimal quantityNeeded = amountNeeded.divide(basePrice, generalRounding).setScale(0, RoundingMode.CEILING);
|
||||
|
||||
// reduce amount still needed to qualify for promo (amountNeeded)
|
||||
BigDecimal quantity = cartItem.addPromoQuantityCandidateUse(quantityNeeded, productPromoCond, false);
|
||||
@@ -1315,7 +1316,7 @@ public final class ProductPromoWorker {
|
||||
|
||||
BigDecimal basePrice = cartItem.getBasePrice();
|
||||
BigDecimal amountOff = listPrice.subtract(basePrice);
|
||||
BigDecimal percentOff = amountOff.divide(listPrice, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100L));
|
||||
BigDecimal percentOff = amountOff.divide(listPrice, 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100L));
|
||||
|
||||
Integer compareBase = null;
|
||||
|
||||
@@ -1844,7 +1845,7 @@ public final class ProductPromoWorker {
|
||||
BigDecimal ratioOfTotal = quantityUsed.multiply(cartItem.getBasePrice()).divide(totalAmount, generalRounding);
|
||||
BigDecimal weightedAmount = ratioOfTotal.multiply(discountAmountTotal);
|
||||
// round the weightedAmount to 3 decimal places, we don't want an exact number cents/whatever because this will be added up as part of a subtotal which will be rounded to 2 decimal places
|
||||
weightedAmount = weightedAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
|
||||
weightedAmount = weightedAmount.setScale(3, RoundingMode.HALF_UP);
|
||||
discountAmount = discountAmount.subtract(weightedAmount);
|
||||
doOrderItemPromoAction(productPromoAction, cartItem, weightedAmount, "amount", delegator);
|
||||
} else {
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.order.task;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.GeneralException;
|
||||
@@ -31,14 +31,14 @@ import org.apache.ofbiz.base.util.ObjectType;
|
||||
import org.apache.ofbiz.base.util.UtilHttp;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.webapp.control.RequestHandler;
|
||||
import org.apache.ofbiz.webapp.control.ConfigXMLReader.Event;
|
||||
import org.apache.ofbiz.webapp.event.EventHandler;
|
||||
import org.apache.ofbiz.webapp.event.EventHandlerException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
import org.apache.ofbiz.webapp.control.ConfigXMLReader.Event;
|
||||
import org.apache.ofbiz.webapp.control.RequestHandler;
|
||||
import org.apache.ofbiz.webapp.event.EventHandler;
|
||||
import org.apache.ofbiz.webapp.event.EventHandlerException;
|
||||
|
||||
/**
|
||||
* Order Processing Task Events
|
||||
|
||||
@@ -20,8 +20,8 @@ package org.apache.ofbiz.order.test;
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.service.testtools.OFBizTestCase;
|
||||
import org.apache.ofbiz.order.finaccount.FinAccountHelper;
|
||||
import org.apache.ofbiz.service.testtools.OFBizTestCase;
|
||||
|
||||
public class FinAccountTest extends OFBizTestCase {
|
||||
public FinAccountTest(String name) {
|
||||
|
||||
+6
-7
@@ -21,21 +21,18 @@ package org.apache.ofbiz.party.contact;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import com.ibm.icu.util.Calendar;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ofbiz.base.crypto.HashCrypt;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
@@ -46,10 +43,12 @@ import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.security.Security;
|
||||
import org.apache.ofbiz.service.DispatchContext;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
|
||||
import com.ibm.icu.util.Calendar;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -32,7 +32,6 @@ import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.UtilHttp;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.webapp.website.WebSiteWorker;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
@@ -40,6 +39,7 @@ import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtil;
|
||||
import org.apache.ofbiz.product.category.CategoryWorker;
|
||||
import org.apache.ofbiz.product.store.ProductStoreWorker;
|
||||
import org.apache.ofbiz.webapp.website.WebSiteWorker;
|
||||
|
||||
/**
|
||||
* CatalogWorker - Worker class for catalog related functionality
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
|
||||
|
||||
import freemarker.core.Environment;
|
||||
import freemarker.ext.beans.BeanModel;
|
||||
import freemarker.template.TemplateDirectiveBody;
|
||||
|
||||
+3
-3
@@ -31,14 +31,14 @@ import java.util.Set;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.UtilURL;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
+2
-2
@@ -39,8 +39,6 @@ import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.UtilHttp;
|
||||
@@ -49,6 +47,8 @@ import org.apache.ofbiz.webapp.control.ConfigXMLReader;
|
||||
import org.apache.ofbiz.webapp.control.ConfigXMLReader.ControllerConfig;
|
||||
import org.apache.ofbiz.webapp.control.ControlFilter;
|
||||
import org.apache.ofbiz.webapp.control.WebAppConfigurationException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
|
||||
/**
|
||||
* SeoContextFilter - Restricts access to raw files and configures servlet objects.
|
||||
|
||||
+4
-4
@@ -31,10 +31,6 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.StringUtil.StringWrapper;
|
||||
@@ -53,6 +49,10 @@ import org.apache.ofbiz.product.category.CategoryWorker;
|
||||
import org.apache.ofbiz.product.category.SeoConfigUtil;
|
||||
import org.apache.ofbiz.product.category.SeoUrlUtil;
|
||||
import org.apache.ofbiz.product.product.ProductContentWrapper;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
|
||||
import freemarker.core.Environment;
|
||||
import freemarker.ext.beans.BeanModel;
|
||||
|
||||
+2
-2
@@ -28,12 +28,12 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.product.category.SeoConfigUtil;
|
||||
import org.apache.ofbiz.webapp.control.RequestHandler;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
|
||||
import freemarker.core.Environment;
|
||||
import freemarker.ext.beans.BeanModel;
|
||||
|
||||
+2
-2
@@ -28,12 +28,12 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.product.category.SeoConfigUtil;
|
||||
import org.apache.ofbiz.webapp.control.RequestHandler;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
|
||||
import freemarker.core.Environment;
|
||||
import freemarker.ext.beans.BeanModel;
|
||||
|
||||
@@ -30,7 +30,6 @@ import java.util.Map;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.apache.ofbiz.base.location.FlexibleLocation;
|
||||
import org.jdom.JDOMException;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
@@ -42,6 +41,7 @@ import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import org.jdom.JDOMException;
|
||||
|
||||
/**
|
||||
* ScaleImage Class
|
||||
|
||||
+2
-2
@@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import org.jdom.JDOMException;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
@@ -50,14 +49,15 @@ import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
|
||||
import org.apache.ofbiz.content.layout.LayoutWorker;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.service.DispatchContext;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import org.jdom.JDOMException;
|
||||
|
||||
public class FrameImage {
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,6 @@ import java.util.Map;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.apache.ofbiz.base.location.FlexibleLocation;
|
||||
import org.jdom.JDOMException;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
@@ -56,6 +55,7 @@ import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import org.jdom.JDOMException;
|
||||
|
||||
/**
|
||||
* Product Services
|
||||
|
||||
+5
-5
@@ -18,15 +18,17 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.product.product;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilHttp;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
@@ -34,8 +36,6 @@ import org.apache.ofbiz.entity.transaction.GenericTransactionException;
|
||||
import org.apache.ofbiz.entity.transaction.TransactionUtil;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Product Variant Related Events
|
||||
*/
|
||||
|
||||
+3
-2
@@ -19,6 +19,7 @@
|
||||
package org.apache.ofbiz.shipment.packing;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -1018,7 +1019,7 @@ public class PackingSession implements java.io.Serializable {
|
||||
|
||||
public ItemDisplay(GenericValue v) {
|
||||
if ("PicklistItem".equals(v.getEntityName())) {
|
||||
quantity = v.getBigDecimal("quantity").setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
quantity = v.getBigDecimal("quantity").setScale(2, RoundingMode.HALF_UP);
|
||||
try {
|
||||
orderItem = v.getRelatedOne("OrderItem", false);
|
||||
productId = v.getRelatedOne("InventoryItem", false).getString("productId");
|
||||
@@ -1029,7 +1030,7 @@ public class PackingSession implements java.io.Serializable {
|
||||
// this is an OrderItemAndShipGrpInvResAndItemSum
|
||||
orderItem = v;
|
||||
productId = v.getString("inventoryProductId");
|
||||
quantity = v.getBigDecimal("totQuantityReserved").setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
quantity = v.getBigDecimal("totQuantityReserved").setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
Debug.logInfo("created item display object quantity: " + quantity + " (" + productId + ")", module);
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,11 +22,11 @@ import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.GeneralException;
|
||||
import org.apache.ofbiz.base.util.UtilFormatOut;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ package org.apache.ofbiz.shipment.shipment;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -102,7 +103,7 @@ public final class ShipmentWorker {
|
||||
}
|
||||
}
|
||||
// take the average value of the issuances and multiply it by the shipment package content quantity
|
||||
value = totalValue.divide(totalIssued, 10, BigDecimal.ROUND_HALF_EVEN).multiply(quantity);
|
||||
value = totalValue.divide(totalIssued, 10, RoundingMode.HALF_EVEN).multiply(quantity);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.shipment.packing.PackingSession;
|
||||
import org.apache.ofbiz.service.testtools.OFBizTestCase;
|
||||
import org.apache.ofbiz.shipment.packing.PackingSession;
|
||||
|
||||
/**
|
||||
* Item Issuance Tests
|
||||
|
||||
Vendored
+2
-1
@@ -21,6 +21,7 @@ package org.apache.ofbiz.shipment.thirdparty.dhl;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -680,7 +681,7 @@ public class DhlServices {
|
||||
weight = packageWeight;
|
||||
}
|
||||
// want the rounded weight as a string, so we use the "" + int shortcut
|
||||
String roundedWeight = weight.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
||||
String roundedWeight = weight.setScale(0, RoundingMode.HALF_UP).toPlainString();
|
||||
|
||||
// translate shipmentMethodTypeId to DHL service code
|
||||
String shipmentMethodTypeId = shipmentRouteSegment.getString("shipmentMethodTypeId");
|
||||
|
||||
Vendored
+8
-7
@@ -21,6 +21,7 @@ package org.apache.ofbiz.shipment.thirdparty.fedex;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
@@ -912,15 +913,15 @@ public class FedexServices {
|
||||
shipRequestContext.put("DropoffType", dropoffType);
|
||||
shipRequestContext.put("Packaging", packaging);
|
||||
if (UtilValidate.isNotEmpty(dimensionsUomId) &&
|
||||
dimensionsLength != null && dimensionsLength.setScale(0, BigDecimal.ROUND_HALF_UP).compareTo(BigDecimal.ZERO) > 0 &&
|
||||
dimensionsWidth != null && dimensionsWidth.setScale(0, BigDecimal.ROUND_HALF_UP).compareTo(BigDecimal.ZERO) > 0 &&
|
||||
dimensionsHeight != null && dimensionsHeight.setScale(0, BigDecimal.ROUND_HALF_UP).compareTo(BigDecimal.ZERO) > 0) {
|
||||
dimensionsLength != null && dimensionsLength.setScale(0, RoundingMode.HALF_UP).compareTo(BigDecimal.ZERO) > 0 &&
|
||||
dimensionsWidth != null && dimensionsWidth.setScale(0, RoundingMode.HALF_UP).compareTo(BigDecimal.ZERO) > 0 &&
|
||||
dimensionsHeight != null && dimensionsHeight.setScale(0, RoundingMode.HALF_UP).compareTo(BigDecimal.ZERO) > 0) {
|
||||
shipRequestContext.put("DimensionsUnits", dimensionsUomId.equals("LEN_in") ? "IN" : "CM");
|
||||
shipRequestContext.put("DimensionsLength", dimensionsLength.setScale(0, BigDecimal.ROUND_HALF_UP).toString());
|
||||
shipRequestContext.put("DimensionsWidth", dimensionsWidth.setScale(0, BigDecimal.ROUND_HALF_UP).toString());
|
||||
shipRequestContext.put("DimensionsHeight", dimensionsHeight.setScale(0, BigDecimal.ROUND_HALF_UP).toString());
|
||||
shipRequestContext.put("DimensionsLength", dimensionsLength.setScale(0, RoundingMode.HALF_UP).toString());
|
||||
shipRequestContext.put("DimensionsWidth", dimensionsWidth.setScale(0, RoundingMode.HALF_UP).toString());
|
||||
shipRequestContext.put("DimensionsHeight", dimensionsHeight.setScale(0, RoundingMode.HALF_UP).toString());
|
||||
}
|
||||
shipRequestContext.put("Weight", weight.setScale(1, BigDecimal.ROUND_UP).toString());
|
||||
shipRequestContext.put("Weight", weight.setScale(1, RoundingMode.UP).toString());
|
||||
}
|
||||
|
||||
StringWriter outWriter = new StringWriter();
|
||||
|
||||
Vendored
+3
-2
@@ -23,6 +23,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
@@ -549,7 +550,7 @@ public class UpsServices {
|
||||
UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", shipmentRouteSegmentId, "shipmentPackageSeqId", shipmentPackage.getString("shipmentPackageSeqId")), locale));
|
||||
}
|
||||
BigDecimal boxWeight = shipmentPackage.getBigDecimal("weight");
|
||||
UtilXml.addChildElementValue(packageWeightElement, "Weight", UtilValidate.isNotEmpty(boxWeight) ? ""+ boxWeight.setScale(0, BigDecimal.ROUND_CEILING) : "", shipmentConfirmRequestDoc);
|
||||
UtilXml.addChildElementValue(packageWeightElement, "Weight", UtilValidate.isNotEmpty(boxWeight) ? ""+ boxWeight.setScale(0, RoundingMode.CEILING) : "", shipmentConfirmRequestDoc);
|
||||
// Adding only when order is not an international order
|
||||
if (!internationalServiceCodes.contains(carrierServiceCode)) {
|
||||
Element referenceNumberElement = UtilXml.addChildElement(packageElement, "ReferenceNumber", shipmentConfirmRequestDoc);
|
||||
@@ -567,7 +568,7 @@ public class UpsServices {
|
||||
if (! UtilValidate.isEmpty(insuredValue)) {
|
||||
|
||||
Element insuredValueElement = UtilXml.addChildElement(packageServiceOptionsElement, "InsuredValue", shipmentConfirmRequestDoc);
|
||||
UtilXml.addChildElementValue(insuredValueElement, "MonetaryValue", insuredValue.setScale(2, BigDecimal.ROUND_HALF_UP).toString(), shipmentConfirmRequestDoc);
|
||||
UtilXml.addChildElementValue(insuredValueElement, "MonetaryValue", insuredValue.setScale(2, RoundingMode.HALF_UP).toString(), shipmentConfirmRequestDoc);
|
||||
UtilXml.addChildElementValue(insuredValueElement, "CurrencyCode", currencyCode, shipmentConfirmRequestDoc);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-9
@@ -24,6 +24,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -192,14 +193,14 @@ public class UspsServices {
|
||||
UtilXml.addChildElementValue(packageElement, "ZipOrigination", StringUtils.substring(originationZip, 0, 5), requestDocument);
|
||||
UtilXml.addChildElementValue(packageElement, "ZipDestination", StringUtils.substring(destinationZip, 0, 5), requestDocument);
|
||||
|
||||
BigDecimal weightPounds = packageWeight.setScale(0, BigDecimal.ROUND_FLOOR);
|
||||
BigDecimal weightPounds = packageWeight.setScale(0, RoundingMode.FLOOR);
|
||||
// for Parcel post, the weight must be at least 1 lb
|
||||
if ("PARCEL".equals(serviceCode.toUpperCase()) && (weightPounds.compareTo(BigDecimal.ONE) < 0)) {
|
||||
weightPounds = BigDecimal.ONE;
|
||||
packageWeight = BigDecimal.ZERO;
|
||||
}
|
||||
// (packageWeight % 1) * 16 (Rounded up to 0 dp)
|
||||
BigDecimal weightOunces = packageWeight.remainder(BigDecimal.ONE).multiply(new BigDecimal("16")).setScale(0, BigDecimal.ROUND_CEILING);
|
||||
BigDecimal weightOunces = packageWeight.remainder(BigDecimal.ONE).multiply(new BigDecimal("16")).setScale(0, RoundingMode.CEILING);
|
||||
|
||||
UtilXml.addChildElementValue(packageElement, "Pounds", weightPounds.toPlainString(), requestDocument);
|
||||
UtilXml.addChildElementValue(packageElement, "Ounces", weightOunces.toPlainString(), requestDocument);
|
||||
@@ -1075,8 +1076,8 @@ public class UspsServices {
|
||||
|
||||
}
|
||||
|
||||
BigDecimal weightPounds = weight.setScale(0, BigDecimal.ROUND_FLOOR);
|
||||
BigDecimal weightOunces = weight.multiply(new BigDecimal("16")).remainder(new BigDecimal("16")).setScale(0, BigDecimal.ROUND_CEILING);
|
||||
BigDecimal weightPounds = weight.setScale(0, RoundingMode.FLOOR);
|
||||
BigDecimal weightOunces = weight.multiply(new BigDecimal("16")).remainder(new BigDecimal("16")).setScale(0, RoundingMode.CEILING);
|
||||
|
||||
DecimalFormat df = new DecimalFormat("#");
|
||||
UtilXml.addChildElementValue(packageElement, "Pounds", df.format(weightPounds), requestDocument);
|
||||
@@ -1372,7 +1373,7 @@ public class UspsServices {
|
||||
}
|
||||
|
||||
DecimalFormat df = new DecimalFormat("#");
|
||||
UtilXml.addChildElementValue(requestElement, "WeightInOunces", df.format(weight.setScale(0, BigDecimal.ROUND_CEILING)), requestDocument);
|
||||
UtilXml.addChildElementValue(requestElement, "WeightInOunces", df.format(weight.setScale(0, RoundingMode.CEILING)), requestDocument);
|
||||
|
||||
UtilXml.addChildElementValue(requestElement, "ServiceType", serviceType, requestDocument);
|
||||
UtilXml.addChildElementValue(requestElement, "ImageType", "TIF", requestDocument);
|
||||
@@ -1613,8 +1614,8 @@ public class UspsServices {
|
||||
}
|
||||
|
||||
UtilXml.addChildElementValue(itemDetail, "Description", product.getString("productName"), packageDocument);
|
||||
UtilXml.addChildElementValue(itemDetail, "Quantity", shipmentPackageContent.getBigDecimal("quantity").setScale(0, BigDecimal.ROUND_CEILING).toPlainString(), packageDocument);
|
||||
String packageContentValue = ShipmentWorker.getShipmentPackageContentValue(shipmentPackageContent).setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString();
|
||||
UtilXml.addChildElementValue(itemDetail, "Quantity", shipmentPackageContent.getBigDecimal("quantity").setScale(0, RoundingMode.CEILING).toPlainString(), packageDocument);
|
||||
String packageContentValue = ShipmentWorker.getShipmentPackageContentValue(shipmentPackageContent).setScale(2, RoundingMode.HALF_UP).toPlainString();
|
||||
UtilXml.addChildElementValue(itemDetail, "Value", packageContentValue, packageDocument);
|
||||
BigDecimal productWeight = ProductWorker.getProductWeight(product, "WT_lbs", delegator, dispatcher);
|
||||
Integer[] productPoundsOunces = convertPoundsToPoundsOunces(productWeight);
|
||||
@@ -1754,9 +1755,9 @@ public class UspsServices {
|
||||
public static Integer[] convertPoundsToPoundsOunces(BigDecimal decimalPounds) {
|
||||
if (decimalPounds == null) return null;
|
||||
Integer[] poundsOunces = new Integer[2];
|
||||
poundsOunces[0] = Integer.valueOf(decimalPounds.setScale(0, BigDecimal.ROUND_FLOOR).toPlainString());
|
||||
poundsOunces[0] = Integer.valueOf(decimalPounds.setScale(0, RoundingMode.FLOOR).toPlainString());
|
||||
// (weight % 1) * 16 rounded up to nearest whole number
|
||||
poundsOunces[1] = Integer.valueOf(decimalPounds.remainder(BigDecimal.ONE).multiply(new BigDecimal("16")).setScale(0, BigDecimal.ROUND_CEILING).toPlainString());
|
||||
poundsOunces[1] = Integer.valueOf(decimalPounds.remainder(BigDecimal.ONE).multiply(new BigDecimal("16")).setScale(0, RoundingMode.CEILING).toPlainString());
|
||||
return poundsOunces;
|
||||
}
|
||||
|
||||
|
||||
+21
-21
@@ -34,6 +34,27 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.ofbiz.base.util.DateRange;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.ObjectType;
|
||||
import org.apache.ofbiz.base.util.TimeDuration;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ModelParam;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpression;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressionWorker;
|
||||
import org.apache.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties;
|
||||
|
||||
import net.fortuna.ical4j.data.CalendarBuilder;
|
||||
import net.fortuna.ical4j.data.ParserException;
|
||||
import net.fortuna.ical4j.model.Calendar;
|
||||
@@ -77,27 +98,6 @@ import net.fortuna.ical4j.model.property.Uid;
|
||||
import net.fortuna.ical4j.model.property.Version;
|
||||
import net.fortuna.ical4j.model.property.XProperty;
|
||||
|
||||
import org.apache.ofbiz.base.util.DateRange;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.ObjectType;
|
||||
import org.apache.ofbiz.base.util.TimeDuration;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.service.GenericServiceException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ModelParam;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpression;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressionWorker;
|
||||
import org.apache.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties;
|
||||
|
||||
/** iCalendar converter class. This class uses the <a href="http://ical4j.sourceforge.net/index.html">
|
||||
* iCal4J</a> library.
|
||||
*/
|
||||
|
||||
+23
-4
@@ -25,16 +25,35 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
|
||||
import net.fortuna.ical4j.model.*;
|
||||
import net.fortuna.ical4j.model.property.*;
|
||||
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpression;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressionVisitor;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions.*;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions.Difference;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions.HourRange;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions.Intersection;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions.MinuteRange;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions.Null;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions.Substitution;
|
||||
import org.apache.ofbiz.service.calendar.TemporalExpressions.Union;
|
||||
|
||||
import com.ibm.icu.util.Calendar;
|
||||
|
||||
import net.fortuna.ical4j.model.DateTime;
|
||||
import net.fortuna.ical4j.model.NumberList;
|
||||
import net.fortuna.ical4j.model.Period;
|
||||
import net.fortuna.ical4j.model.PeriodList;
|
||||
import net.fortuna.ical4j.model.Property;
|
||||
import net.fortuna.ical4j.model.PropertyList;
|
||||
import net.fortuna.ical4j.model.Recur;
|
||||
import net.fortuna.ical4j.model.WeekDay;
|
||||
import net.fortuna.ical4j.model.WeekDayList;
|
||||
import net.fortuna.ical4j.model.property.DateListProperty;
|
||||
import net.fortuna.ical4j.model.property.DtStart;
|
||||
import net.fortuna.ical4j.model.property.ExDate;
|
||||
import net.fortuna.ical4j.model.property.ExRule;
|
||||
import net.fortuna.ical4j.model.property.RDate;
|
||||
import net.fortuna.ical4j.model.property.RRule;
|
||||
|
||||
/** Temporal Expression to iCalendar recurrence converter. The conversion results
|
||||
* (or conversion success) are unpredictable since the OFBiz Temporal Expressions
|
||||
* are more sophisticated than iCalendar recurrences. This class attempts to
|
||||
|
||||
+1
-2
@@ -23,9 +23,8 @@ import java.net.URL;
|
||||
|
||||
import org.apache.ofbiz.base.config.GenericConfigException;
|
||||
import org.apache.ofbiz.base.config.ResourceHandler;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.config;
|
||||
|
||||
import java.net.URL;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilURL;
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,9 +21,8 @@ package org.apache.ofbiz.base.config;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.config;
|
||||
|
||||
import java.net.URL;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* Loads resources from a URL
|
||||
|
||||
+2
-2
@@ -22,13 +22,13 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.ofbiz.base.conversion.BooleanConverters;
|
||||
import org.apache.ofbiz.base.conversion.Converter;
|
||||
import org.apache.ofbiz.base.conversion.ConverterLoader;
|
||||
import org.apache.ofbiz.base.conversion.Converters;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class TestBooleanConverters extends TestCase {
|
||||
|
||||
public TestBooleanConverters(String name) {
|
||||
|
||||
+2
-2
@@ -25,8 +25,6 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.ofbiz.base.conversion.Converter;
|
||||
import org.apache.ofbiz.base.conversion.ConverterLoader;
|
||||
import org.apache.ofbiz.base.conversion.Converters;
|
||||
@@ -34,6 +32,8 @@ import org.apache.ofbiz.base.conversion.JSONConverters;
|
||||
import org.apache.ofbiz.base.lang.JSON;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class TestJSONConverters extends TestCase {
|
||||
public TestJSONConverters(String name) {
|
||||
super(name);
|
||||
|
||||
@@ -18,19 +18,20 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.crypto;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.Key;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.DESedeKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
|
||||
import org.apache.ofbiz.base.util.GeneralException;
|
||||
|
||||
|
||||
+5
-4
@@ -18,14 +18,15 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.lang.test;
|
||||
|
||||
import org.apache.ofbiz.base.test.GenericTestCaseBase;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.lessThan;
|
||||
|
||||
import org.apache.ofbiz.base.lang.ComparableRange;
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
import org.apache.ofbiz.base.test.GenericTestCaseBase;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
@SourceMonitored
|
||||
public class ComparableRangeTests extends GenericTestCaseBase {
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.test;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.UtilFormatOut;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class BaseUnitTests extends TestCase {
|
||||
|
||||
public BaseUnitTests(String name) {
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util;
|
||||
|
||||
import java.net.Socket;
|
||||
import java.security.Principal;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.net.Socket;
|
||||
|
||||
import javax.net.ssl.X509KeyManager;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.FilterWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.ObjectStreamClass;
|
||||
import java.lang.reflect.Proxy;
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util;
|
||||
|
||||
import org.apache.ofbiz.base.util.cache.UtilCache;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.ofbiz.base.util.cache.UtilCache;
|
||||
|
||||
/**
|
||||
* A RegEx compiled pattern factory.
|
||||
|
||||
@@ -39,17 +39,18 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
import com.google.i18n.phonenumbers.NumberParseException;
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil;
|
||||
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
|
||||
|
||||
import org.apache.ofbiz.base.util.collections.MapComparator;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
|
||||
import org.apache.ofbiz.base.util.collections.MapComparator;
|
||||
import com.google.i18n.phonenumbers.NumberParseException;
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil;
|
||||
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
|
||||
|
||||
/**
|
||||
* UtilMisc - Misc Utility Functions
|
||||
|
||||
@@ -18,15 +18,14 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Iterator;
|
||||
import java.util.ServiceLoader;
|
||||
import java.lang.Class;
|
||||
|
||||
import org.apache.ofbiz.base.lang.Factory;
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
|
||||
@@ -24,17 +24,16 @@ import java.util.Map;
|
||||
|
||||
import org.apache.commons.validator.routines.EmailValidator;
|
||||
import org.apache.ofbiz.base.lang.IsEmpty;
|
||||
|
||||
import com.ibm.icu.util.Calendar;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
|
||||
import com.google.i18n.phonenumbers.NumberParseException;
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil;
|
||||
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import com.ibm.icu.util.Calendar;
|
||||
|
||||
/**
|
||||
* General input/data validation methods
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ package org.apache.ofbiz.base.util.collections;
|
||||
import java.io.Serializable;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.el.PropertyNotFoundException;
|
||||
|
||||
import org.apache.ofbiz.base.lang.IsEmpty;
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package org.apache.ofbiz.base.util.collections;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Collection;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -20,9 +20,9 @@ package org.apache.ofbiz.base.util.collections;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.AbstractSet;
|
||||
import java.util.EmptyStackException;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.EmptyStackException;
|
||||
|
||||
/**
|
||||
* LifoSet - Set interface wrapper around a LinkedList
|
||||
|
||||
+1
-1
@@ -18,12 +18,12 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util.collections.test;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
import org.apache.ofbiz.base.test.GenericTestCaseBase;
|
||||
|
||||
@@ -28,6 +28,8 @@ import javax.el.ELException;
|
||||
import javax.el.ExpressionFactory;
|
||||
import javax.el.PropertyNotFoundException;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
import de.odysseus.el.ExpressionFactoryImpl;
|
||||
import de.odysseus.el.misc.LocalMessages;
|
||||
import de.odysseus.el.tree.Bindings;
|
||||
@@ -45,8 +47,6 @@ import de.odysseus.el.tree.impl.ast.AstEval;
|
||||
import de.odysseus.el.tree.impl.ast.AstIdentifier;
|
||||
import de.odysseus.el.tree.impl.ast.AstNode;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
/** A facade class used to connect the OFBiz framework to the JUEL library.
|
||||
*<p>The Unified Expression Language specification doesn't allow assignment of
|
||||
* values to non-existent variables (auto-vivify) - but the OFBiz scripting
|
||||
|
||||
@@ -33,9 +33,9 @@ import javax.xml.xpath.XPathExpression;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
|
||||
import org.apache.xerces.dom.NodeImpl;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.cache.UtilCache;
|
||||
import org.apache.xerces.dom.NodeImpl;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ import javax.el.FunctionMapper;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.cyberneko.html.parsers.DOMParser;
|
||||
import org.apache.ofbiz.base.location.FlexibleLocation;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.FileUtil;
|
||||
import org.apache.ofbiz.base.util.UtilDateTime;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.cyberneko.html.parsers.DOMParser;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
|
||||
+5
-5
@@ -26,14 +26,14 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
|
||||
import org.apache.ofbiz.base.conversion.AbstractConverter;
|
||||
import org.apache.ofbiz.base.conversion.ConversionException;
|
||||
import org.apache.ofbiz.base.conversion.Converters;
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@SourceMonitored
|
||||
public class FlexibleStringExpanderTests extends TestCase {
|
||||
|
||||
+3
-3
@@ -36,9 +36,6 @@ import java.util.TimeZone;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import freemarker.cache.MultiTemplateLoader;
|
||||
import freemarker.cache.StringTemplateLoader;
|
||||
import freemarker.cache.TemplateLoader;
|
||||
import org.apache.ofbiz.base.location.FlexibleLocation;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
@@ -48,6 +45,9 @@ import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.cache.UtilCache;
|
||||
|
||||
import freemarker.cache.MultiTemplateLoader;
|
||||
import freemarker.cache.StringTemplateLoader;
|
||||
import freemarker.cache.TemplateLoader;
|
||||
import freemarker.cache.URLTemplateLoader;
|
||||
import freemarker.core.Environment;
|
||||
import freemarker.ext.beans.BeanModel;
|
||||
|
||||
+20
-22
@@ -18,40 +18,38 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util.template;
|
||||
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Map;
|
||||
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.apache.ofbiz.base.util.URLConnector;
|
||||
import org.apache.ofbiz.base.util.cache.UtilCache;
|
||||
import org.apache.ofbiz.base.location.FlexibleLocation;
|
||||
import org.apache.ofbiz.base.util.GeneralException;
|
||||
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Templates;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import javax.xml.transform.sax.SAXSource;
|
||||
import javax.xml.transform.Templates;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.dom.DOMResult;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.sax.SAXSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.ofbiz.base.location.FlexibleLocation;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.GeneralException;
|
||||
import org.apache.ofbiz.base.util.URLConnector;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.apache.ofbiz.base.util.cache.UtilCache;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.XMLReader;
|
||||
|
||||
public final class XslTransform {
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.ofbiz.base.util.Assert;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* Assert tests {@link org.apache.ofbiz.base.util.Assert}.
|
||||
*
|
||||
|
||||
+1
-1
@@ -21,8 +21,8 @@ package org.apache.ofbiz.base.util.test;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
import org.apache.ofbiz.base.util.IndentingWriter;
|
||||
import org.apache.ofbiz.base.test.GenericTestCaseBase;
|
||||
import org.apache.ofbiz.base.util.IndentingWriter;
|
||||
|
||||
@SourceMonitored
|
||||
public class IndentingWriterTests extends GenericTestCaseBase {
|
||||
|
||||
@@ -25,10 +25,10 @@ import java.util.Map;
|
||||
|
||||
import org.apache.ofbiz.base.lang.Appender;
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
import org.apache.ofbiz.base.test.GenericTestCaseBase;
|
||||
import org.apache.ofbiz.base.util.GeneralRuntimeException;
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.base.test.GenericTestCaseBase;
|
||||
|
||||
@SourceMonitored
|
||||
public class StringUtilTests extends GenericTestCaseBase {
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util.test;
|
||||
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
import org.apache.ofbiz.base.test.GenericTestCaseBase;
|
||||
import org.apache.ofbiz.base.util.TimeDuration;
|
||||
|
||||
//import com.ibm.icu.util.Calendar;
|
||||
//import com.ibm.icu.util.TimeZone;
|
||||
import com.ibm.icu.util.Calendar;
|
||||
import com.ibm.icu.util.TimeZone;
|
||||
|
||||
import org.apache.ofbiz.base.lang.SourceMonitored;
|
||||
import org.apache.ofbiz.base.util.TimeDuration;
|
||||
import org.apache.ofbiz.base.test.GenericTestCaseBase;
|
||||
|
||||
@SourceMonitored
|
||||
public class TimeDurationTests extends GenericTestCaseBase {
|
||||
private static final Calendar zero = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
|
||||
@@ -18,11 +18,14 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class UtilCodecTests {
|
||||
|
||||
|
||||
+2
-1
@@ -18,13 +18,14 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.base.util.template;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class FreeMarkerWorkerTests {
|
||||
@Before
|
||||
|
||||
+5
-5
@@ -62,11 +62,6 @@ import org.apache.catalina.tribes.transport.nio.NioReceiver;
|
||||
import org.apache.catalina.util.ServerInfo;
|
||||
import org.apache.catalina.valves.AccessLogValve;
|
||||
import org.apache.catalina.webresources.StandardRoot;
|
||||
import org.apache.tomcat.JarScanner;
|
||||
import org.apache.tomcat.util.IntrospectionUtils;
|
||||
import org.apache.tomcat.util.descriptor.web.FilterDef;
|
||||
import org.apache.tomcat.util.descriptor.web.FilterMap;
|
||||
import org.apache.tomcat.util.scan.StandardJarScanner;
|
||||
import org.apache.ofbiz.base.component.ComponentConfig;
|
||||
import org.apache.ofbiz.base.concurrent.ExecutionPool;
|
||||
import org.apache.ofbiz.base.container.Container;
|
||||
@@ -80,6 +75,11 @@ import org.apache.ofbiz.base.start.StartupCommand;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.apache.tomcat.JarScanner;
|
||||
import org.apache.tomcat.util.IntrospectionUtils;
|
||||
import org.apache.tomcat.util.descriptor.web.FilterDef;
|
||||
import org.apache.tomcat.util.descriptor.web.FilterMap;
|
||||
import org.apache.tomcat.util.scan.StandardJarScanner;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
|
||||
+2
-2
@@ -27,12 +27,12 @@ import org.apache.catalina.connector.Request;
|
||||
import org.apache.catalina.connector.Response;
|
||||
import org.apache.catalina.util.SessionConfig;
|
||||
import org.apache.catalina.valves.ValveBase;
|
||||
import org.apache.tomcat.util.buf.MessageBytes;
|
||||
import org.apache.tomcat.util.http.MimeHeaders;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
import org.apache.tomcat.util.buf.MessageBytes;
|
||||
import org.apache.tomcat.util.http.MimeHeaders;
|
||||
|
||||
public class CrossSubdomainSessionValve extends ValveBase {
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ package org.apache.ofbiz.common;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
|
||||
+1
-1
@@ -23,8 +23,8 @@ import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
+2
-2
@@ -19,11 +19,11 @@
|
||||
|
||||
package org.apache.ofbiz.common.authentication.example;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.common.authentication.api.Authenticator;
|
||||
import org.apache.ofbiz.common.authentication.api.AuthenticatorException;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.service.LocalDispatcher;
|
||||
|
||||
/**
|
||||
* LocalAuthenticator
|
||||
|
||||
@@ -72,9 +72,9 @@ import org.apache.ofbiz.service.LocalDispatcher;
|
||||
import org.apache.ofbiz.service.ServiceUtil;
|
||||
import org.apache.ofbiz.service.mail.MimeMessageWrapper;
|
||||
import org.apache.ofbiz.webapp.view.ApacheFopWorker;
|
||||
import org.apache.ofbiz.widget.renderer.macro.MacroScreenRenderer;
|
||||
import org.apache.ofbiz.widget.renderer.ScreenRenderer;
|
||||
import org.apache.ofbiz.widget.renderer.ScreenStringRenderer;
|
||||
import org.apache.ofbiz.widget.renderer.macro.MacroScreenRenderer;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import com.sun.mail.smtp.SMTPAddressFailedException;
|
||||
|
||||
@@ -37,9 +37,9 @@ import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.apache.ofbiz.service.ModelService;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -18,6 +18,8 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.common.preferences;
|
||||
|
||||
import static org.apache.ofbiz.base.util.UtilGenerics.checkMap;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -26,7 +28,6 @@ import java.util.Properties;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.GeneralException;
|
||||
import org.apache.ofbiz.base.util.ObjectType;
|
||||
import static org.apache.ofbiz.base.util.UtilGenerics.checkMap;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.lang.Integer;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -22,14 +22,13 @@ import java.awt.Graphics2D;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.AffineTransformOp;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.lang.Integer;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.FileUtil;
|
||||
|
||||
@@ -21,8 +21,8 @@ package org.apache.ofbiz.common.scripting;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Locale;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.common.status;
|
||||
|
||||
import static org.apache.ofbiz.base.util.UtilGenerics.checkList;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -27,9 +29,6 @@ import java.util.Map;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilProperties;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
|
||||
import static org.apache.ofbiz.base.util.UtilGenerics.checkList;
|
||||
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.apache.ofbiz.base.container.Container;
|
||||
import org.apache.ofbiz.base.container.ContainerConfig;
|
||||
import org.apache.ofbiz.base.container.ContainerException;
|
||||
import org.apache.ofbiz.base.start.StartupCommand;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
|
||||
public class DelegatorContainer implements Container {
|
||||
private String name;
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import org.apache.ofbiz.base.concurrent.ExecutionPool;
|
||||
|
||||
import org.apache.ofbiz.base.lang.Factory;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilObject;
|
||||
|
||||
@@ -23,8 +23,8 @@ import java.util.List;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
import org.apache.ofbiz.entity.GenericEntity;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.GenericPK;
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.condition.EntityCondition;
|
||||
|
||||
public class Cache {
|
||||
|
||||
+5
-5
@@ -23,11 +23,6 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.oro.text.perl.Perl5Util;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.PatternMatcher;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.base.util.PatternFactory;
|
||||
import org.apache.ofbiz.base.util.UtilGenerics;
|
||||
@@ -37,6 +32,11 @@ import org.apache.ofbiz.entity.GenericModelException;
|
||||
import org.apache.ofbiz.entity.config.model.Datasource;
|
||||
import org.apache.ofbiz.entity.model.ModelEntity;
|
||||
import org.apache.ofbiz.entity.model.ModelField;
|
||||
import org.apache.oro.text.perl.Perl5Util;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.PatternMatcher;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
|
||||
/**
|
||||
* Base class for comparisons.
|
||||
|
||||
+2
-2
@@ -19,8 +19,6 @@
|
||||
|
||||
package org.apache.ofbiz.entity.condition;
|
||||
|
||||
import groovy.util.BuilderSupport;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -33,6 +31,8 @@ import org.apache.ofbiz.entity.GenericModelException;
|
||||
import org.apache.ofbiz.entity.config.model.Datasource;
|
||||
import org.apache.ofbiz.entity.model.ModelEntity;
|
||||
|
||||
import groovy.util.BuilderSupport;
|
||||
|
||||
public class EntityConditionBuilder extends BuilderSupport {
|
||||
public static final String module = EntityConditionBuilder.class.getName();
|
||||
|
||||
|
||||
+1
-1
@@ -20,9 +20,9 @@ package org.apache.ofbiz.entity.config.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.ofbiz.base.lang.ThreadSafe;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
|
||||
+1
-1
@@ -21,9 +21,9 @@ package org.apache.ofbiz.entity.config.model;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.ofbiz.base.lang.ThreadSafe;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
+6
-7
@@ -19,18 +19,17 @@
|
||||
|
||||
package org.apache.ofbiz.entity.connection;
|
||||
|
||||
import org.apache.commons.dbcp2.managed.ManagedDataSource;
|
||||
import org.apache.commons.dbcp2.managed.TransactionRegistry;
|
||||
import org.apache.commons.pool2.ObjectPool;
|
||||
|
||||
import org.apache.commons.pool2.impl.GenericObjectPool;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.dbcp2.managed.ManagedDataSource;
|
||||
import org.apache.commons.dbcp2.managed.TransactionRegistry;
|
||||
import org.apache.commons.pool2.ObjectPool;
|
||||
import org.apache.commons.pool2.impl.GenericObjectPool;
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
public class DebugManagedDataSource extends ManagedDataSource {
|
||||
|
||||
public static final String module = DebugManagedDataSource.class.getName();
|
||||
|
||||
-1
@@ -24,7 +24,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.apache.ofbiz.entity.GenericEntityException;
|
||||
import org.apache.ofbiz.entity.GenericPK;
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.entity.finder;
|
||||
|
||||
import java.util.Map;
|
||||
import java.io.Serializable;
|
||||
import org.w3c.dom.Element;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ofbiz.base.util.GeneralException;
|
||||
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class Finder implements Serializable {
|
||||
|
||||
@@ -26,9 +26,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
import org.apache.ofbiz.base.util.UtilXml;
|
||||
import org.apache.ofbiz.entity.Delegator;
|
||||
@@ -37,6 +34,8 @@ import org.apache.ofbiz.entity.model.ModelViewEntity.ModelAlias;
|
||||
import org.apache.ofbiz.entity.model.ModelViewEntity.ModelAliasAll;
|
||||
import org.apache.ofbiz.entity.model.ModelViewEntity.ModelMemberEntity;
|
||||
import org.apache.ofbiz.entity.model.ModelViewEntity.ModelViewLink;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
/**
|
||||
* This class is used for declaring Dynamic View Entities, to be used and thrown away.
|
||||
* A special method exists on the Delegator to accept a DynamicViewEntity instead
|
||||
|
||||
@@ -21,6 +21,7 @@ package org.apache.ofbiz.entity.model;
|
||||
import java.io.File;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ofbiz.base.util.StringUtil;
|
||||
import org.apache.ofbiz.base.util.UtilMisc;
|
||||
import org.apache.ofbiz.base.util.UtilValidate;
|
||||
|
||||
@@ -19,16 +19,16 @@
|
||||
package org.apache.ofbiz.entity.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.ofbiz.base.util.Debug;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user