Thanks Scott,

I did not notice build issues. I will double check possible CharSequence uses 
or rather coonsider implementing
UtilValidate.is(Not)Empty for it (I can't see any reason to not do it at this 
stage)

Jacques

From: <[email protected]>
Author: lektran
Date: Tue Nov 24 07:43:18 2009
New Revision: 883613

URL: http://svn.apache.org/viewvc?rev=883613&view=rev
Log:
Revert Jacques changes to EntitySaxReader.java from r883549 and 883507, the 
UtilValidate.is(Not)Empty methods are not setup to
test CharSequence instances.  Hopefully there aren't too many more out there.

Modified:
   ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java

Modified: 
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java?rev=883613&r1=883612&r2=883613&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java 
(original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java 
Tue Nov 24 07:43:18 2009
@@ -375,7 +375,7 @@

        if (currentValue != null) {
            if (currentFieldName != null) {
-                if (UtilValidate.isNotEmpty(currentFieldValue)) {
+                if (currentFieldValue != null && currentFieldValue.length() > 
0) {
                    if 
(currentValue.getModelEntity().isField(currentFieldName.toString())) {
                        ModelEntity modelEntity = currentValue.getModelEntity();
                        ModelField modelField = 
modelEntity.getField(currentFieldName.toString());
@@ -499,7 +499,7 @@
                CharSequence name = attributes.getLocalName(i);
                CharSequence value = attributes.getValue(i);

-                if (UtilValidate.isEmpty(name)) {
+                if (name == null || name.length() == 0) {
                    name = attributes.getQName(i);
                }
                newElement.setAttribute(name.toString(), value.toString());
@@ -548,12 +548,12 @@
                    CharSequence name = attributes.getLocalName(i);
                    CharSequence value = attributes.getValue(i);

-                    if (UtilValidate.isEmpty(name)) {
+                    if (name == null || name.length() == 0) {
                        name = attributes.getQName(i);
                    }
                    try {
                        // treat empty strings as nulls
-                        if (UtilValidate.isNotEmpty(value)) {
+                        if (value != null && value.length() > 0) {
                            if 
(currentValue.getModelEntity().isField(name.toString())) {
                                currentValue.setString(name.toString(), 
value.toString());
                            } else {




Reply via email to