You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2011/09/12 16:13:17 UTC
svn commit: r1169754 - in /ofbiz/trunk:
applications/marketing/src/org/ofbiz/sfa/vcard/
applications/order/src/org/ofbiz/order/shoppingcart/
framework/base/src/org/ofbiz/base/util/
framework/entity/src/org/ofbiz/entity/datasource/ framework/widget/src/...
Author: jleroux
Date: Mon Sep 12 14:13:17 2011
New Revision: 1169754
URL: http://svn.apache.org/viewvc?rev=1169754&view=rev
Log:
VCard.java: replaec an UtilValidate.isNotEmpty() by a simple isEmpty()
ShoppingCart.java: a tabs has been automatically replaced by 8 spaces, fixes it
UtilValidate.java: removes useless parentheses
GeneriDao.java: fixes a wrong UtilValidate.isNotEmpty
ModelFormField.java: revert all UtilValidate.is(Not)Empty() changes though I ddid not find an error there, it must be one because https://localhost:8443/humanres/control/EditResponsibilityTypes is not rendered correctly. I will check again
Modified:
ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java?rev=1169754&r1=1169753&r2=1169754&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java (original)
+++ ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java Mon Sep 12 14:13:17 2011
@@ -131,7 +131,7 @@ public class VCard {
EntityCondition.makeCondition("geoTypeId", EntityOperator.EQUALS, "STATE"),
EntityCondition.makeCondition("geoName", EntityOperator.LIKE, workAddress.getRegion())), EntityOperator.AND);
stateGeoList = delegator.findList("Geo", condition, null, null, null, true);
- if (UtilValidate.isNotEmpty(stateGeoList)) {
+ if (!stateGeoList.isEmpty()) {
GenericValue stateGeo = EntityUtil.getFirst(stateGeoList);
serviceCtx.put("stateProvinceGeoId", stateGeo.get("geoId"));
}
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1169754&r1=1169753&r2=1169754&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Mon Sep 12 14:13:17 2011
@@ -2791,7 +2791,7 @@ public class ShoppingCart implements Ite
GenericValue orderTerm = this.getDelegator().makeValue("OrderTerm");
orderTerm.put("termTypeId", termTypeId);
if (UtilValidate.isEmpty(orderItemSeqId)) {
- orderItemSeqId = "_NA_";
+ orderItemSeqId = "_NA_";
}
orderTerm.put("orderItemSeqId", orderItemSeqId);
orderTerm.put("termValue", termValue);
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java?rev=1169754&r1=1169753&r2=1169754&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java Mon Sep 12 14:13:17 2011
@@ -221,12 +221,12 @@ public class UtilValidate {
/** Check whether charsequence c is empty. */
public static <E> boolean isEmpty(CharSequence c) {
- return (c == null) || (c.length() == 0);
+ return (c == null) || c.length() == 0;
}
/** Check whether string s is NOT empty. */
public static boolean isNotEmpty(String s) {
- return (s != null) && (s.length() > 0);
+ return (s != null) && s.length() > 0;
}
/** Check whether collection c is NOT empty. */
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java?rev=1169754&r1=1169753&r2=1169754&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java Mon Sep 12 14:13:17 2011
@@ -818,7 +818,7 @@ public class GenericDAO {
conditions.add(whereEntityCondition);
}
- if (UtilValidate.isNotEmpty(modelViewEntity)) {
+ if (modelViewEntity != null && !viewWhereConditions.isEmpty()) {
EntityCondition viewWhereEntityCondition = EntityCondition.makeCondition(viewWhereConditions);
if (!viewWhereEntityCondition.isEmpty()) {
conditions.add(viewWhereEntityCondition);
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=1169754&r1=1169753&r2=1169754&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 Mon Sep 12 14:13:17 2011
@@ -266,7 +266,7 @@ public class ModelFormField {
// incorporate updates for values that are not empty in the overrideFormField
if (UtilValidate.isNotEmpty(overrideFormField.name))
this.name = overrideFormField.name;
- if (UtilValidate.isNotEmpty(overrideFormField.mapAcsr)) {
+ if (overrideFormField.mapAcsr != null && !overrideFormField.mapAcsr.isEmpty()) {
//Debug.logInfo("overriding mapAcsr, old=" + (this.mapAcsr==null?"null":this.mapAcsr.getOriginalName()) + ", new=" + overrideFormField.mapAcsr.getOriginalName(), module);
this.mapAcsr = overrideFormField.mapAcsr;
}
@@ -274,7 +274,7 @@ public class ModelFormField {
this.entityName = overrideFormField.entityName;
if (UtilValidate.isNotEmpty(overrideFormField.serviceName))
this.serviceName = overrideFormField.serviceName;
- if (UtilValidate.isNotEmpty(overrideFormField.entryAcsr))
+ if (overrideFormField.entryAcsr != null && !overrideFormField.entryAcsr.isEmpty())
this.entryAcsr = overrideFormField.entryAcsr;
if (UtilValidate.isNotEmpty(overrideFormField.parameterName))
this.parameterName = overrideFormField.parameterName;
@@ -282,9 +282,9 @@ public class ModelFormField {
this.fieldName = overrideFormField.fieldName;
if (UtilValidate.isNotEmpty(overrideFormField.attributeName))
this.attributeName = overrideFormField.attributeName;
- if (UtilValidate.isNotEmpty(overrideFormField.title)) // title="" can be used to override the original value
+ if (overrideFormField.title != null && !overrideFormField.title.isEmpty()) // title="" can be used to override the original value
this.title = overrideFormField.title;
- if (UtilValidate.isNotEmpty(overrideFormField.tooltip))
+ if (overrideFormField.tooltip != null && !overrideFormField.tooltip.isEmpty())
this.tooltip = overrideFormField.tooltip;
if (overrideFormField.requiredField != null)
this.requiredField = overrideFormField.requiredField;
@@ -304,9 +304,9 @@ public class ModelFormField {
this.redWhen = overrideFormField.redWhen;
if (UtilValidate.isNotEmpty(overrideFormField.event))
this.event = overrideFormField.event;
- if (UtilValidate.isNotEmpty(overrideFormField.action))
+ if (overrideFormField.action != null && !overrideFormField.action.isEmpty())
this.action = overrideFormField.action;
- if (UtilValidate.isNotEmpty(overrideFormField.useWhen))
+ if (overrideFormField.useWhen != null && !overrideFormField.useWhen.isEmpty())
this.useWhen = overrideFormField.useWhen;
if (overrideFormField.fieldInfo != null) {
this.setFieldInfo(overrideFormField.fieldInfo);
@@ -654,7 +654,7 @@ public class ModelFormField {
}
public String getEntryName() {
- if (UtilValidate.isNotEmpty(this.entryAcsr)) {
+ if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
return this.entryAcsr.getOriginalName();
} else {
return this.name;
@@ -713,7 +713,7 @@ public class ModelFormField {
dataMapIsContext = true;
}
Object retVal = null;
- if (UtilValidate.isNotEmpty(this.entryAcsr)) {
+ if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
//Debug.logInfo("Getting entry, using entryAcsr for field " + this.getName() + " of form " + this.modelForm.getName(), module);
if (dataMap instanceof GenericEntity) {
GenericEntity genEnt = (GenericEntity) dataMap;
@@ -735,7 +735,7 @@ public class ModelFormField {
if (dataMapIsContext && retVal == null && !Boolean.FALSE.equals(useRequestParameters)) {
Map<String, ? extends Object> parameters = UtilGenerics.checkMap(context.get("parameters"));
if (parameters != null) {
- if (UtilValidate.isNotEmpty(this.entryAcsr)) {
+ if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
retVal = this.entryAcsr.get(parameters);
} else {
retVal = parameters.get(this.name);
@@ -779,7 +779,7 @@ public class ModelFormField {
}
public Map<String, ? extends Object> getMap(Map<String, ? extends Object> context) {
- if (UtilValidate.isEmpty(this.mapAcsr)) {
+ if (this.mapAcsr == null || this.mapAcsr.isEmpty()) {
//Debug.logInfo("Getting Map from default of the form because of no mapAcsr for field " + this.getName(), module);
return this.modelForm.getDefaultMap(context);
} else {
@@ -820,7 +820,7 @@ public class ModelFormField {
* @return returns the name of the Map in the form context that contains the entry
*/
public String getMapName() {
- if (UtilValidate.isNotEmpty(this.mapAcsr)) {
+ if (this.mapAcsr != null && !this.mapAcsr.isEmpty()) {
return this.mapAcsr.getOriginalName();
} else {
return this.modelForm.getDefaultMapName();
@@ -871,7 +871,7 @@ public class ModelFormField {
}
public String getAction(Map<String, ? extends Object> context) {
- if (UtilValidate.isNotEmpty(this.action)) {
+ if (this.action != null && !this.action.isEmpty()) {
return action.expandString(context);
} else {
return null;
@@ -1002,7 +1002,7 @@ public class ModelFormField {
}
public String getTitle(Map<String, Object> context) {
- if (UtilValidate.isNotEmpty(this.title)) {
+ if (this.title != null && !this.title.isEmpty()) {
return title.expandString(context);
} else {
// create a title from the name of this field; expecting a Java method/field style name, ie productName or productCategoryId
@@ -1088,7 +1088,7 @@ public class ModelFormField {
}
public String getTooltip(Map<String, Object> context) {
- if (UtilValidate.isNotEmpty(tooltip)) {
+ if (tooltip != null && !tooltip.isEmpty()) {
return tooltip.expandString(context);
} else {
return "";
@@ -1096,7 +1096,7 @@ public class ModelFormField {
}
public String getUseWhen(Map<String, Object> context) {
- if (UtilValidate.isNotEmpty(this.useWhen)) {
+ if (this.useWhen != null && !this.useWhen.isEmpty()) {
return this.useWhen.expandString(context);
} else {
return "";
@@ -2127,7 +2127,7 @@ public class ModelFormField {
public String getDescription(Map<String, Object> context) {
String retVal = null;
- if (UtilValidate.isNotEmpty(this.description)) {
+ if (this.description != null && !this.description.isEmpty()) {
retVal = this.description.expandString(context);
} else {
retVal = this.modelFormField.getEntry(context);
@@ -2139,7 +2139,7 @@ public class ModelFormField {
Locale locale = (Locale) context.get("locale");
if (locale == null) locale = Locale.getDefault();
String isoCode = null;
- if (UtilValidate.isNotEmpty(this.currency)) {
+ if (this.currency != null && !this.currency.isEmpty()) {
isoCode = this.currency.expandString(context);
}
@@ -2308,7 +2308,7 @@ public class ModelFormField {
this.cache = !"false".equals(element.getAttribute("cache"));
this.size = element.getAttribute("size");
- if (UtilValidate.isEmpty(this.description)) {
+ if (this.description == null || this.description.isEmpty()) {
this.setDescription("${description}");
}
@@ -3201,7 +3201,7 @@ public class ModelFormField {
* @return Default value string for date-time
*/
public String getDefaultDateTimeString(Map<String, Object> context) {
- if (UtilValidate.isNotEmpty(this.defaultValue)) {
+ if (this.defaultValue != null && !this.defaultValue.isEmpty()) {
return this.getDefaultValue(context);
}
@@ -3566,7 +3566,7 @@ public class ModelFormField {
}
public String getValue(Map<String, Object> context) {
- if (UtilValidate.isNotEmpty(this.value)) {
+ if (this.value != null && !this.value.isEmpty()) {
String valueEnc = this.value.expandString(context);
StringUtil.SimpleEncoder simpleEncoder = (StringUtil.SimpleEncoder) context.get("simpleEncoder");
if (simpleEncoder != null) {
@@ -3961,7 +3961,7 @@ public class ModelFormField {
}
public String getValue(Map<String, Object> context) {
- if (UtilValidate.isNotEmpty(this.value)) {
+ if (this.value != null && !this.value.isEmpty()) {
return this.value.expandString(context);
} else {
return modelFormField.getEntry(context);
@@ -3973,7 +3973,7 @@ public class ModelFormField {
}
public String getDescription(Map<String, Object> context) {
- if (UtilValidate.isNotEmpty(this.description)) {
+ if (this.description != null && !this.description.isEmpty()) {
return this.description.expandString(context);
} else {
return "";
@@ -3985,7 +3985,7 @@ public class ModelFormField {
}
public String getAlternate(Map<String, Object> context) {
- if (UtilValidate.isNotEmpty(this.alternate)) {
+ if (this.alternate != null && !this.alternate.isEmpty()) {
return this.alternate.expandString(context);
} else {
return "";