]> source.dussan.org Git - poi.git/commitdiff
fix findbugs issues
authorJaven O'Neal <onealj@apache.org>
Mon, 13 Jun 2016 03:48:30 +0000 (03:48 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 13 Jun 2016 03:48:30 +0000 (03:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748080 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ddf/EscherComplexProperty.java
src/java/org/apache/poi/dev/RecordGenerator.java
src/java/org/apache/poi/hpsf/Decimal.java
src/resources/devtools/findbugs-filters.xml

index 3649d98f06d3a32a86de85aa71ce1a0363578499..9c97ec0448a85cbf921562d289221b3210fb5e24 100644 (file)
@@ -106,7 +106,7 @@ public class EscherComplexProperty extends EscherProperty {
         if (this == o) {
             return true;
         }
-        if (!(o instanceof EscherComplexProperty)) {
+        if (o == null || !(o instanceof EscherComplexProperty)) {
             return false;
         }
 
index f841edec42f68ba751626c4238be9b0dad4008b1..2d3cdf3a9947d77d828a19bb95e68c751a8b447c 100644 (file)
@@ -92,7 +92,9 @@ public class RecordGenerator {
                 // Generate record
                 String destinationPath = destSrcPathDir + "/" + packageName;
                 File destinationPathFile = new File(destinationPath);
-                destinationPathFile.mkdirs();
+                if (destinationPathFile.mkdirs()) {
+                    System.out.println("Created destination directory: " + destinationPath);
+                }
                 String destinationFilepath = destinationPath + "/" + recordName + suffix + ".java";
                 transform(file, new File(destinationFilepath), 
                           new File(recordStyleDir + "/" + extendstg.toLowerCase(Locale.ROOT) + ".xsl"));
@@ -101,7 +103,9 @@ public class RecordGenerator {
                 // Generate test (if not already generated)
                 destinationPath = testSrcPathDir + "/" + packageName;
                 destinationPathFile = new File(destinationPath);
-                destinationPathFile.mkdirs();
+                if (destinationPathFile.mkdirs()) {
+                    System.out.println("Created destination directory: " + destinationPath);
+                }
                 destinationFilepath = destinationPath + "/Test" + recordName + suffix + ".java";
                 if (new File(destinationFilepath).exists() == false) {
                     String temp = (recordStyleDir + "/" + extendstg.toLowerCase(Locale.ROOT) + "_test.xsl");
index 8897d3d5b2ec60f82e4a1e73858d5b47d82d1d87..d8c404c31cea05a501482ad5c5f9521adf2c5446 100644 (file)
@@ -24,6 +24,9 @@ class Decimal
 {
     static final int SIZE = 16;
 
+    /**
+     * Findbugs: UNR_UNREAD_FIELD
+     */
     private short field_1_wReserved;
     private byte field_2_scale;
     private byte field_3_sign;
index 458f5eaa1c41d48de94a3efada2ef5fdafbe2052..cb9c4f3607e214c035ef7600e5e65581e3385182 100644 (file)
                <Class name="org.apache.poi.xssf.model.IndexedUDFFinder"/>
                <Bug code="Nm" />
        </Match>
+               <Match>
+               <Class name="org.apache.poi.hpsf.Decimal"/>
+               <Bug pattern="URF_UNREAD_FIELD" />
+       </Match>
 
        <!-- named this way on purpose -->
        <Match>