You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ad...@apache.org on 2006/12/23 13:00:43 UTC

svn commit: r489886 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/EnumProperty.java

Author: adelmelle
Date: Sat Dec 23 04:00:42 2006
New Revision: 489886

URL: http://svn.apache.org/viewvc?view=rev&rev=489886
Log:
Slight improvement of the check in equals(); make sure String.equals() gets called only as a last resort (for non-canonical Strings)

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/EnumProperty.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/EnumProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/EnumProperty.java?view=diff&rev=489886&r1=489885&r2=489886
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/EnumProperty.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/EnumProperty.java Sat Dec 23 04:00:42 2006
@@ -100,16 +100,20 @@
     /**
      * @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;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org