Author: jleroux
Date: Sun Nov 17 10:53:42 2013 New Revision: 1542704 URL: http://svn.apache.org/r1542704 Log: No functional change. This did not make sense: the pattern was compiled and then the string compiled was retrieved. Also removes 2 trailing blanks Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java (contents, props changed) Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java?rev=1542704&r1=1542703&r2=1542704&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java Sun Nov 17 10:53:42 2013 @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.sql.Timestamp; import java.util.List; import java.util.Random; -import java.util.regex.Pattern; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilDateTime; @@ -71,7 +70,7 @@ public class FinAccountHelper { /** * A convenience method which adds transactions.get(0).get(fieldName) to initialValue, all done in BigDecimal to decimals and rounding - * @param initialValue the initial value + * @param initialValue the initial value * @param transactions a List of GenericValue objects of transactions * @param fieldName the field name to get the value from the transaction * @param decimals number of decimals @@ -136,13 +135,10 @@ public class FinAccountHelper { * @throws GenericEntityException */ public static GenericValue getFinAccountFromCode(String finAccountCode, Delegator delegator) throws GenericEntityException { - // regex magic to turn all letters in code to uppercase and then remove all non-alphanumeric letters if (finAccountCode == null) { return null; } - - Pattern filterRegex = Pattern.compile("[^0-9A-Z]"); - finAccountCode = finAccountCode.toUpperCase().replaceAll(filterRegex.pattern(), ""); + finAccountCode = finAccountCode.toUpperCase().replaceAll("[^0-9A-Z]", ""); // now we need to get the encrypted version of the fin account code the user passed in to look up against FinAccount // we do this by making a temporary generic entity with same finAccountCode and then doing a match @@ -212,7 +208,7 @@ public class FinAccountHelper { * @param finAccountId the financial account id * @param asOfDateTime the validity date * @param delegator the delegator - * @return returns the net balance (see above) minus the sum of all authorization amounts which are not expired + * @return returns the net balance (see above) minus the sum of all authorization amounts which are not expired * @throws GenericEntityException */ public static BigDecimal getAvailableBalance(String finAccountId, Timestamp asOfDateTime, Delegator delegator) throws GenericEntityException { Propchange: ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Sun Nov 17 10:53:42 2013 @@ -0,0 +1,7 @@ +/ofbiz/branches/2013_RemoveJavolution/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java:1462755 +/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java:1535158-1542703 +/ofbiz/branches/addbirt/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java:831210-885099,885686-886087 +/ofbiz/branches/dojo1.4/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java:951708-952957 +/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java:962442-1231517 +/ofbiz/branches/jquery/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java:952958-1044489 +/ofbiz/branches/multitenant20100310/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java:921280-927264 |
Free forum by Nabble | Edit this page |