Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java Sun Aug 17 00:47:18 2008 @@ -30,6 +30,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.ObjectType; import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilValidate; /** * Generic Service Model Parameter @@ -108,7 +109,7 @@ } public String getPrimaryFailMessage(Locale locale) { - if (validators != null && validators.size() > 0) { + if (UtilValidate.isNotEmpty(validators)) { return validators.get(0).getFailMessage(locale); } else { return null; Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java Sun Aug 17 00:47:18 2008 @@ -18,18 +18,18 @@ *******************************************************************************/ package org.ofbiz.service; +import java.io.Serializable; +import java.util.List; +import java.util.Map; + import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.security.Security; -import java.io.Serializable; -import java.util.List; -import java.util.Map; - /** * Service Permission Model Class */ @@ -99,9 +99,9 @@ Debug.logError(e, "Unable to lookup PartyRole records", module); } - if (partyRoles != null && partyRoles.size() > 0) { + if (UtilValidate.isNotEmpty(partyRoles)) { partyRoles = EntityUtil.filterByDate(partyRoles); - if (partyRoles != null && partyRoles.size() > 0) { + if (UtilValidate.isNotEmpty(partyRoles)) { return true; } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java Sun Aug 17 00:47:18 2008 @@ -551,7 +551,7 @@ Object testObject = test.get(key); String infoType = info.get(key); - if (param.validators != null && param.validators.size() > 0) { + if (UtilValidate.isNotEmpty(param.validators)) { for (ModelParam.ModelParamValidator val: param.validators) { if (UtilValidate.isNotEmpty(val.getMethodName())) { try { @@ -773,13 +773,13 @@ // internal map of strings if (param.stringMapPrefix != null && param.stringMapPrefix.length() > 0 && !source.containsKey(key)) { Map<String, Object> paramMap = this.makePrefixMap(source, param); - if (paramMap != null && paramMap.size() > 0) { + if (UtilValidate.isNotEmpty(paramMap)) { target.put(key, paramMap); } // internal list of strings } else if (param.stringListSuffix != null && param.stringListSuffix.length() > 0 && !source.containsKey(key)) { List<Object> paramList = this.makeSuffixList(source, param); - if (paramList != null && paramList.size() > 0) { + if (UtilValidate.isNotEmpty(paramList)) { target.put(key, paramList); } // other attributes @@ -1034,7 +1034,7 @@ } // handle any override parameters - if (overrideParameters != null && overrideParameters.size() > 0) { + if (UtilValidate.isNotEmpty(overrideParameters)) { for (ModelParam overrideParam: overrideParameters) { ModelParam existingParam = contextInfo.get(overrideParam.name); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java Sun Aug 17 00:47:18 2008 @@ -435,7 +435,7 @@ protected void createGroupDefs(Element baseElement, ModelService service) { List<? extends Element> group = UtilXml.childElementList(baseElement, "group"); - if (group != null && group.size() > 0) { + if (UtilValidate.isNotEmpty(group)) { Element groupElement = group.get(0); groupElement.setAttribute("name", "_" + service.name + ".group"); service.internalGroup = new GroupModel(groupElement); @@ -705,7 +705,7 @@ protected void addValidators(Element attribute, ModelParam param) { List<? extends Element> validateElements = UtilXml.childElementList(attribute, "type-validate"); - if (validateElements != null && validateElements.size() > 0) { + if (UtilValidate.isNotEmpty(validateElements)) { // always clear out old ones; never append param.validators = FastList.newInstance(); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java Sun Aug 17 00:47:18 2008 @@ -996,7 +996,7 @@ int servicesScheduled = 0; List<? extends Element> startupServices = UtilXml.childElementList(root, "startup-service"); - if (startupServices != null && startupServices.size() > 0) { + if (UtilValidate.isNotEmpty(startupServices)) { for (Element ss: startupServices) { String serviceName = ss.getAttribute("name"); String runtimeDataId = ss.getAttribute("runtime-data-id"); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java Sun Aug 17 00:47:18 2008 @@ -297,7 +297,7 @@ public static String makeMessageList(List<? extends Object> msgList, String msgPrefix, String msgSuffix) { StringBuilder outMsg = new StringBuilder(); - if (msgList != null && msgList.size() > 0) { + if (UtilValidate.isNotEmpty(msgList)) { for (Object msg: msgList) { if (msg == null) continue; String curMsg = msg.toString(); @@ -410,7 +410,7 @@ } // remove each from the list in its own transaction - if (curList != null && curList.size() > 0) { + if (UtilValidate.isNotEmpty(curList)) { // list of runtime data IDs to attempt to delete List<String> runtimeToDelete = FastList.newInstance(); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceValidationException.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceValidationException.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceValidationException.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceValidationException.java Sun Aug 17 00:47:18 2008 @@ -20,7 +20,8 @@ import java.util.List; import java.util.ArrayList; -import java.util.Iterator; + +import org.ofbiz.base.util.UtilValidate; /** * ServiceValidationException @@ -129,7 +130,7 @@ public String getMessage() { String msg = super.getMessage(); - if (this.messages != null && this.messages.size() > 0) { + if (UtilValidate.isNotEmpty(this.messages)) { StringBuilder sb = new StringBuilder(); if (msg != null) { sb.append(msg).append('\n'); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java Sun Aug 17 00:47:18 2008 @@ -26,6 +26,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.StringUtil; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -266,7 +267,7 @@ private long checkDateList(List<Date> dateList, long time, long fromTime) { long nextTime = time; - if (dateList != null && dateList.size() > 0) { + if (UtilValidate.isNotEmpty(dateList)) { for (Date thisDate: dateList) { if (nextTime > 0 && thisDate.getTime() < nextTime && thisDate.getTime() > fromTime) nextTime = thisDate.getTime(); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceRule.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceRule.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceRule.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceRule.java Sun Aug 17 00:47:18 2008 @@ -26,6 +26,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.StringUtil; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -488,19 +489,19 @@ cal.setTime(date); // Test each byXXX rule. - if (bySecondList != null && bySecondList.size() > 0) { + if (UtilValidate.isNotEmpty(bySecondList)) { if (!bySecondList.contains(String.valueOf(cal.get(Calendar.SECOND)))) return false; } - if (byMinuteList != null && byMinuteList.size() > 0) { + if (UtilValidate.isNotEmpty(byMinuteList)) { if (!byMinuteList.contains(String.valueOf(cal.get(Calendar.MINUTE)))) return false; } - if (byHourList != null && byHourList.size() > 0) { + if (UtilValidate.isNotEmpty(byHourList)) { if (!byHourList.contains(String.valueOf(cal.get(Calendar.HOUR_OF_DAY)))) return false; } - if (byDayList != null && byDayList.size() > 0) { + if (UtilValidate.isNotEmpty(byDayList)) { Iterator iter = byDayList.iterator(); boolean foundDay = false; @@ -569,7 +570,7 @@ return false; } } - if (byMonthDayList != null && byMonthDayList.size() > 0) { + if (UtilValidate.isNotEmpty(byMonthDayList)) { Iterator iter = byMonthDayList.iterator(); boolean foundDay = false; @@ -596,7 +597,7 @@ return false; } } - if (byYearDayList != null && byYearDayList.size() > 0) { + if (UtilValidate.isNotEmpty(byYearDayList)) { Iterator iter = byYearDayList.iterator(); boolean foundDay = false; @@ -620,7 +621,7 @@ if (!foundDay) return false; } - if (byWeekNoList != null && byWeekNoList.size() > 0) { + if (UtilValidate.isNotEmpty(byWeekNoList)) { Iterator iter = byWeekNoList.iterator(); boolean foundWeek = false; @@ -644,7 +645,7 @@ if (!foundWeek) return false; } - if (byMonthList != null && byMonthList.size() > 0) { + if (UtilValidate.isNotEmpty(byMonthList)) { Iterator iter = byMonthList.iterator(); boolean foundMonth = false; Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java Sun Aug 17 00:47:18 2008 @@ -208,7 +208,7 @@ } } // do something with the errorMessageList - if (errorMessageList != null && errorMessageList.size() > 0) { + if (UtilValidate.isNotEmpty(errorMessageList)) { List<Object> origErrorMessageList = UtilGenerics.checkList(result.get(ModelService.ERROR_MESSAGE_LIST)); if (origErrorMessageList == null) { result.put(ModelService.ERROR_MESSAGE_LIST, errorMessageList); @@ -217,7 +217,7 @@ } } // do something with the errorMessageMap - if (errorMessageMap != null && errorMessageMap.size() > 0) { + if (UtilValidate.isNotEmpty(errorMessageMap)) { Map<String, Object> origErrorMessageMap = UtilGenerics.checkMap(result.get(ModelService.ERROR_MESSAGE_MAP)); if (origErrorMessageMap == null) { result.put(ModelService.ERROR_MESSAGE_MAP, errorMessageMap); 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?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java Sun Aug 17 00:47:18 2008 @@ -151,7 +151,7 @@ List<GenericValue> jobEnt = delegator.findByAnd("JobSandbox", updateFields, order); //jobEnt = delegator.findByCondition("JobSandbox", mainCondition, null, order); - if (jobEnt != null && jobEnt.size() > 0) { + if (UtilValidate.isNotEmpty(jobEnt)) { for (GenericValue v: jobEnt) { DispatchContext dctx = getDispatcher().getDispatchContext(); if (dctx == null) { @@ -212,7 +212,7 @@ Debug.logError(e, "Unable to load crashed jobs", module); } - if (crashed != null && crashed.size() > 0) { + if (UtilValidate.isNotEmpty(crashed)) { try { int rescheduled = 0; for (GenericValue job: crashed) { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java Sun Aug 17 00:47:18 2008 @@ -116,7 +116,7 @@ } // start the polling timer - if (stores != null && stores.size() > 0) { + if (UtilValidate.isNotEmpty(stores)) { pollTimer.schedule(new PollerTask(dispatcher, userLogin), timerDelay, timerDelay); } else { Debug.logWarning("No JavaMail Store(s) configured; poller disabled.", module); @@ -248,7 +248,7 @@ } public void run() { - if (stores != null && stores.size() > 0) { + if (UtilValidate.isNotEmpty(stores)) { for (Map.Entry<Store, Session> entry: stores.entrySet()) { Store store = entry.getKey(); Session session = entry.getValue(); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Sun Aug 17 00:47:18 2008 @@ -759,7 +759,7 @@ Debug.logVerbose("-------- Handler Mappings --------", module); Map<String, String> debugMap = checkMap(map.get("event"), String.class, String.class); - if (debugMap != null && debugMap.size() > 0) { + if (UtilValidate.isNotEmpty(debugMap)) { Debug.logVerbose("-------------- EVENT -------------", module); for (Map.Entry<String, String> entry: debugMap.entrySet()) { String handlerName = entry.getKey(); @@ -768,7 +768,7 @@ } } debugMap = checkMap(map.get("view"), String.class, String.class); - if (debugMap != null && debugMap.size() > 0) { + if (UtilValidate.isNotEmpty(debugMap)) { Debug.logVerbose("-------------- VIEW --------------", module); for (Map.Entry<String, String> entry: debugMap.entrySet()) { String handlerName = entry.getKey(); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java Sun Aug 17 00:47:18 2008 @@ -21,6 +21,7 @@ import java.sql.Timestamp; import java.util.Enumeration; import java.util.Map; + import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; @@ -28,7 +29,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.webapp.stats.VisitHandler; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.serialize.XmlSerializer; @@ -194,7 +195,7 @@ Map userLoginSession = (Map) session.getAttribute("userLoginSession"); String sessionData = null; - if (userLoginSession != null && userLoginSession.size() > 0) { + if (UtilValidate.isNotEmpty(userLoginSession)) { try { sessionData = XmlSerializer.serialize(userLoginSession); } catch (Exception e) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Sun Aug 17 00:47:18 2008 @@ -332,7 +332,7 @@ request.getSession().removeAttribute("_REQ_ATTR_MAP_"); byte[] reqAttrMapBytes = StringUtil.fromHexString(preReqAttStr); Map<String, Object> preRequestMap = checkMap(UtilObject.getObject(reqAttrMapBytes), String.class, Object.class); - if (preRequestMap != null && preRequestMap.size() > 0) { + if (UtilValidate.isNotEmpty(preRequestMap)) { for (Map.Entry<String, Object> entry: preRequestMap.entrySet()) { String key = entry.getKey(); if("_ERROR_MESSAGE_LIST_".equals(key) || "_ERROR_MESSAGE_MAP_".equals(key) || "_ERROR_MESSAGE_".equals(key) || @@ -454,7 +454,7 @@ public String makeQueryString(HttpServletRequest request) { Map<String, Object> paramMap = UtilHttp.getParameterMap(request); StringBuilder queryString = new StringBuilder(); - if (paramMap != null && paramMap.size() > 0) { + if (UtilValidate.isNotEmpty(paramMap)) { queryString.append("?"); for (Map.Entry<String, Object> entry: paramMap.entrySet()) { String name = entry.getKey(); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/I18nMessageTag.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/I18nMessageTag.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/I18nMessageTag.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/I18nMessageTag.java Sun Aug 17 00:47:18 2008 @@ -28,6 +28,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilJ2eeCompat; +import org.ofbiz.base.util.UtilValidate; /** * I18nMessageTag - JSP tag to use a resource bundle to internationalize @@ -98,7 +99,7 @@ public int doEndTag() throws JspException { try { - if (this.value != null && this.arguments != null && this.arguments.size() > 0) { + if (this.value != null && UtilValidate.isNotEmpty(this.arguments)) { MessageFormat messageFormat = new MessageFormat(this.value); messageFormat.setLocale(this.bundle.getLocale()); Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java Sun Aug 17 00:47:18 2008 @@ -382,7 +382,7 @@ List<Object> errorMessages = FastList.newInstance(); List<String> infoMessages = FastList.newInstance(); int totalRowsChanged = 0; - if (urlList != null && urlList.size() > 0) { + if (UtilValidate.isNotEmpty(urlList)) { messages.add("=-=-=-=-=-=-= Doing a data " + (checkDataOnly ? "check" : "load") + " with the following files:"); for (URL dataUrl: urlList) { messages.add(dataUrl.toExternalForm()); Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java Sun Aug 17 00:47:18 2008 @@ -33,7 +33,7 @@ import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.widget.screen.ScreenRenderer; @@ -54,7 +54,7 @@ reqParams.put("locale", UtilHttp.getLocale(req)); String screenUri = (String) reqParams.remove("screenUri"); - if (screenUri != null && reqParams.size() > 0) { + if (UtilValidate.isNotEmpty(screenUri)) { String base64String = null; try { byte[] bytes = FoPrintServerEvents.getXslFo(dispatcher.getDispatchContext(), screenUri, reqParams); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java Sun Aug 17 00:47:18 2008 @@ -247,7 +247,7 @@ if (!argListAcsr.isEmpty()) { List<Object> argList = argListAcsr.get(context); - if (argList != null && argList.size() > 0) { + if (UtilValidate.isNotEmpty(argList)) { value = MessageFormat.format(value, argList.toArray()); } } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Sun Aug 17 00:47:18 2008 @@ -1687,7 +1687,7 @@ this.filterByDate = entityOptionsElement.getAttribute("filter-by-date"); List constraintElements = UtilXml.childElementList(entityOptionsElement, "entity-constraint"); - if (constraintElements != null && constraintElements.size() > 0) { + if (UtilValidate.isNotEmpty(constraintElements)) { this.constraintList = new LinkedList<EntityFinderUtil.ConditionExpr>(); Iterator constraintElementIter = constraintElements.iterator(); while (constraintElementIter.hasNext()) { @@ -1697,7 +1697,7 @@ } List orderByElements = UtilXml.childElementList(entityOptionsElement, "entity-order-by"); - if (orderByElements != null && orderByElements.size() > 0) { + if (UtilValidate.isNotEmpty(orderByElements)) { this.orderByList = new LinkedList<String>(); Iterator orderByElementIter = orderByElements.iterator(); while (orderByElementIter.hasNext()) { @@ -1721,7 +1721,7 @@ public void addOptionValues(List<OptionValue> optionValues, Map<String, Object> context, GenericDelegator delegator) { // first expand any conditions that need expanding based on the current context EntityCondition findCondition = null; - if (this.constraintList != null && this.constraintList.size() > 0) { + if (UtilValidate.isNotEmpty(this.constraintList)) { List<EntityCondition> expandedConditionList = new LinkedList<EntityCondition>(); Iterator constraintIter = constraintList.iterator(); while (constraintIter.hasNext()) { Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java Sun Aug 17 00:47:18 2008 @@ -311,7 +311,7 @@ if (!argListAcsr.isEmpty()) { List<? extends Object> argList = argListAcsr.get(context); - if (argList != null && argList.size() > 0) { + if (UtilValidate.isNotEmpty(argList)) { value = MessageFormat.format(value, argList.toArray()); } } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java Sun Aug 17 00:47:18 2008 @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -32,6 +33,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.FlexibleMapAccessor; @@ -332,8 +334,9 @@ linkText += "VIEW_SIZE=" + viewSize + "&VIEW_INDEX=" + (viewIndex - 1) + "\""; // make the link - writer.append(rh.makeLink(request, response, linkText, false, false, false)); - writer.append(" class=\"buttontext\">[Previous]</a>\n"); + writer.append(rh.makeLink(request, response, linkText, false, false, false)); + String previous = UtilProperties.getMessage("CommonUiLabels", "CommonPrevious", (Locale) context.get("locale")); + writer.append(" class=\"buttontext\">[" + previous +"]</a>\n"); } if (listSize > 0) { @@ -348,7 +351,8 @@ // make the link writer.append(rh.makeLink(request, response, linkText, false, false, false)); - writer.append(" class=\"buttontext\">[Next]</a>\n"); + String next = UtilProperties.getMessage("CommonUiLabels", "CommonNext", (Locale) context.get("locale")); + writer.append(" class=\"buttontext\">[" + next +"]</a>\n"); } writer.append(" </b>\n"); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java Sun Aug 17 00:47:18 2008 @@ -370,7 +370,7 @@ if (!argListAcsr.isEmpty()) { List<? extends Object> argList = argListAcsr.get(context); - if (argList != null && argList.size() > 0) { + if (UtilValidate.isNotEmpty(argList)) { value = MessageFormat.format(value, argList.toArray()); } } Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java (original) +++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java Sun Aug 17 00:47:18 2008 @@ -933,7 +933,7 @@ Map paymentFields = UtilMisc.toMap("orderId", orderId, "statusId", "PAYMENT_RECEIVED", "paymentMethodTypeId", "EXT_EBAY"); paymentPreferences = delegator.findByAnd("OrderPaymentPreference", paymentFields); - if (paymentPreferences != null && paymentPreferences.size() > 0) { + if (UtilValidate.isNotEmpty(paymentPreferences)) { Iterator i = paymentPreferences.iterator(); while (i.hasNext()) { GenericValue pref = (GenericValue) i.next(); @@ -1203,7 +1203,7 @@ Debug.logInfo("Checking for existing externalId: " + externalId +" and transactionId: " + transactionId, module); GenericValue orderHeader = null; List entities = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId, "transactionId", transactionId)); - if (entities != null && entities.size() > 0) { + if (UtilValidate.isNotEmpty(entities)) { orderHeader = EntityUtil.getFirst(entities); } return orderHeader; Modified: ofbiz/trunk/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java (original) +++ ofbiz/trunk/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java Sun Aug 17 00:47:18 2008 @@ -77,7 +77,7 @@ // Send back the results Map result = ServiceUtil.returnSuccess(); - if (productsFound != null && productsFound.size() > 0) { + if (UtilValidate.isNotEmpty(productsFound)) { result.put("productList", productsFound); } return result; Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original) +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Sun Aug 17 00:47:18 2008 @@ -298,7 +298,7 @@ fields.put("orderId", this.getOrderId()); List paymentPrefs = session.getDelegator().findByAnd("OrderPaymentPreference", fields); - if (paymentPrefs != null && paymentPrefs.size() > 0) { + if (UtilValidate.isNotEmpty(paymentPrefs)) { //Debug.log("Found some prefs - " + paymentPrefs.size(), module); if (paymentPrefs.size() > 1) { Debug.logError("Multiple OrderPaymentPreferences found for the same payment method!", module); @@ -953,7 +953,7 @@ } } - if (adjustments != null && adjustments.size() > 0) { + if (UtilValidate.isNotEmpty(adjustments)) { Iterator iter = adjustments.iterator(); while(iter.hasNext()){ GenericValue orderAdjustment = (GenericValue) iter.next(); Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Keyboard.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Keyboard.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Keyboard.java (original) +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Keyboard.java Sun Aug 17 00:47:18 2008 @@ -23,6 +23,7 @@ import jpos.JposException; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.pos.adaptor.DataEventAdaptor; import org.ofbiz.pos.config.ButtonEventConfig; import org.ofbiz.pos.device.GenericDevice; @@ -68,7 +69,7 @@ } List buttonEvents = ButtonEventConfig.findButtonKeyAssign(keyCode); - if (buttonEvents != null && buttonEvents.size() > 0) { + if (UtilValidate.isNotEmpty(buttonEvents)) { Debug.log("Key -> Button Mapping(s) Found [" + keyCode + "]", module); try { Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java (original) +++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java Sun Aug 17 00:47:18 2008 @@ -176,7 +176,7 @@ Debug.logError(e, module); throw new EventAuditException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -199,7 +199,7 @@ Debug.logError(e, module); throw new EventAuditException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -222,7 +222,7 @@ Debug.logError(e, module); throw new EventAuditException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -246,7 +246,7 @@ Debug.logError(e, module); throw new EventAuditException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -269,7 +269,7 @@ Debug.logError(e, module); throw new EventAuditException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -292,7 +292,7 @@ Debug.logError(e, module); throw new EventAuditException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java (original) +++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java Sun Aug 17 00:47:18 2008 @@ -362,7 +362,7 @@ Debug.logError(e, module); throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -391,7 +391,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -411,7 +411,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -430,7 +430,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -461,7 +461,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -563,7 +563,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -627,7 +627,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -691,7 +691,7 @@ Debug.logError(e, module); throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Debug.log("Lookup list contains : " + lookupList.size(), module); Iterator i = lookupList.iterator(); while (i.hasNext()) { @@ -716,7 +716,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -752,7 +752,7 @@ List createdList = new ArrayList(); List lookupList = getAndJoinValues(procId, asDefId, aDefId); - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -1012,7 +1012,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -1150,7 +1150,7 @@ } catch (GenericEntityException e) { throw new PersistenceException(e); } - if (lookupList != null && lookupList.size() > 0) { + if (UtilValidate.isNotEmpty(lookupList)) { Iterator i = lookupList.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java (original) +++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java Sun Aug 17 00:47:18 2008 @@ -83,7 +83,7 @@ public boolean doesParticipantMappingExist(ParticipantMappingTransaction mappingTransaction, ParticipantMap participantMap) throws RootException { List mappings = getParticipantMappings(mappingTransaction, participantMap.getPackageId(), participantMap.getProcessDefinitionId(), participantMap.getParticipantId()); - if (mappings != null && mappings.size() > 0) { + if (UtilValidate.isNotEmpty(mappings)) { return true; } return false; Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/user/GenericUserGroupMgr.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/user/GenericUserGroupMgr.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/user/GenericUserGroupMgr.java (original) +++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/user/GenericUserGroupMgr.java Sun Aug 17 00:47:18 2008 @@ -57,7 +57,7 @@ Debug.logError(e, module); throw new RootException(e); } - if (groups != null && groups.size() > 0) { + if (UtilValidate.isNotEmpty(groups)) { Iterator i = groups.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -77,7 +77,7 @@ Debug.logError(e, module); throw new RootException(e); } - if (users != null && users.size() > 0) { + if (UtilValidate.isNotEmpty(users)) { Iterator i = users.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -97,7 +97,7 @@ Debug.logError(e, module); throw new RootException(e); } - if (members != null && members.size() > 0) { + if (UtilValidate.isNotEmpty(members)) { Iterator i = members.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -109,7 +109,7 @@ public List getAllUsers(UserTransaction trans, List groupNames) throws RootException { List userNames = new ArrayList(); - if (groupNames != null && groupNames.size() > 0) { + if (UtilValidate.isNotEmpty(groupNames)) { Iterator i = groupNames.iterator(); while (i.hasNext()) { String groupName = (String) i.next(); @@ -133,7 +133,7 @@ Debug.logError(e, module); throw new RootException(e); } - if (rollups != null && rollups.size() > 0) { + if (UtilValidate.isNotEmpty(rollups)) { Iterator i = rollups.iterator(); while (i.hasNext()) { GenericValue v = (GenericValue) i.next(); @@ -145,7 +145,7 @@ public List getAllSubgroups(UserTransaction trans, List groupNames) throws RootException { List subGroups = new ArrayList(); - if (groupNames != null && groupNames.size() > 0) { + if (UtilValidate.isNotEmpty(groupNames)) { Iterator i = groupNames.iterator(); while (i.hasNext()) { String groupName = (String) i.next(); Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java (original) +++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java Sun Aug 17 00:47:18 2008 @@ -600,7 +600,7 @@ } else if (loopElement != null) { activityValue.set("activityTypeEnumId", "WAT_LOOP"); readLoop(loopElement, packageId, packageVersion, processId, processVersion, activityId); - } else if (tools != null && tools.size() > 0) { + } else if (UtilValidate.isNotEmpty(tools)) { activityValue.set("activityTypeEnumId", "WAT_TOOL"); readTools(tools, packageId, packageVersion, processId, processVersion, activityId); } else { @@ -902,7 +902,7 @@ // a Condition will have either a list of XPression elements, or plain PCDATA List xPressions = UtilXml.childElementList(conditionElement, "XPression"); - if (xPressions != null && xPressions.size() > 0) { + if (UtilValidate.isNotEmpty(xPressions)) { throw new DefinitionParserException("XPression elements under Condition not yet supported, just use text inside Condition with the expression"); } else { transitionValue.set("conditionExpr", UtilXml.elementValue(conditionElement)); Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java?rev=686591&r1=686590&r2=686591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java (original) +++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java Sun Aug 17 00:47:18 2008 @@ -441,7 +441,7 @@ * @see org.ofbiz.workflow.WfActivity#setResult(java.util.Map) */ public void setResult(Map newResult) throws WfException, InvalidData { - if (newResult != null && newResult.size() > 0) { + if (UtilValidate.isNotEmpty(newResult)) { if (Debug.verboseOn()) Debug.logVerbose( "[WfActivity.setResult]: putting (" + newResult.size() + ") keys into context.", @@ -727,7 +727,7 @@ // extended attributes take priority over context attributes Map extendedAttributes = StringUtil.strToMap(extendedAttr); - if (extendedAttributes != null && extendedAttributes.size() > 0) { + if (UtilValidate.isNotEmpty(extendedAttributes)) { context.putAll(extendedAttributes); } |
Free forum by Nabble | Edit this page |