Author: adrianc
Date: Sun Apr 4 05:27:07 2010 New Revision: 930626 URL: http://svn.apache.org/viewvc?rev=930626&view=rev Log: A patch from Bob Morley (https://issues.apache.org/jira/browse/OFBIZ-3592) with modifications from me - fix Eclipse/compiler warnings in the Work Effort application. Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java Sun Apr 4 05:27:07 2010 @@ -81,6 +81,7 @@ import org.ofbiz.base.util.DateRange; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.ObjectType; import org.ofbiz.base.util.TimeDuration; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; @@ -317,7 +318,6 @@ public class ICalConverter { return null; } - @SuppressWarnings("unchecked") protected static void getAlarms(GenericValue workEffort, ComponentList alarms) throws GenericEntityException { Description description = null; if (workEffort.get("description") != null) { @@ -334,7 +334,7 @@ public class ICalConverter { VAlarm alarm = null; PropertyList alarmProps = null; boolean newAlarm = true; - Iterator<VAlarm> i = alarms.iterator(); + Iterator<VAlarm> i = UtilGenerics.cast(alarms.iterator()); while (i.hasNext()) { alarm = i.next(); Property xProperty = alarm.getProperty(reminderXPropName); @@ -439,11 +439,10 @@ public class ICalConverter { } } - @SuppressWarnings("unchecked") protected static List<GenericValue> getRelatedWorkEfforts(GenericValue workEffort, Map<String, Object> context) throws GenericEntityException { Map<String, ? extends Object> serviceMap = UtilMisc.toMap("workEffortId", workEffort.getString("workEffortId")); Map<String, Object> resultMap = invokeService("getICalWorkEfforts", serviceMap, context); - List<GenericValue> workEfforts = (List) resultMap.get("workEfforts"); + List<GenericValue> workEfforts = UtilGenerics.checkList(resultMap.get("workEfforts"), GenericValue.class); if (workEfforts != null) { return WorkEffortWorker.removeDuplicateWorkEfforts(workEfforts); } @@ -523,7 +522,6 @@ public class ICalConverter { } } - @SuppressWarnings("unchecked") protected static void loadRelatedParties(List<GenericValue> relatedParties, PropertyList componentProps, Map<String, Object> context) { PropertyList attendees = componentProps.getProperties("ATTENDEE"); for (GenericValue partyValue : relatedParties) { @@ -534,7 +532,7 @@ public class ICalConverter { String partyId = partyValue.getString("partyId"); boolean newAttendee = true; Attendee attendee = null; - Iterator<Attendee> i = attendees.iterator(); + Iterator<Attendee> i = UtilGenerics.cast(attendees.iterator()); while (i.hasNext()) { attendee = i.next(); Parameter xParameter = attendee.getParameter(partyIdXParamName); @@ -690,7 +688,6 @@ public class ICalConverter { * @throws GenericEntityException * @throws GenericServiceException */ - @SuppressWarnings("unchecked") public static ResponseProperties storeCalendar(InputStream is, Map<String, Object> context) throws IOException, ParserException, GenericEntityException, GenericServiceException { CalendarBuilder builder = new CalendarBuilder(); Calendar calendar = null; @@ -727,14 +724,14 @@ public class ICalConverter { } boolean hasCreatePermission = hasPermission(workEffortId, "CREATE", context); List<GenericValue> workEfforts = getRelatedWorkEfforts(publishProperties, context); - Set validWorkEfforts = FastSet.newInstance(); + Set<String> validWorkEfforts = FastSet.newInstance(); if (UtilValidate.isNotEmpty(workEfforts)) { // Security issue: make sure only related work efforts get updated for (GenericValue workEffort : workEfforts) { validWorkEfforts.add(workEffort.getString("workEffortId")); } } - List<Component> components = calendar.getComponents(); + List<Component> components = UtilGenerics.checkList(calendar.getComponents(), Component.class); ResponseProperties responseProps = null; for (Component component : components) { if (Component.VEVENT.equals(component.getName()) || Component.VTODO.equals(component.getName())) { @@ -779,14 +776,13 @@ public class ICalConverter { return ICalWorker.createOkResponse(null); } - @SuppressWarnings("unchecked") protected static ResponseProperties storePartyAssignments(String workEffortId, Component component, Map<String, Object> context) { ResponseProperties responseProps = null; Map<String, Object> serviceMap = FastMap.newInstance(); List<Property> partyList = FastList.newInstance(); - partyList.addAll(component.getProperties("ATTENDEE")); - partyList.addAll(component.getProperties("CONTACT")); - partyList.addAll(component.getProperties("ORGANIZER")); + partyList.addAll(UtilGenerics.checkList(component.getProperties("ATTENDEE"), Property.class)); + partyList.addAll(UtilGenerics.checkList(component.getProperties("CONTACT"), Property.class)); + partyList.addAll(UtilGenerics.checkList(component.getProperties("ORGANIZER"), Property.class)); for (Property property : partyList) { String partyId = fromXParameter(property.getParameters(), partyIdXParamName); if (partyId == null) { @@ -842,7 +838,6 @@ public class ICalConverter { return storePartyAssignments(workEffortId, component, context); } - @SuppressWarnings("unchecked") protected static ResponseProperties toCalendarComponent(ComponentList components, GenericValue workEffort, Map<String, Object> context) throws GenericEntityException { Delegator delegator = workEffort.getDelegator(); String workEffortId = workEffort.getString("workEffortId"); @@ -862,7 +857,7 @@ public class ICalConverter { } else { return null; } - Iterator<Component> i = resultList.iterator(); + Iterator<Component> i = UtilGenerics.cast(resultList.iterator()); while (i.hasNext()) { result = i.next(); Property xProperty = result.getProperty(workEffortIdXPropName); Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java Sun Apr 4 05:27:07 2010 @@ -36,7 +36,6 @@ import org.ofbiz.webapp.webdav.RequestHa /** WebDAV request handler factory for iCalendar. This class is a simple connector * between the WebDAV servlet and the <code>ICalWorker</code> class. */ -@SuppressWarnings("serial") public class ICalHandlerFactory implements RequestHandlerFactory { public static final String module = ICalHandlerFactory.class.getName(); Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java Sun Apr 4 05:27:07 2010 @@ -38,6 +38,7 @@ import javolution.util.FastList; import javolution.util.FastMap; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilJ2eeCompat; import org.ofbiz.base.util.UtilMisc; @@ -72,10 +73,9 @@ public class ICalWorker { } } - @SuppressWarnings("unchecked") protected static Map<String, Object> createConversionContext(HttpServletRequest request) { Map<String, Object> context = FastMap.newInstance(); - Enumeration<String> attributeEnum = request.getAttributeNames(); + Enumeration<String> attributeEnum = UtilGenerics.cast(request.getAttributeNames()); while (attributeEnum.hasMoreElements()) { String attributeName = attributeEnum.nextElement(); context.put(attributeName, request.getAttribute(attributeName)); Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java Sun Apr 4 05:27:07 2010 @@ -20,8 +20,6 @@ package org.ofbiz.workeffort.workeffort; import java.io.IOException; -import java.util.Arrays; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; @@ -70,18 +68,16 @@ public class WorkEffortKeywordIndex { addWeightedKeywordSourceString(workEffort, "currentStatusId", strings); if (!"0".equals(UtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortNoteAndData.noteInfo", "1"))) { - Iterator workEffortNotes = UtilMisc.toIterator(delegator.findByAnd("WorkEffortNoteAndData", UtilMisc.toMap("workEffortId", workEffortId))); - while (workEffortNotes != null && workEffortNotes.hasNext()) { - GenericValue workEffortNote = (GenericValue) workEffortNotes.next(); + List<GenericValue> workEffortNotes = delegator.findByAnd("WorkEffortNoteAndData", UtilMisc.toMap("workEffortId", workEffortId)); + for (GenericValue workEffortNote : workEffortNotes) { addWeightedKeywordSourceString(workEffortNote, "noteInfo", strings); } } //WorkEffortAttribute if (!"0".equals(UtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortAttribute.attrName", "1")) || !"0".equals(UtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortAttribute.attrValue", "1"))) { - Iterator workEffortAttributes = UtilMisc.toIterator(delegator.findByAnd("WorkEffortAttribute", UtilMisc.toMap("workEffortId", workEffortId))); - while (workEffortAttributes != null && workEffortAttributes.hasNext()) { - GenericValue workEffortAttribute = (GenericValue) workEffortAttributes.next(); + List<GenericValue> workEffortAttributes = delegator.findByAnd("WorkEffortAttribute", UtilMisc.toMap("workEffortId", workEffortId)); + for (GenericValue workEffortAttribute : workEffortAttributes) { addWeightedKeywordSourceString(workEffortAttribute, "attrName", strings); addWeightedKeywordSourceString(workEffortAttribute, "attrValue", strings); } Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java Sun Apr 4 05:27:07 2010 @@ -44,7 +44,6 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityConditionList; import org.ofbiz.entity.condition.EntityExpr; -import org.ofbiz.entity.condition.EntityFieldValue; import org.ofbiz.entity.condition.EntityFunction; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.model.DynamicViewEntity; @@ -483,7 +482,8 @@ public class WorkEffortSearch { // Search Constraint Classes // ====================================================================== - public static abstract class WorkEffortSearchConstraint implements java.io.Serializable { + @SuppressWarnings("serial") + public static abstract class WorkEffortSearchConstraint implements java.io.Serializable { public WorkEffortSearchConstraint() { } public abstract void addConstraint(WorkEffortSearchContext workEffortSearchContext); @@ -492,7 +492,8 @@ public class WorkEffortSearch { } - public static class WorkEffortAssocConstraint extends WorkEffortSearchConstraint { + @SuppressWarnings("serial") + public static class WorkEffortAssocConstraint extends WorkEffortSearchConstraint { public static final String constraintName = "WorkEffortAssoc"; protected String workEffortId; protected String workEffortAssocTypeId; @@ -641,6 +642,8 @@ public class WorkEffortSearch { } } } + + @SuppressWarnings("serial") public static class WorkEffortReviewConstraint extends WorkEffortSearchConstraint { public static final String constraintName = "WorkEffortReview"; protected String reviewTextString; @@ -694,6 +697,7 @@ public class WorkEffortSearch { } } + @SuppressWarnings("serial") public static class PartyAssignmentConstraint extends WorkEffortSearchConstraint { public static final String constraintName = "PartyAssignment"; protected String partyId; @@ -804,7 +808,8 @@ public class WorkEffortSearch { } } - public static class ProductSetConstraint extends WorkEffortSearchConstraint { + @SuppressWarnings("serial") + public static class ProductSetConstraint extends WorkEffortSearchConstraint { public static final String constraintName = "ProductSet"; protected Set<String> productIdSet; @@ -891,6 +896,7 @@ public class WorkEffortSearch { } } + @SuppressWarnings("serial") public static class KeywordConstraint extends WorkEffortSearchConstraint { public static final String constraintName = "Keyword"; protected String keywordsString; @@ -1011,6 +1017,7 @@ public class WorkEffortSearch { } } + @SuppressWarnings("serial") public static class LastUpdatedRangeConstraint extends WorkEffortSearchConstraint { public static final String constraintName = "LastUpdatedRange"; protected Timestamp fromDate; @@ -1099,6 +1106,7 @@ public class WorkEffortSearch { // Result Sort Classes // ====================================================================== + @SuppressWarnings("serial") public static abstract class ResultSortOrder implements java.io.Serializable { public ResultSortOrder() { } @@ -1109,6 +1117,7 @@ public class WorkEffortSearch { public abstract boolean isAscending(); } + @SuppressWarnings("serial") public static class SortKeywordRelevancy extends ResultSortOrder { public SortKeywordRelevancy() { } @@ -1138,6 +1147,7 @@ public class WorkEffortSearch { } } + @SuppressWarnings("serial") public static class SortWorkEffortField extends ResultSortOrder { protected String fieldName; protected boolean ascending; Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchEvents.java Sun Apr 4 05:27:07 2010 @@ -40,7 +40,7 @@ public class WorkEffortSearchEvents { public static final String module = WorkEffortSearchEvents.class.getName(); - public static Map getWorkEffortSearchResult(HttpServletRequest request, Delegator delegator) { + public static Map<String, Object> getWorkEffortSearchResult(HttpServletRequest request, Delegator delegator) { // ========== Create View Indexes int viewIndex = 0; @@ -65,7 +65,7 @@ public class WorkEffortSearchEvents { Integer maxResults = Integer.valueOf(viewSize); // ========== Do the actual search - ArrayList workEffortIds = null; + ArrayList<String> workEffortIds = null; String visitId = VisitHandler.getVisitId(session); List<WorkEffortSearchConstraint> workEffortSearchConstraintList = WorkEffortSearchOptions.getConstraintList(session); // if no constraints, don't do a search... Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java Sun Apr 4 05:27:07 2010 @@ -19,7 +19,6 @@ package org.ofbiz.workeffort.workeffort; import java.sql.Timestamp; -import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -36,13 +35,15 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.workeffort.workeffort.WorkEffortSearch.ResultSortOrder; -import org.ofbiz.workeffort.workeffort.WorkEffortSearch.WorkEffortSearchConstraint; import org.ofbiz.workeffort.workeffort.WorkEffortSearch.SortKeywordRelevancy; +import org.ofbiz.workeffort.workeffort.WorkEffortSearch.WorkEffortSearchConstraint; public class WorkEffortSearchSession { public static final String module = WorkEffortSearchSession.class.getName(); - public static class WorkEffortSearchOptions implements java.io.Serializable { + + @SuppressWarnings("serial") + public static class WorkEffortSearchOptions implements java.io.Serializable { protected List<WorkEffortSearchConstraint> constraintList = null; protected ResultSortOrder resultSortOrder = null; protected Integer viewIndex = null; Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Sun Apr 4 05:27:07 2010 @@ -108,7 +108,7 @@ public class WorkEffortServices { Delegator delegator = ctx.getDelegator(); String roleTypeId = (String) context.get("roleTypeId"); - List validWorkEfforts = null; + List<GenericValue> validWorkEfforts = null; try { List<EntityExpr> conditionList = FastList.newInstance(); @@ -300,7 +300,7 @@ public class WorkEffortServices { } Boolean canView = null; - Collection workEffortPartyAssignments = null; + List<GenericValue> workEffortPartyAssignments = null; Boolean tryEntity = null; GenericValue currentStatus = null; @@ -318,7 +318,7 @@ public class WorkEffortServices { } } } else { - // get a collection of workEffortPartyAssignments, if empty then this user CANNOT view the event, unless they have permission to view all + // get a list of workEffortPartyAssignments, if empty then this user CANNOT view the event, unless they have permission to view all if (userLogin != null && userLogin.get("partyId") != null && workEffortId != null) { try { workEffortPartyAssignments = delegator.findByAnd("WorkEffortPartyAssignment", UtilMisc.toMap("workEffortId", workEffortId, "partyId", userLogin.get("partyId"))); @@ -352,8 +352,8 @@ public class WorkEffortServices { } private static TreeMap<DateRange, List<Map<String, Object>>> groupCalendarEntriesByDateRange(DateRange inDateRange, List<Map<String, Object>> calendarEntries) { - TreeMap<DateRange, List<Map<String, Object>>> calendarEntriesByDateRange = new TreeMap(); - TreeSet<Date> dateBoundaries = new TreeSet(); + TreeMap<DateRange, List<Map<String, Object>>> calendarEntriesByDateRange = new TreeMap<DateRange, List<Map<String, Object>>>(); + TreeSet<Date> dateBoundaries = new TreeSet<Date>(); if (inDateRange != null) { dateBoundaries.add(inDateRange.start()); dateBoundaries.add(inDateRange.end()); @@ -766,7 +766,7 @@ public class WorkEffortServices { findIncomingProductionRunsStatusConds.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, "PRUN_RUNNING")); findIncomingProductionRunsConds.add(EntityCondition.makeCondition(findIncomingProductionRunsStatusConds, EntityOperator.OR)); - EntityConditionList findIncomingProductionRunsCondition = EntityCondition.makeCondition(findIncomingProductionRunsConds, EntityOperator.AND); + EntityConditionList<EntityCondition> findIncomingProductionRunsCondition = EntityCondition.makeCondition(findIncomingProductionRunsConds, EntityOperator.AND); List<GenericValue> incomingProductionRuns = delegator.findList("WorkEffortAndGoods", findIncomingProductionRunsCondition, null, UtilMisc.toList("-estimatedCompletionDate"), null, false); for (GenericValue incomingProductionRun: incomingProductionRuns) { @@ -833,7 +833,7 @@ public class WorkEffortServices { findOutgoingProductionRunsStatusConds.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, "PRUN_RUNNING")); findOutgoingProductionRunsConds.add(EntityCondition.makeCondition(findOutgoingProductionRunsStatusConds, EntityOperator.OR)); - EntityConditionList findOutgoingProductionRunsCondition = EntityCondition.makeCondition(findOutgoingProductionRunsConds, EntityOperator.AND); + EntityConditionList<EntityCondition> findOutgoingProductionRunsCondition = EntityCondition.makeCondition(findOutgoingProductionRunsConds, EntityOperator.AND); List<GenericValue> outgoingProductionRuns = delegator.findList("WorkEffortAndGoods", findOutgoingProductionRunsCondition, null, UtilMisc.toList("-estimatedStartDate"), null, false); for (GenericValue outgoingProductionRun: outgoingProductionRuns) { String weFacilityId = outgoingProductionRun.getString("facilityId"); Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java?rev=930626&r1=930625&r2=930626&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java Sun Apr 4 05:27:07 2010 @@ -30,6 +30,7 @@ import javolution.util.FastList; import javolution.util.FastSet; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; @@ -37,6 +38,7 @@ import org.ofbiz.entity.GenericEntityExc import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityConditionList; +import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.security.Security; import org.ofbiz.service.GenericServiceException; @@ -160,8 +162,7 @@ public class WorkEffortWorker { if (result != null && result.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR)) Debug.logError((String) result.get(ModelService.ERROR_MESSAGE), module); if (result != null && result.containsKey("activityContext")) { - Map aC = (Map) result.get("activityContext"); - + Object aC = UtilGenerics.checkMap(result.get("activityContext")); pageContext.setAttribute(attribute, aC); } } @@ -180,19 +181,19 @@ public class WorkEffortWorker { List<GenericValue> workEfforts = FastList.newInstance(); try { - EntityConditionList exprsLevelFirst = EntityCondition.makeCondition(UtilMisc.toList( + EntityConditionList<EntityExpr> exprsLevelFirst = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition(left, workEffortId), EntityCondition.makeCondition("workEffortAssocTypeId", workEffortAssocTypeId)), EntityOperator.AND); List<GenericValue> childWEAssocsLevelFirst = delegator.findList("WorkEffortAssoc", exprsLevelFirst, null, null, null, true); for (GenericValue childWEAssocLevelFirst : childWEAssocsLevelFirst) { - EntityConditionList exprsLevelNext = EntityCondition.makeCondition(UtilMisc.toList( + EntityConditionList<EntityExpr> exprsLevelNext = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition(left, childWEAssocLevelFirst.get(right)), EntityCondition.makeCondition("workEffortAssocTypeId", workEffortAssocTypeId)), EntityOperator.AND); List<GenericValue> childWEAssocsLevelNext = delegator.findList("WorkEffortAssoc", exprsLevelNext, null, null, null, true); while (UtilValidate.isNotEmpty(childWEAssocsLevelNext)) { List<GenericValue> tempWorkEffortList = FastList.newInstance(); for (GenericValue childWEAssocLevelNext : childWEAssocsLevelNext) { - EntityConditionList exprsLevelNth = EntityCondition.makeCondition(UtilMisc.toList( + EntityConditionList<EntityExpr> exprsLevelNth = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition(left, childWEAssocLevelNext.get(right)), EntityCondition.makeCondition("workEffortAssocTypeId", workEffortAssocTypeId)), EntityOperator.AND); List<GenericValue> childWEAssocsLevelNth = delegator.findList("WorkEffortAssoc", exprsLevelNth, null, null, null, true); |
Free forum by Nabble | Edit this page |