Author: jacopoc
Date: Sat Feb 24 04:04:34 2007 New Revision: 511260 URL: http://svn.apache.org/viewvc?view=rev&rev=511260 Log: Small improvements to the way Long are transformed to Strings. Thanks to Stefan Huehner for the patch OFBIZ-537 Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java ofbiz/trunk/framework/workflow/src/org/ofbiz/workflow/WfApplicationServices.java Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java?view=diff&rev=511260&r1=511259&r2=511260 ============================================================================== --- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java (original) +++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java Sat Feb 24 04:04:34 2007 @@ -358,7 +358,7 @@ int origLength = numberString.length(); long number = Long.parseLong(numberString); - return padNumberString(new Long(number + addAmount).toString(), origLength); + return padNumberString(Long.toString(number + addAmount), origLength); } public static String padNumberString(String numberString, int targetMinLength) { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java?view=diff&rev=511260&r1=511259&r2=511260 ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java Sat Feb 24 04:04:34 2007 @@ -99,8 +99,7 @@ // Create the job info String jobId = dispatcher.getDelegator().getNextSeqId("JobSandbox"); - String jobName = new Long((new Date().getTime())).toString(); - + String jobName = Long.toString((new Date().getTime())); Map jFields = UtilMisc.toMap("jobId", jobId, "jobName", jobName, "runTime", UtilDateTime.nowTimestamp()); jFields.put("poolId", ServiceConfigUtil.getSendPool()); @@ -131,7 +130,7 @@ Debug.logInfo("Persisted job queued : " + jobV.getString("jobName"), module); } } else { - String name = new Long(new Date().getTime()).toString(); + String name = Long.toString(new Date().getTime()); String jobId = modelService.name + "." + name; job = new GenericServiceJob(dctx, jobId, name, modelService.name, context, requester); try { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java?view=diff&rev=511260&r1=511259&r2=511260 ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java Sat Feb 24 04:04:34 2007 @@ -397,7 +397,7 @@ // set the persisted fields if (UtilValidate.isEmpty(jobName)) { - jobName = new Long((new Date().getTime())).toString(); + jobName = Long.toString((new Date().getTime())); } String jobId = delegator.getNextSeqId("JobSandbox"); Map jFields = UtilMisc.toMap("jobId", jobId, "jobName", jobName, "runTime", new java.sql.Timestamp(startTime), Modified: ofbiz/trunk/framework/workflow/src/org/ofbiz/workflow/WfApplicationServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/workflow/src/org/ofbiz/workflow/WfApplicationServices.java?view=diff&rev=511260&r1=511259&r2=511260 ============================================================================== --- ofbiz/trunk/framework/workflow/src/org/ofbiz/workflow/WfApplicationServices.java (original) +++ ofbiz/trunk/framework/workflow/src/org/ofbiz/workflow/WfApplicationServices.java Sat Feb 24 04:04:34 2007 @@ -178,8 +178,8 @@ private static String insertAppSandbox(GenericDelegator delegator, String workEffortId, String partyId, String roleTypeId, Timestamp fromDate, Map context) throws GenericServiceException { String dataId = null; - String applicationId = new Long((new Date().getTime())).toString(); - + String applicationId = Long.toString((new Date().getTime())); + try { dataId = delegator.getNextSeqId("RuntimeData"); GenericValue runtimeData = delegator.makeValue("RuntimeData", UtilMisc.toMap("runtimeDataId", dataId)); |
Free forum by Nabble | Edit this page |