Author: bpapez
Date: Fri Jun 15 14:35:18 2007
New Revision: 17593

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17593&repname=
=3Djahia
Log:
Refactor using String.length instead equals("")

Modified:
    trunk/core/src/java/org/jahia/data/containers/JahiaContainerSet.java

Modified: trunk/core/src/java/org/jahia/data/containers/JahiaContainerSet.j=
ava
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/data/containers/JahiaContainerSet.java&rev=3D17593&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/data/containers/JahiaContainerSet.java (o=
riginal)
+++ trunk/core/src/java/org/jahia/data/containers/JahiaContainerSet.java Fr=
i Jun 15 14:35:18 2007
@@ -269,7 +269,7 @@
         if ( !isDeclaredField &&
             //MC: this check was removed as it doesn't seem to have any pu=
rpose anymore
              //(!isJahiaDataDeclaredField) &&
-            !fieldName.equals("") && !fieldTitle.equals("") && !isDeclared=
Container ) {
+            fieldName.length() !=3D 0 && fieldTitle.length() !=3D 0 && !is=
DeclaredContainer ) {
 =

             // first, let's check to see if the declared field has already=
 a field definition in the
             // FieldsDefinitionsRegistry (which means also in the jahia_fi=
elds_def table)
@@ -812,7 +812,7 @@
         /** @todo ensure that the data provided by the user has no special=
 chars in it */
 =

         // check if a container has already been declared with the same na=
me
-        if (!containerName.equals("")) {
+        if (containerName.length() !=3D 0) {
             // third, let's check to see if the declared container has alr=
eady a container definition in the
             // ContainersDefinitionsRegistry
             JahiaContainerDefinition aDef =3D JahiaContainerDefinitionsReg=
istry
@@ -858,7 +858,7 @@
                      " with " + Integer.toString(containerFields.size()) +
                      " fields");
         // checks if container name and title are not empty
-        if ( (!containerName.equals("")) && (!containerTitle.equals("")) &&
+        if ( (containerName.length() !=3D 0) && (containerTitle.length() !=
=3D 0) &&
             // checks if a field has not the same name
             (!jData.fields().checkDeclared(containerName)) &&
             (!this.checkDeclaredField(containerName))) {

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to