Browse Source

Resolve Findbugs warning

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1856546 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_4
Chris Bowditch 5 years ago
parent
commit
92190f82a4

+ 5
- 3
fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java View File

@@ -101,9 +101,11 @@ public final class OptionalCharacterProperty extends Property {
public boolean equals(Object obj) {
if (obj instanceof OptionalCharacterProperty) {
OptionalCharacterProperty ocp = (OptionalCharacterProperty) obj;
return character == ocp.character
|| character != null
&& character.equals(ocp.character);
if (character == null && ocp.character == null) {
return true;
} else {
return (character != null && character.equals(ocp.character));
}
} else {
return false;
}

+ 10
- 0
fop-core/src/tools/resources/findbugs/exclusions.xml View File

@@ -413,6 +413,16 @@
<Class name="org.apache.fop.servlet.FopServlet"/>
</And>
</Match>
<!-- Bug in findbugs? -->
<Match>
<Bug pattern="RC_REF_COMPARISON"/>
<Or>
<And>
<Class name="org.apache.fop.fo.properties.OptionalCharacterProperty"/>
<Method name="equals"/>
</And>
</Or>
</Match>
<!-- END - TEMPORARY (UNAPPROVED) EXCLUSIONS -->


Loading…
Cancel
Save