Index: src/java/org/apache/fop/fo/properties/CommonFont.java
===================================================================
--- src/java/org/apache/fop/fo/properties/CommonFont.java	(revision 1154192)
+++ src/java/org/apache/fop/fo/properties/CommonFont.java	(working copy)
@@ -41,7 +41,7 @@
         = new PropertyCache(CommonFont.class);
 
     /** hashcode of this instance */
-    private int hash = 0;
+    private int hash = -1;
 
     /** The "font-family" property. */
     private final FontFamilyProperty fontFamily;
@@ -227,31 +227,61 @@
     }
 
     /** {@inheritDoc} */
-    public boolean equals(Object o) {
-
-        if (o == null) {
-            return false;
-        }
-
-        if (this == o) {
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
             return true;
-        }
-
-        if (o instanceof CommonFont) {
-            CommonFont cf = (CommonFont) o;
-            return (cf.fontFamily == this.fontFamily)
-                    && (cf.fontSelectionStrategy == this.fontSelectionStrategy)
-                    && (cf.fontStretch == this.fontStretch)
-                    && (cf.fontStyle == this.fontStyle)
-                    && (cf.fontVariant == this.fontVariant)
-                    && (cf.fontWeight == this.fontWeight)
-                    && (cf.fontSize == this.fontSize)
-                    && (cf.fontSizeAdjust == this.fontSizeAdjust);
-        }
-        return false;
-
+        
+        if (obj == null)
+            return false;
+        
+        if (getClass() != obj.getClass())
+            return false;
+        
+        CommonFont other = (CommonFont) obj;
+        if (fontFamily == null) {
+            if (other.fontFamily != null)
+                return false;
+        } else if (!fontFamily.equals(other.fontFamily))
+            return false;
+        if (fontSelectionStrategy == null) {
+            if (other.fontSelectionStrategy != null)
+                return false;
+        } else if (!fontSelectionStrategy.equals(other.fontSelectionStrategy))
+            return false;
+        if (fontSize == null) {
+            if (other.fontSize != null)
+                return false;
+        } else if (!fontSize.equals(other.fontSize))
+            return false;
+        if (fontSizeAdjust == null) {
+            if (other.fontSizeAdjust != null)
+                return false;
+        } else if (!fontSizeAdjust.equals(other.fontSizeAdjust))
+            return false;
+        if (fontStretch == null) {
+            if (other.fontStretch != null)
+                return false;
+        } else if (!fontStretch.equals(other.fontStretch))
+            return false;
+        if (fontStyle == null) {
+            if (other.fontStyle != null)
+                return false;
+        } else if (!fontStyle.equals(other.fontStyle))
+            return false;
+        if (fontVariant == null) {
+            if (other.fontVariant != null)
+                return false;
+        } else if (!fontVariant.equals(other.fontVariant))
+            return false;
+        if (fontWeight == null) {
+            if (other.fontWeight != null)
+                return false;
+        } else if (!fontWeight.equals(other.fontWeight))
+            return false;
+        return true;
     }
-
+    
     /** {@inheritDoc} */
     public int hashCode() {
 
@@ -260,15 +290,13 @@
             hash = 37 * hash + (fontSize == null ? 0 : fontSize.hashCode());
             hash = 37 * hash + (fontSizeAdjust == null ? 0 : fontSizeAdjust.hashCode());
             hash = 37 * hash + (fontFamily == null ? 0 : fontFamily.hashCode());
-            hash = 37 * hash + (fontSelectionStrategy == null
-                                ? 0 : fontSelectionStrategy.hashCode());
+            hash = 37 * hash + (fontSelectionStrategy == null ? 0 : fontSelectionStrategy.hashCode());
             hash = 37 * hash + (fontStretch == null ? 0 : fontStretch.hashCode());
             hash = 37 * hash + (fontStyle == null ? 0 : fontStyle.hashCode());
             hash = 37 * hash + (fontVariant == null ? 0 : fontVariant.hashCode());
-            hash = 37 * hash + (fontStretch == null ? 0 : fontStretch.hashCode());
+            hash = 37 * hash + (fontWeight == null ? 0 : fontWeight.hashCode());
             this.hash = hash;
         }
         return hash;
-
     }
 }
