Author: mrisaliti
Date: Sun Mar 13 09:53:29 2011 New Revision: 1081066 URL: http://svn.apache.org/viewvc?rev=1081066&view=rev Log: Remove some reduntant cast warning in content component (OFBIZ-4102) Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java Sun Mar 13 09:53:29 2011 @@ -237,7 +237,7 @@ public class ContentManagementEvents { boolean statusIdUpdated = false; Map<String, Object> results = null; while (it.hasNext()) { - Object [] arr = (Object [])it.next(); + Object [] arr = it.next(); //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, arr:" + Arrays.asList(arr) , module); String contentId = (String)arr[0]; // main (2nd level) site id String origSubContentId = null; @@ -258,7 +258,7 @@ public class ContentManagementEvents { } } - String currentSubContentId = (String)siteIdLookup.get(contentId); + String currentSubContentId = siteIdLookup.get(contentId); //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, currentSubContentId:" + currentSubContentId , module); //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, origSubContentId:" + origSubContentId , module); try { @@ -332,7 +332,7 @@ public class ContentManagementEvents { oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", contentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null)); iterOldActive = oldActiveValues.iterator(); while (iterOldActive.hasNext()) { - GenericValue cAssoc = (GenericValue)iterOldActive.next(); + GenericValue cAssoc = iterOldActive.next(); cAssoc.set("thruDate", nowTimestamp); cAssoc.store(); } Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Sun Mar 13 09:53:29 2011 @@ -970,7 +970,7 @@ public class ContentManagementServices { if (i > 0) { // Swap with previous entry try { - GenericValue prevValue = (GenericValue)listFiltered.get(i-1); + GenericValue prevValue = listFiltered.get(i-1); Long prevSeqNum = (Long)prevValue.get("sequenceNum"); prevValue.put("sequenceNum", Long.valueOf(seqNum)); prevValue.store(); @@ -983,7 +983,7 @@ public class ContentManagementServices { } else { if (i < listFiltered.size()) { // Swap with next entry - GenericValue nextValue = (GenericValue)listFiltered.get(i+1); + GenericValue nextValue = listFiltered.get(i+1); nextValue.put("sequenceNum", Long.valueOf(seqNum)); nextValue.store(); seqNum += seqIncrement; @@ -1510,7 +1510,7 @@ public class ContentManagementServices { List<GenericValue> listFiltered = EntityUtil.filterByDate(contentRoleList, true); List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("fromDate DESC")); if (listOrdered.size() > 0) { - contentRole = (GenericValue) listOrdered.get(0); + contentRole = listOrdered.get(0); hasExistingContentRole = true; } } catch (GenericEntityException e) { @@ -1592,9 +1592,9 @@ public class ContentManagementServices { List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("purchaseFromDate", "purchaseThruDate")); List<GenericValue> listThrusOnly = EntityUtil.filterOutByCondition(listOrdered, EntityCondition.makeCondition("purchaseThruDate", EntityOperator.EQUALS, null)); if (listThrusOnly.size() > 0) { - productContent = (GenericValue) listThrusOnly.get(0); + productContent = listThrusOnly.get(0); } else if (listOrdered.size() > 0) { - productContent = (GenericValue) listOrdered.get(0); + productContent = listOrdered.get(0); } } catch (GenericEntityException e) { Debug.logError(e.toString(), module); @@ -1784,7 +1784,7 @@ public class ContentManagementServices { contentRevisionMap.put("oldDataResourceId", oldDataResourceId); // need committedByPartyId for (int i=0; i < parentList.size(); i++) { - String thisContentId = (String)parentList.get(i); + String thisContentId = parentList.get(i); contentRevisionMap.put("contentId", thisContentId); result = dispatcher.runSync("persistContentRevisionAndItem", contentRevisionMap); errorMsg = ServiceUtil.getErrorMessage(result); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java Sun Mar 13 09:53:29 2011 @@ -216,7 +216,7 @@ public class ContentManagementWorker { } GenericPK cachedPK = null; if (UtilValidate.isNotEmpty(entityName)) { - cachedPK = (GenericPK)currentEntityMap.get(entityName); + cachedPK = currentEntityMap.get(entityName); } getCurrentValueWithCachedPK(request, delegator, cachedPK, entityName); GenericPK currentPK = (GenericPK)request.getAttribute("currentPK"); @@ -255,7 +255,7 @@ public class ContentManagementWorker { String sPassed = null; Object oPassed = null; Object oCached = null; - String ky = (String)keyIt.next(); + String ky = keyIt.next(); oPassed = passedPK.get(ky); if (oPassed != null) { sPassed = oPassed.toString(); @@ -355,7 +355,7 @@ public class ContentManagementWorker { GenericValue contentAssoc = null; Iterator<GenericValue> it = relatedPubPts.iterator(); while (it.hasNext()) { - contentAssoc = (GenericValue)it.next(); + contentAssoc = it.next(); String pub = (String)contentAssoc.get("contentId"); //webSitePublishPoint = delegator.findByPrimaryKeyCache("WebSitePublishPoint", UtilMisc.toMap("contentId", pub)); webSitePublishPoint = getWebSitePublishPoint(delegator, pub, false); @@ -449,7 +449,7 @@ public class ContentManagementWorker { public static GenericValue getWebSitePublishPoint(Delegator delegator, String contentId, boolean ignoreCache) throws GenericEntityException { GenericValue webSitePublishPoint = null; if (!ignoreCache) - webSitePublishPoint = (GenericValue)cachedWebSitePublishPoints.get(contentId); + webSitePublishPoint = cachedWebSitePublishPoints.get(contentId); if (webSitePublishPoint == null) { webSitePublishPoint = delegator.findByPrimaryKey("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId)); @@ -717,7 +717,7 @@ public class ContentManagementWorker { List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll); Iterator<GenericValue> iter = listFiltered.iterator(); while (iter.hasNext()) { - GenericValue contentAssoc = (GenericValue)iter.next(); + GenericValue contentAssoc = iter.next(); String subContentId = contentAssoc.getString("contentId"); subLeafCount += updateStatsTopDown(delegator, subContentId, typeList); } @@ -743,7 +743,7 @@ public class ContentManagementWorker { List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll); Iterator<GenericValue> iter = listFiltered.iterator(); while (iter.hasNext()) { - GenericValue contentAssoc = (GenericValue)iter.next(); + GenericValue contentAssoc = iter.next(); String contentIdTo = contentAssoc.getString("contentIdTo"); GenericValue contentTo = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentIdTo)); int intLeafCount = 0; Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java Sun Mar 13 09:53:29 2011 @@ -117,7 +117,7 @@ public class BlogRssServices { if (contentRecs != null) { Iterator<GenericValue> i = contentRecs.iterator(); while (i.hasNext()) { - GenericValue v = (GenericValue) i.next(); + GenericValue v = i.next(); String sub = null; try { Map<String, Object> dummy = FastMap.newInstance(); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java Sun Mar 13 09:53:29 2011 @@ -105,7 +105,7 @@ public class ContentServices { Iterator<GenericValue> it = contentList.iterator(); Map<String, Object> permResults = null; while (it.hasNext()) { - GenericValue content = (GenericValue) it.next(); + GenericValue content = it.next(); serviceInMap.put("currentContent", content); try { permResults = dispatcher.runSync("checkContentPermission", serviceInMap); @@ -284,7 +284,7 @@ public class ContentServices { try { List<GenericValue> statusItems = delegator.findByAnd("StatusItem",UtilMisc.toMap("statusTypeId", "CONTENT_STATUS"), UtilMisc.toList("sequenceId")); if (!UtilValidate.isEmpty(statusItems)) { - content.put("statusId", ((GenericValue) statusItems.get(0)).getString("statusId")); + content.put("statusId", (statusItems.get(0)).getString("statusId")); } } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); @@ -845,7 +845,7 @@ public class ContentServices { Iterator<GenericValue> it = filteredAssocs.iterator(); while (it.hasNext()) { - GenericValue val = (GenericValue) it.next(); + GenericValue val = it.next(); val.set("thruDate", nowTimestamp); val.store(); //if (Debug.infoOn()) Debug.logInfo("in deactivateAssocs, val:" + val, module); @@ -1070,7 +1070,7 @@ public class ContentServices { if (mapIn != null) { Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet(); for (Map.Entry<String, Object> entry : entrySet) { - String key = (String)entry.getKey(); + String key = entry.getKey(); if (key.startsWith(prefix)) { // String keyBase = key.substring(prefix.length()); Object value = entry.getValue(); @@ -1112,7 +1112,7 @@ public class ContentServices { if (mapIn != null) { Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet(); for (Map.Entry<String, Object> entry : entrySet) { - String key = (String)entry.getKey(); + String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof String) { if (UtilValidate.isNotEmpty(value)) { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java Sun Mar 13 09:53:29 2011 @@ -142,7 +142,7 @@ public class ContentServicesComplex { return ServiceUtil.returnError(e.getMessage()); } for (int i=0; i < relatedAssocs.size(); i++) { - GenericValue a = (GenericValue)relatedAssocs.get(i); + GenericValue a = relatedAssocs.get(i); Debug.logVerbose(" contentId:" + a.get("contentId") + " To:" + a.get("caContentIdTo") + " fromDate:" + a.get("caFromDate") + " thruDate:" + a.get("caThruDate") + " AssocTypeId:" + a.get("caContentAssocTypeId"), null); } Map<String, Object> results = FastMap.newInstance(); @@ -259,7 +259,7 @@ public class ContentServicesComplex { if (assocTypes != null && assocTypes.size() > 1) { Iterator<GenericValue> it = contentAssocsDateFiltered.iterator(); while (it.hasNext()) { - contentAssoc = (GenericValue)it.next(); + contentAssoc = it.next(); contentAssocTypeId = (String)contentAssoc.get("contentAssocTypeId"); if (assocTypes.contains(contentAssocTypeId)) { contentAssocsTypeFiltered.add(contentAssoc); @@ -283,7 +283,7 @@ public class ContentServicesComplex { Locale locale = Locale.getDefault(); // TODO: this needs to be passed in Iterator<GenericValue> it = contentAssocsTypeFiltered.iterator(); while (it.hasNext()) { - contentAssoc = (GenericValue)it.next(); + contentAssoc = it.next(); content = contentAssoc.getRelatedOneCache(assocRelationName); if (UtilValidate.isNotEmpty(contentTypes)) { String contentTypeId = (String)content.get("contentTypeId"); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java Sun Mar 13 09:53:29 2011 @@ -613,7 +613,7 @@ public class ContentWorker implements or try { List<GenericValue> purposeValueList = content.getRelatedCache("ContentPurpose"); for (int i = 0; i < purposeValueList.size(); i++) { - GenericValue purposeValue = (GenericValue) purposeValueList.get(i); + GenericValue purposeValue = purposeValueList.get(i); purposes.add(purposeValue.get("contentPurposeTypeId")); } } catch (GenericEntityException e) { @@ -627,7 +627,7 @@ public class ContentWorker implements or try { List<GenericValue> sectionValueList = content.getRelatedCache("FromContentAssoc"); for (int i = 0; i < sectionValueList.size(); i++) { - GenericValue sectionValue = (GenericValue) sectionValueList.get(i); + GenericValue sectionValue = sectionValueList.get(i); String contentAssocPredicateId = (String)sectionValue.get("contentAssocPredicateId"); if (contentAssocPredicateId != null && contentAssocPredicateId.equals("categorizes")) { sections.add(sectionValue.get("contentIdTo")); @@ -644,7 +644,7 @@ public class ContentWorker implements or try { List<GenericValue> topicValueList = content.getRelatedCache("FromContentAssoc"); for (int i = 0; i < topicValueList.size(); i++) { - GenericValue topicValue = (GenericValue) topicValueList.get(i); + GenericValue topicValue = topicValueList.get(i); String contentAssocPredicateId = (String)topicValue.get("contentAssocPredicateId"); if (contentAssocPredicateId != null && contentAssocPredicateId.equals("topifies")) topics.add(topicValue.get("contentIdTo")); @@ -689,7 +689,7 @@ public class ContentWorker implements or //if (Debug.infoOn()) Debug.logInfo("traverse, relatedViews:" + relatedViews,null); Iterator<GenericValue> it = relatedViews.iterator(); while (it.hasNext()) { - GenericValue assocValue = (GenericValue) it.next(); + GenericValue assocValue = it.next(); Map<String, Object> thisNode = ContentWorker.makeNode(assocValue); checkConditions(delegator, thisNode, null, whenMap); // boolean isReturnBeforePick = booleanDataType(thisNode.get("isReturnBeforePick")); @@ -852,7 +852,7 @@ public class ContentWorker implements or List<EntityExpr> exprListOr = FastList.newInstance(); Iterator<String> it = assocTypes.iterator(); while (it.hasNext()) { - String assocType = (String) it.next(); + String assocType = it.next(); expr = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.EQUALS, assocType); exprListOr.add(expr); } @@ -934,7 +934,7 @@ public class ContentWorker implements or List<GenericValue> lst2 = EntityUtil.filterByDate(lst); //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, ""); if (lst2.size() > 0) { - GenericValue contentAssoc = (GenericValue)lst2.get(0); + GenericValue contentAssoc = lst2.get(0); getContentAncestry(delegator, contentAssoc.getString(contentIdOtherField), contentAssocTypeId, direction, contentAncestorList); contentAncestorList.add(contentAssoc); } @@ -964,7 +964,7 @@ public class ContentWorker implements or //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, ""); Iterator<GenericValue> iter = lst2.iterator(); while (iter.hasNext()) { - GenericValue contentAssoc = (GenericValue)iter.next(); + GenericValue contentAssoc = iter.next(); String contentIdOther = contentAssoc.getString(contentIdOtherField); if (!contentAncestorList.contains(contentIdOther)) { getContentAncestryAll(delegator, contentIdOther, passedContentTypeId, direction, contentAncestorList); @@ -1020,7 +1020,7 @@ public class ContentWorker implements or List<GenericValue> lst2 = EntityUtil.filterByDate(lst); //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, ""); if (lst2.size() > 0) { - GenericValue contentAssoc = (GenericValue)lst2.get(0); + GenericValue contentAssoc = lst2.get(0); getContentAncestryValues(delegator, contentAssoc.getString(contentIdOtherField), contentAssocTypeId, direction, contentAncestorList); GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentAssoc.getString(contentIdOtherField))); @@ -1415,7 +1415,7 @@ public class ContentWorker implements or GenericValue val = null; if (filteredList.size() > 0) { - val = (GenericValue)filteredList.get(0); + val = filteredList.get(0); } return val; } Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java Sun Mar 13 09:53:29 2011 @@ -101,7 +101,7 @@ public class UploadContentAndImage { FileItem imageFi = null; byte[] imageBytes = {}; for (int i = 0; i < lst.size(); i++) { - fi = (FileItem) lst.get(i); + fi = lst.get(i); //String fn = fi.getName(); String fieldName = fi.getFieldName(); if (fi.isFormField()) { @@ -368,7 +368,7 @@ public class UploadContentAndImage { byte[] imageBytes = {}; passedParams.put("userLogin", userLogin); for (int i = 0; i < lst.size(); i++) { - fi = (FileItem) lst.get(i); + fi = lst.get(i); //String fn = fi.getName(); String fieldName = fi.getFieldName(); if (fi.isFormField()) { @@ -467,7 +467,7 @@ public class UploadContentAndImage { Map<String, Object> ftlContext2 = FastMap.newInstance(); Map<String, Object> ftlContext3 = FastMap.newInstance(); while (iter.hasNext()) { - String keyName = (String)iter.next(); + String keyName = iter.next(); Object obj = passedParams.get(keyName + suffix); ftlContext2.put(keyName, obj); } Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java Sun Mar 13 09:53:29 2011 @@ -595,7 +595,7 @@ public class LayoutEvents { Collection<String> keyColl = passedPK.getAllKeys(); Iterator<String> keyIt = keyColl.iterator(); while (keyIt.hasNext()) { - String attrName = (String)keyIt.next(); + String attrName = keyIt.next(); String attrVal = (String)request.getAttribute(attrName); if (attrVal == null) { attrVal = (String)paramMap.get(attrName); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java Sun Mar 13 09:53:29 2011 @@ -114,7 +114,7 @@ public class LayoutWorker { } public static ByteBuffer returnByteBuffer(Map<String, ByteBuffer> map) { - ByteBuffer byteBuff = (ByteBuffer)map.get("imageData"); + ByteBuffer byteBuff = map.get("imageData"); return byteBuff; } } Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java Sun Mar 13 09:53:29 2011 @@ -283,7 +283,7 @@ public class PdfSurveyServices { continue; } - GenericValue surveyQuestionAndAppl = (GenericValue)questions.get(0); + GenericValue surveyQuestionAndAppl = questions.get(0); String surveyQuestionId = (String)surveyQuestionAndAppl.get("surveyQuestionId"); String surveyQuestionTypeId = (String)surveyQuestionAndAppl.get("surveyQuestionTypeId"); GenericValue surveyResponseAnswer = delegator.makeValue("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId, "surveyQuestionId", surveyQuestionId)); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java Sun Mar 13 09:53:29 2011 @@ -379,7 +379,7 @@ public class SurveyWrapper { if (UtilValidate.isNotEmpty(passThru)) { Iterator<String> i = passThru.keySet().iterator(); while (i.hasNext()) { - String key = (String) i.next(); + String key = i.next(); if (key.toUpperCase().startsWith("ANSWERS_")) { int splitIndex = key.indexOf('_'); String questionId = key.substring(splitIndex+1); @@ -486,7 +486,7 @@ public class SurveyWrapper { Iterator<String> i = thisResult.keySet().iterator(); while (i.hasNext()) { Map<String, Object> optMap = FastMap.newInstance(); - String optId = (String) i.next(); + String optId = i.next(); Long optTotal = (Long) thisResult.get(optId); if (optTotal == null) { optTotal = Long.valueOf(0); @@ -553,7 +553,7 @@ public class SurveyWrapper { if (eli != null) { GenericValue value; - while (((value = (GenericValue) eli.next()) != null)) { + while (((value = eli.next()) != null)) { if ("Y".equalsIgnoreCase(value.getString("booleanResponse"))) { result[1]++; } else { @@ -600,7 +600,7 @@ public class SurveyWrapper { if (eli != null) { GenericValue value; - while (((value = (GenericValue) eli.next()) != null)) { + while (((value = eli.next()) != null)) { switch (type) { case 1: Long n = value.getLong("numericResponse"); @@ -688,7 +688,7 @@ public class SurveyWrapper { EntityListIterator eli = this.getEli(question, -1); if (eli != null) { GenericValue value; - while (((value = (GenericValue) eli.next()) != null)) { + while (((value = eli.next()) != null)) { String optionId = value.getString("surveyOptionSeqId"); if (UtilValidate.isNotEmpty(optionId)) { Long optCount = (Long) result.remove(optionId); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java?rev=1081066&r1=1081065&r2=1081066&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java Sun Mar 13 09:53:29 2011 @@ -90,7 +90,7 @@ public class LoopSubContentTransform imp } else if (i >= lst.size()) { return false; } - GenericValue subContentDataResourceView = (GenericValue) lst.get(i); + GenericValue subContentDataResourceView = lst.get(i); ctx.put("subContentDataResourceView", subContentDataResourceView); GenericValue electronicText = null; try { |
Free forum by Nabble | Edit this page |