]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Allow spotbugs to pass
authorSimon Steiner <ssteiner@apache.org>
Wed, 26 Jul 2023 10:32:22 +0000 (11:32 +0100)
committerSimon Steiner <ssteiner@apache.org>
Wed, 26 Jul 2023 10:32:22 +0000 (11:32 +0100)
fop-core/src/main/java/org/apache/fop/fo/properties/StringProperty.java
fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java
fop-core/src/tools/resources/findbugs/exclusions.xml

index d9718564fe2de8bf0f2d162bef43bcbae78643de..e6ab54f9dc1b58642eb82b8dc8419eb9ca570f63 100644 (file)
@@ -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;
     }
index 154bee0c0965866c2ba6285e00be286f2a6282f5..0e0741855de2e09bff1b920f64609064b230f081 100644 (file)
@@ -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 + "'");
         }
index facf7a4001b88b227723e0ee7a316b6e776a8316..54a827c8aa2ed45fc06d36c66ab1aae8b37334f4 100644 (file)
       <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"/>