Author: cbowditch Date: Fri Mar 29 15:01:48 2019 New Revision: 1856546 URL: http://svn.apache.org/viewvc?rev=1856546&view=rev Log: Resolve Findbugs warning
Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java xmlgraphics/fop/trunk/fop-core/src/tools/resources/findbugs/exclusions.xml Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java?rev=1856546&r1=1856545&r2=1856546&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/OptionalCharacterProperty.java Fri Mar 29 15:01:48 2019 @@ -101,9 +101,11 @@ public final class OptionalCharacterProp 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; } Modified: xmlgraphics/fop/trunk/fop-core/src/tools/resources/findbugs/exclusions.xml URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/tools/resources/findbugs/exclusions.xml?rev=1856546&r1=1856545&r2=1856546&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/tools/resources/findbugs/exclusions.xml (original) +++ xmlgraphics/fop/trunk/fop-core/src/tools/resources/findbugs/exclusions.xml Fri Mar 29 15:01:48 2019 @@ -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 --> --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org