cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r123620 - /cocoon/trunk/src/blocks/serializers/java/org/apache/cocoon/components/serializers/util/DocType.java
Date Wed, 29 Dec 2004 10:32:56 GMT
Author: antonio
Date: Wed Dec 29 02:32:54 2004
New Revision: 123620

URL: http://svn.apache.org/viewcvs?view=rev&rev=123620
Log:
Use StrinUtils.equals()
Modified:
   cocoon/trunk/src/blocks/serializers/java/org/apache/cocoon/components/serializers/util/DocType.java

Modified: cocoon/trunk/src/blocks/serializers/java/org/apache/cocoon/components/serializers/util/DocType.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/serializers/java/org/apache/cocoon/components/serializers/util/DocType.java?view=diff&rev=123620&p1=cocoon/trunk/src/blocks/serializers/java/org/apache/cocoon/components/serializers/util/DocType.java&r1=123619&p2=cocoon/trunk/src/blocks/serializers/java/org/apache/cocoon/components/serializers/util/DocType.java&r2=123620
==============================================================================
--- cocoon/trunk/src/blocks/serializers/java/org/apache/cocoon/components/serializers/util/DocType.java
(original)
+++ cocoon/trunk/src/blocks/serializers/java/org/apache/cocoon/components/serializers/util/DocType.java
Wed Dec 29 02:32:54 2004
@@ -15,6 +15,8 @@
  */
 package org.apache.cocoon.components.serializers.util;
 
+import org.apache.commons.lang.StringUtils;
+
 /**
  * The <code>DocType</code> class encapsulates informations regarding
  * the document type public and system IDs and root element name.
@@ -138,18 +140,11 @@
         if (!(object instanceof DocType)) return(false);
         DocType doctype = (DocType)object;
 
-        if (this.public_id == null) {
-            if (doctype.public_id != null) return(false);
-        } else {
-            if (!this.public_id.equals(doctype.public_id)) return(false);
+        if (StringUtils.equals(this.public_id, doctype.public_id)
+            && StringUtils.equals(this.system_id, doctype.system_id)
+            && this.root_name.equals(doctype.root_name)) {
+            return true;
         }
-        
-        if (this.system_id == null) {
-            if (doctype.system_id != null) return(false);
-        } else {
-            if (!this.system_id.equals(doctype.system_id)) return(false);
-        }
-
-        return(this.root_name.equals(doctype.root_name));
+        return false;
     }
 }

Mime
View raw message