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 2007/07/19 15:24:55 UTC
svn commit: r557612 -
/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/NumberProperty.java
Author: adelmelle
Date: Thu Jul 19 06:24:54 2007
New Revision: 557612
URL: http://svn.apache.org/viewvc?view=rev&rev=557612
Log:
Fix: add implementation of hashCode() and equals() to NumberProperty, to make the caching work as expected.
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/NumberProperty.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/NumberProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/NumberProperty.java?view=diff&rev=557612&r1=557611&r2=557612
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/NumberProperty.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/NumberProperty.java Thu Jul 19 06:24:54 2007
@@ -217,4 +217,20 @@
return Color.black;
}
+ /** {@inheritDoc} */
+ public int hashCode() {
+ return number.hashCode();
+ }
+
+ /** {@inheritDoc} */
+ public boolean equals(Object o) {
+ if (o != null && o instanceof NumberProperty) {
+ NumberProperty np = (NumberProperty) o;
+ return (np.number == this.number
+ || (this.number != null
+ && this.number.equals(np.number)));
+ } else {
+ return false;
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org