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

src/java/org/apache/poi/hssf/usermodel/HSSFDataValidationHelper.java
src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java
src/resources/devtools/findbugs-filters.xml

index dd24bc416e735678347e5e63f7e1aadb9535eba8..a6990f3e238c877c70f638defa1fe813434dbcbe 100644 (file)
@@ -27,12 +27,12 @@ import org.apache.poi.ss.util.CellRangeAddressList;
  * Helper for working with Data Validation
  */
 public class HSSFDataValidationHelper implements DataValidationHelper {
-       @SuppressWarnings("unused")
-       private HSSFSheet sheet;
+       //URF_UNREAD_FIELD
+       //private HSSFSheet sheet;
        
        public HSSFDataValidationHelper(HSSFSheet sheet) {
                super();
-               this.sheet = sheet;
+               //this.sheet = sheet;
        }
 
        /*
index f8f81c1f066b83a6cd529cc241dd158a843a169a..0dd4533e39f8774ed8f41b756e2714da694189a2 100644 (file)
@@ -48,7 +48,8 @@ public class HSSFTextbox extends HSSFSimpleShape {
         super(spContainer, objRecord, textObjectRecord);
     }
 
-    HSSFRichTextString string = new HSSFRichTextString("");
+    //Unused: URF_UNREAD_FIELD
+    //HSSFRichTextString string = new HSSFRichTextString("");
 
     /**
      * Construct a new textbox with the given parent and anchor.
index d86911035de1c0649e618d447d436368fb2c40e6..98b2a84d779eeaee48a7d4aa7013ec87d45f4490 100644 (file)
@@ -35,12 +35,13 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationType;
  *
  */
 public class XSSFDataValidationHelper implements DataValidationHelper {
-       private XSSFSheet xssfSheet;
+    //Unused: URF_UNREAD_FIELD
+       //private XSSFSheet xssfSheet;
        
     
     public XSSFDataValidationHelper(XSSFSheet xssfSheet) {
                super();
-               this.xssfSheet = xssfSheet;
+               //this.xssfSheet = xssfSheet;
        }
 
        /* (non-Javadoc)
index f26f3eb50b7c67f33cc4116684eb40c2b7a09c9b..4c0811f79a188bf23ea94418044001ecf8c4f53b 100644 (file)
@@ -43,7 +43,8 @@ public final class XSSFGraphicFrame extends XSSFShape {
        private static CTGraphicalObjectFrame prototype = null;
 
        private CTGraphicalObjectFrame graphicFrame;
-       private XSSFDrawing drawing;
+       // Unused: URF_UNREAD_FIELD
+       //private XSSFDrawing drawing;
        private XSSFClientAnchor anchor;
 
        /**
index 4677ffe633c812bad2b5c93f499628b775bff6a1..b2152bcf48b4605affb3463e0d8381ebd0045646 100644 (file)
                </Or>
                <Bug code="Nm" />
        </Match>
+
+       <!-- ignore fields that correspond to the values in a H??F binary record -->
+       <Match>
+               <Class name="~org\.apache\.poi\.h..f\..*"/>
+               <Bug pattern="URF_UNREAD_FIELD" />
+               <Field name="~field_[12345].*" />
+       </Match>
        <Match>
-               <Class name="org.apache.poi.hpsf.Decimal"/>
+               <Class name="org.apache.poi.hssf.usermodel.HSSFChart"/>
                <Bug pattern="URF_UNREAD_FIELD" />
-               <Field name="field_[12345]_.+" />
+               <Field name="chartTitleFormat" />
        </Match>
+       <Match>
+               <Class name="org.apache.poi.hwmf.record.HwmfWindowing"/>
+               <Bug pattern="URF_UNREAD_FIELD" />
+               <Field name="count2" />
+       </Match>
+       
+
     <!-- invalid performance issues - e.g. see #57840 -->
     <Match>
-        <Class name="org.apache.poi.xssf.usermodel.XSSFRow"/>
-        <Bug pattern="DM_NUMBER_CTOR" />
-    </Match>
-    <Match>
-        <Class name="org.apache.poi.xssf.usermodel.XSSFSheet"/>
+        <Or>
+            <Class name="org.apache.poi.xssf.usermodel.XSSFRow"/>
+            <Class name="org.apache.poi.xssf.usermodel.XSSFSheet"/>
+        </Or>
         <Bug pattern="DM_NUMBER_CTOR" />
     </Match>