summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bowditch <cbowditch@apache.org>2019-03-29 15:01:48 +0000
committerChris Bowditch <cbowditch@apache.org>2019-03-29 15:01:48 +0000
commit92190f82a4793f9a8a8d6441b61cb125b961b8ef (patch)
treeb3fa70c6d43ab8aff86c962d18a2d133b4136ea0
parent1488e788972f0ee1b9fbd91de166fe5323eae454 (diff)
downloadxmlgraphics-fop-92190f82a4793f9a8a8d6441b61cb125b961b8ef.tar.gz
xmlgraphics-fop-92190f82a4793f9a8a8d6441b61cb125b961b8ef.zip
Resolve Findbugs warning
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1856546 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java8
-rw-r--r--fop-core/src/tools/resources/findbugs/exclusions.xml10
2 files changed, 15 insertions, 3 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java b/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java
index 73c1f8626..2d67dbef0 100644
--- a/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java
+++ b/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java
@@ -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;
}
diff --git a/fop-core/src/tools/resources/findbugs/exclusions.xml b/fop-core/src/tools/resources/findbugs/exclusions.xml
index c78ba0577..facf7a400 100644
--- a/fop-core/src/tools/resources/findbugs/exclusions.xml
+++ b/fop-core/src/tools/resources/findbugs/exclusions.xml
@@ -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 -->