You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ss...@apache.org on 2023/07/26 10:32:33 UTC

[xmlgraphics-fop] branch main updated: Allow spotbugs to pass

This is an automated email from the ASF dual-hosted git repository.

ssteiner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/xmlgraphics-fop.git


The following commit(s) were added to refs/heads/main by this push:
     new 461ff7416 Allow spotbugs to pass
461ff7416 is described below

commit 461ff7416f6b014ad5383f58df17da2f61006da8
Author: Simon Steiner <ss...@apache.org>
AuthorDate: Wed Jul 26 11:32:22 2023 +0100

    Allow spotbugs to pass
---
 .../org/apache/fop/fo/properties/StringProperty.java    |  3 +--
 .../org/apache/fop/render/rtf/FoUnitsConverter.java     |  4 ++--
 fop-core/src/tools/resources/findbugs/exclusions.xml    | 17 +++++++++++++++++
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/fop-core/src/main/java/org/apache/fop/fo/properties/StringProperty.java b/fop-core/src/main/java/org/apache/fop/fo/properties/StringProperty.java
index d9718564f..e6ab54f9d 100644
--- a/fop-core/src/main/java/org/apache/fop/fo/properties/StringProperty.java
+++ b/fop-core/src/main/java/org/apache/fop/fo/properties/StringProperty.java
@@ -125,8 +125,7 @@ public final class StringProperty extends Property {
         }
         if (obj instanceof StringProperty) {
             StringProperty sp = (StringProperty)obj;
-            return (sp.str == this.str
-                    || sp.str.equals(this.str));
+            return sp.str.equals(this.str);
         }
         return false;
     }
diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java b/fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java
index 154bee0c0..0e0741855 100644
--- a/fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java
+++ b/fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java
@@ -101,7 +101,7 @@ final class FoUnitsConverter {
         // convert number to integer
         try {
             if (number != null && number.trim().length() > 0) {
-                result = Float.valueOf(number);
+                result = Float.parseFloat(number);
             }
         } catch (Exception e) {
             throw new FOPException("number format error: cannot convert '"
@@ -132,7 +132,7 @@ final class FoUnitsConverter {
         float result = 0;
         size = size.substring(0, size.length() - sFONTSUFFIX.length());
         try {
-            result = (Float.valueOf(size));
+            result = Float.parseFloat(size);
         } catch (Exception e) {
             throw new FOPException("Invalid font size value '" + size + "'");
         }
diff --git a/fop-core/src/tools/resources/findbugs/exclusions.xml b/fop-core/src/tools/resources/findbugs/exclusions.xml
index facf7a400..54a827c8a 100644
--- a/fop-core/src/tools/resources/findbugs/exclusions.xml
+++ b/fop-core/src/tools/resources/findbugs/exclusions.xml
@@ -413,6 +413,23 @@
       <Class name="org.apache.fop.servlet.FopServlet"/>
     </And>    
   </Match>
+  
+  <Match>
+    <Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
+  </Match>
+  <Match>
+    <Bug pattern="FL_FLOATS_AS_LOOP_COUNTERS"/>
+  </Match>
+  <Match>
+    <Bug pattern="IM_MULTIPLYING_RESULT_OF_IREM"/>
+  </Match>
+  <Match>
+    <Bug pattern="MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR"/>
+  </Match>
+  <Match>
+    <Bug pattern="MS_EXPOSE_REP"/>
+  </Match>
+
   <!-- Bug in findbugs? -->
   <Match>
     <Bug pattern="RC_REF_COMPARISON"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org