diff options
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java | 8 | ||||
-rw-r--r-- | fop-core/src/tools/resources/findbugs/exclusions.xml | 10 |
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 --> |