From b9fec5ba2aaaabe6c22e3693cf4677beccc443b4 Mon Sep 17 00:00:00 2001 From: Ashish Vijaywargiya Date: Sat, 27 Aug 2016 12:57:25 +0000 Subject: [PATCH] Applied patch from jira issue - OFBIZ-7857 - Clean up commented out code in Java source for Workeffort. Thanks Harsh for the contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758022 13f79535-47bb-0310-9956-ffa450edef68 --- .../workeffort/WorkEffortSearch.java | 29 ------------------- .../workeffort/WorkEffortServices.java | 11 ------- 2 files changed, 40 deletions(-) diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearch.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearch.java index 69b8082c64..d8f21ed165 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearch.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearch.java @@ -303,8 +303,6 @@ public class WorkEffortSearch { } dynamicViewEntity.addAlias("WEFF", "workEffortId", null, null, null, Boolean.valueOf(workEffortIdGroupBy), null); - // Debug.logInfo("WorkEffortSearch, whereCondition = " + whereCondition.toString(), module); - EntityListIterator eli = null; try { int maxRows = 0; @@ -338,18 +336,6 @@ public class WorkEffortSearch { boolean hasResults = false; Object initialResult = null; - /* this method has been replaced by the following to address issue with SAP DB and possibly other DBs - if (resultOffset != null) { - Debug.logInfo("Before relative, current index=" + eli.currentIndex(), module); - hasResults = eli.relative(resultOffset.intValue()); - } else { - initialResult = eli.next(); - if (initialResult != null) { - hasResults = true; - } - } - */ - initialResult = eli.next(); if (initialResult != null) { hasResults = true; @@ -399,21 +385,6 @@ public class WorkEffortSearch { } else { duplicatesFound++; } - - /* - StringBuilder lineMsg = new StringBuilder("Got search result line: "); - Iterator fieldsToSelectIter = fieldsToSelect.iterator(); - while (fieldsToSelectIter.hasNext()) { - String fieldName = fieldsToSelectIter.next(); - lineMsg.append(fieldName); - lineMsg.append("="); - lineMsg.append(searchResult.get(fieldName)); - if (fieldsToSelectIter.hasNext()) { - lineMsg.append(", "); - } - } - Debug.logInfo(lineMsg.toString(), module); - */ } if (searchResult != null) { diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java index e5546b9453..c6678af261 100644 --- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java +++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java @@ -504,7 +504,6 @@ public class WorkEffortServices { Collection partyIds = UtilGenerics.checkCollection(context.get("partyIds")); String facilityId = (String) context.get("facilityId"); String fixedAssetId = (String) context.get("fixedAssetId"); - // Debug.logInfo("======by period for fixedAsset: " + fixedAssetId + " facilityId: " + facilityId + "partyId: " + partyId + " entityExprList:" + (List) context.get("entityExprList")); String workEffortTypeId = (String) context.get("workEffortTypeId"); Boolean filterOutCanceledEvents = (Boolean) context.get("filterOutCanceledEvents"); if (filterOutCanceledEvents == null) { @@ -527,7 +526,6 @@ public class WorkEffortServices { // get a timestamp (date) for the beginning of today and for beginning of numDays+1 days from now // Commenting this out because it interferes with periods that do not start at the beginning of the day - // Timestamp startStamp = UtilDateTime.getDayStart(startDay, timeZone, locale); Timestamp startStamp = startDay; Timestamp endStamp = UtilDateTime.adjustTimestamp(startStamp, periodType, 1, timeZone, locale); long periodLen = endStamp.getTime() - startStamp.getTime(); @@ -613,18 +611,9 @@ public class WorkEffortServices { entityExprList.addAll(periodCheckAndlList); - // (non cancelled) recurring events - /* Commenting this out. This condition adds ALL recurring events to ALL calendars. - List recurringEvents = UtilMisc.toList(EntityCondition.makeCondition("tempExprId", EntityOperator.NOT_EQUAL, null)); - if (filterOutCanceledEvents.booleanValue()) { - recurringEvents.addAll(cancelledCheckAndList); - } - */ - try { List tempWorkEfforts = null; if (UtilValidate.isNotEmpty(partyIdsToUse)) { - // Debug.logInfo("=====conditions for party: " + eclTotal); tempWorkEfforts = EntityQuery.use(delegator).from("WorkEffortAndPartyAssignAndType").where(entityExprList).orderBy("estimatedStartDate").filterByDate().queryList(); } else { tempWorkEfforts = EntityQuery.use(delegator).from("WorkEffort").where(entityExprList).orderBy("estimatedStartDate").queryList();