git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1330453 13f79535-47bb-0310-9956-ffa450edef68tags/fop-1_1rc1old
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
<FindBugsFilter> | <FindBugsFilter> | ||||
<Match> | |||||
<Class name="org.apache.fop.fo.properties.FontFamilyProperty"/> | |||||
<Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/> | |||||
</Match> | |||||
<Match> | |||||
<Class name="org.apache.fop.fo.properties.CondLengthProperty"/> | |||||
<Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/> | |||||
</Match> | |||||
<Match> | |||||
<Class name="org.apache.fop.pdf.xref.TrailerDictionary$1FileID"/> | |||||
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/> | |||||
</Match> | |||||
<Match> | |||||
<Class name="org.apache.fop.fo.properties.ToBeImplementedProperty"/> | |||||
<Bug pattern="EQ_ALWAYS_TRUE"/> | |||||
</Match> | |||||
<Match> | <Match> | ||||
<Class name="org.apache.fop.render.intermediate.IFStructureTreeBuilder"/> | <Class name="org.apache.fop.render.intermediate.IFStructureTreeBuilder"/> | ||||
<Field name="delegate"/> | <Field name="delegate"/> |
package org.apache.fop.fo.properties; | package org.apache.fop.fo.properties; | ||||
import java.util.Iterator; | |||||
import org.apache.fop.fo.FObj; | import org.apache.fop.fo.FObj; | ||||
import org.apache.fop.fo.PropertyList; | import org.apache.fop.fo.PropertyList; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
private static final PropertyCache<FontFamilyProperty> CACHE | private static final PropertyCache<FontFamilyProperty> CACHE | ||||
= new PropertyCache<FontFamilyProperty>(); | = new PropertyCache<FontFamilyProperty>(); | ||||
private int hash = 0; | |||||
/** | /** | ||||
* Inner class for creating instances of ListProperty | * Inner class for creating instances of ListProperty | ||||
*/ | */ | ||||
} | } | ||||
} | } | ||||
/** {@inheritDoc} */ | |||||
public boolean equals(Object o) { | |||||
if (this == o) { | |||||
return true; | |||||
} | |||||
if (o instanceof FontFamilyProperty) { | |||||
FontFamilyProperty ffp = (FontFamilyProperty) o; | |||||
return (this.list != null | |||||
&& this.list.equals(ffp.list)); | |||||
} | |||||
return false; | |||||
} | |||||
/** {@inheritDoc} */ | |||||
public int hashCode() { | |||||
if (this.hash == 0) { | |||||
int hash = 17; | |||||
for (Iterator i = list.iterator(); i.hasNext();) { | |||||
Property p = (Property) i.next(); | |||||
hash = 37 * hash + (p == null ? 0 : p.hashCode()); | |||||
} | |||||
this.hash = hash; | |||||
} | |||||
return this.hash; | |||||
} | |||||
} | } |
import org.apache.fop.fo.FObj; | import org.apache.fop.fo.FObj; | ||||
import org.apache.fop.fo.PropertyList; | import org.apache.fop.fo.PropertyList; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
import org.apache.fop.util.CompareUtil; | |||||
/** | /** | ||||
* Base class used for handling properties of the fo:space-before and | * Base class used for handling properties of the fo:space-before and | ||||
return this; | return this; | ||||
} | } | ||||
@Override | |||||
public int hashCode() { | |||||
final int prime = 31; | |||||
int result = super.hashCode(); | |||||
result = prime * result + CompareUtil.getHashCode(precedence); | |||||
result = prime * result + CompareUtil.getHashCode(conditionality); | |||||
return result; | |||||
} | |||||
@Override | |||||
public boolean equals(Object obj) { | |||||
if (this == obj) { | |||||
return true; | |||||
} | |||||
if (!(obj instanceof SpaceProperty)) { | |||||
return false; | |||||
} | |||||
SpaceProperty other = (SpaceProperty) obj; | |||||
return super.equals(obj) | |||||
&& CompareUtil.equal(precedence, other.precedence) | |||||
&& CompareUtil.equal(conditionality, other.conditionality); | |||||
} | |||||
} | } |