]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Slight improvement of the check in equals(); make sure String.equals() gets called...
authorAndreas L. Delmelle <adelmelle@apache.org>
Sat, 23 Dec 2006 12:00:42 +0000 (12:00 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Sat, 23 Dec 2006 12:00:42 +0000 (12:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@489886 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/properties/EnumProperty.java

index 93dab72e2afea04f3e641e996c97b496a2bf3ac1..a2d3728b537899ae1da102e293b2c4d6d71530ff 100644 (file)
@@ -100,16 +100,20 @@ public class EnumProperty extends Property {
     /**
      * @return this.value cast as an Object
      */
-    public Object getObject() {
+    protected Object getObject() {
         return text;
     }
 
+    /**
+     * @see java.lang.Object#equals(Object)
+     */
     public boolean equals(Object obj) {
         if (obj instanceof EnumProperty) {
             EnumProperty ep = (EnumProperty)obj;
-            return ep.value == this.value &&
-                ((ep.text == null && this.text == null)
-                 || ep.text.equals(this.text));
+            return (ep.value == this.value) 
+                && ((ep.text == this.text)
+                    || (ep.text != null
+                        && ep.text.equals(this.text)));
         } else {
             return false;
         }