Permalink
Browse files

FindBugs fix

- fixed "Field isn't final but should be"
- see http://findbugs.sourceforge.net/bugDescriptions.html#MS_SHOULD_BE_FINAL


git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1568145 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
kiwiwings committed Feb 13, 2014
1 parent 276b477 commit 3ceb93b23df0a1633caca8a829b022e60a5e38ff
Showing with 133 additions and 93 deletions.
  1. +1 −1 build.xml
  2. +11 −11 src/java/org/apache/poi/hpsf/Thumbnail.java
  3. +1 −1 src/java/org/apache/poi/hpsf/VariantSupport.java
  4. +3 −3 src/java/org/apache/poi/hssf/record/FtCfSubRecord.java
  5. +9 −9 src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java
  6. +8 −5 src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
  7. +1 −1 src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java
  8. +5 −5 src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java
  9. +2 −2 src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRelation.java
  10. +1 −1 src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java
  11. +3 −3 src/resources/devtools/findbugs-filters.xml
  12. +13 −4 src/scratchpad/src/org/apache/poi/hslf/dev/PPTXMLDump.java
  13. +9 −3 src/scratchpad/src/org/apache/poi/hslf/model/AutoShapes.java
  14. +19 −7 src/scratchpad/src/org/apache/poi/hslf/model/ShapeFactory.java
  15. +8 −5 src/scratchpad/src/org/apache/poi/hslf/model/ShapePainter.java
  16. +4 −4 src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
  17. +1 −1 src/scratchpad/src/org/apache/poi/hslf/model/textproperties/CharFlagsTextProp.java
  18. +1 −1 src/scratchpad/src/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java
  19. +1 −1 src/scratchpad/src/org/apache/poi/hslf/record/Record.java
  20. +3 −3 src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
  21. +8 −8 src/scratchpad/src/org/apache/poi/hslf/record/SSSlideInfoAtom.java
  22. +2 −2 src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java
  23. +17 −10 src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java
  24. +2 −2 src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java
View
@@ -1405,7 +1405,7 @@ under the License.
</classpath>
</taskdef>
<findbugs home="${findbugs.home}" output="html" outputFile="build/findbugs.html"
- includeFilter="src/resources/devtools/findbugs-filters.xml">
+ excludeFilter="src/resources/devtools/findbugs-filters.xml">
<fileset dir="${dist.dir}">
<include name="poi-${version.id}-*.jar"/>
<include name="poi-scratchpad-${version.id}-*.jar"/>
@@ -32,7 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* <code>byte[]</code> returned by {@link
* SummaryInformation#getThumbnail()}</p>
*/
- public static int OFFSET_CFTAG = 4;
+ public static final int OFFSET_CFTAG = 4;
/**
* <p>Offset in bytes where the Clipboard Format starts in the
@@ -42,7 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* <p>This is only valid if the Clipboard Format Tag is {@link
* #CFTAG_WINDOWS}</p>
*/
- public static int OFFSET_CF = 8;
+ public static final int OFFSET_CF = 8;
/**
* <p>Offset in bytes where the Windows Metafile (WMF) image data
@@ -60,39 +60,39 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* image. It can be saved to disk with a <code>.wmf</code> file
* type and read using a WMF-capable image viewer.</p>
*/
- public static int OFFSET_WMFDATA = 20;
+ public static final int OFFSET_WMFDATA = 20;
/**
* <p>Clipboard Format Tag - Windows clipboard format</p>
*
* <p>A <code>DWORD</code> indicating a built-in Windows clipboard
* format value</p>
*/
- public static int CFTAG_WINDOWS = -1;
+ public static final int CFTAG_WINDOWS = -1;
/**
* <p>Clipboard Format Tag - Macintosh clipboard format</p>
*
* <p>A <code>DWORD</code> indicating a Macintosh clipboard format
* value</p>
*/
- public static int CFTAG_MACINTOSH = -2;
+ public static final int CFTAG_MACINTOSH = -2;
/**
* <p>Clipboard Format Tag - Format ID</p>
*
* <p>A GUID containing a format identifier (FMTID). This is
* rarely used.</p>
*/
- public static int CFTAG_FMTID = -3;
+ public static final int CFTAG_FMTID = -3;
/**
* <p>Clipboard Format Tag - No Data</p>
*
* <p>A <code>DWORD</code> indicating No data. This is rarely
* used.</p>
*/
- public static int CFTAG_NODATA = 0;
+ public static final int CFTAG_NODATA = 0;
/**
* <p>Clipboard Format - Windows metafile format. This is the
@@ -102,17 +102,17 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* regular WMF images. The clipboard version of this format has an
* extra clipboard-specific header.</p>
*/
- public static int CF_METAFILEPICT = 3;
+ public static final int CF_METAFILEPICT = 3;
/**
* <p>Clipboard Format - Device Independent Bitmap</p>
*/
- public static int CF_DIB = 8;
+ public static final int CF_DIB = 8;
/**
* <p>Clipboard Format - Enhanced Windows metafile format</p>
*/
- public static int CF_ENHMETAFILE = 14;
+ public static final int CF_ENHMETAFILE = 14;
/**
* <p>Clipboard Format - Bitmap</p>
@@ -121,7 +121,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* href="msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp
* target="_blank">msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp</a>.</p>
*/
- public static int CF_BITMAP = 2;
+ public static final int CF_BITMAP = 2;
/**
* <p>A <code>byte[]</code> to hold a thumbnail image in ({@link
@@ -49,7 +49,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public class VariantSupport extends Variant
{
- private static POILogger logger = POILogFactory.getLogger(VariantSupport.class);
+ private static final POILogger logger = POILogFactory.getLogger(VariantSupport.class);
private static boolean logUnsupportedTypes = false;
/**
@@ -32,18 +32,18 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
* Specifies the format of the picture is an enhanced metafile.
*/
- public static short METAFILE_BIT = (short)0x0002;
+ public static final short METAFILE_BIT = (short)0x0002;
/**
* Specifies the format of the picture is a bitmap.
*/
- public static short BITMAP_BIT = (short)0x0009;
+ public static final short BITMAP_BIT = (short)0x0009;
/**
* Specifies the picture is in an unspecified format that is
* neither and enhanced metafile nor a bitmap.
*/
- public static short UNSPECIFIED_BIT = (short)0xFFFF;
+ public static final short UNSPECIFIED_BIT = (short)0xFFFF;
private short flags = 0;
@@ -33,53 +33,53 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* A bit that specifies whether the picture's aspect ratio is preserved when rendered in
* different views (Normal view, Page Break Preview view, Page Layout view and printing).
*/
- public static int AUTO_PICT_BIT = 1 << 0;
+ public static final int AUTO_PICT_BIT = 1 << 0;
/**
* A bit that specifies whether the pictFmla field of the Obj record that contains
* this FtPioGrbit specifies a DDE reference.
*/
- public static int DDE_BIT = 1 << 1;
+ public static final int DDE_BIT = 1 << 1;
/**
* A bit that specifies whether this object is expected to be updated on print to
* reflect the values in the cell associated with the object.
*/
- public static int PRINT_CALC_BIT = 1 << 2;
+ public static final int PRINT_CALC_BIT = 1 << 2;
/**
* A bit that specifies whether the picture is displayed as an icon.
*/
- public static int ICON_BIT = 1 << 3;
+ public static final int ICON_BIT = 1 << 3;
/**
* A bit that specifies whether this object is an ActiveX control.
* It MUST NOT be the case that both fCtl and fDde are equal to 1.
*/
- public static int CTL_BIT = 1 << 4;
+ public static final int CTL_BIT = 1 << 4;
/**
* A bit that specifies whether the object data are stored in an
* embedding storage (= 0) or in the controls stream (ctls) (= 1).
*/
- public static int PRSTM_BIT = 1 << 5;
+ public static final int PRSTM_BIT = 1 << 5;
/**
* A bit that specifies whether this is a camera picture.
*/
- public static int CAMERA_BIT = 1 << 7;
+ public static final int CAMERA_BIT = 1 << 7;
/**
* A bit that specifies whether this picture's size has been explicitly set.
* 0 = picture size has been explicitly set, 1 = has not been set
*/
- public static int DEFAULT_SIZE_BIT = 1 << 8;
+ public static final int DEFAULT_SIZE_BIT = 1 << 8;
/**
* A bit that specifies whether the OLE server for the object is called
* to load the object's data automatically when the parent workbook is opened.
*/
- public static int AUTO_LOAD_BIT = 1 << 9;
+ public static final int AUTO_LOAD_BIT = 1 << 9;
private short flags = 0;
@@ -16,8 +16,11 @@ Licensed to the Apache Software Foundation (ASF) under one or more
==================================================================== */
package org.apache.poi.hssf.record;
-import org.apache.poi.ss.formula.ptg.*;
-import org.apache.poi.util.*;
+import org.apache.poi.ss.formula.ptg.Ptg;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndianInput;
+import org.apache.poi.util.LittleEndianOutput;
+import org.apache.poi.util.StringUtil;
/**
* This structure specifies the properties of a list or drop-down list embedded object in a sheet.
@@ -298,15 +301,15 @@ public int getNumberOfItems(){
/**
* Combo dropdown control
*/
- public static int STYLE_COMBO_DROPDOWN = 0;
+ public static final int STYLE_COMBO_DROPDOWN = 0;
/**
* Combo Edit dropdown control
*/
- public static int STYLE_COMBO_EDIT_DROPDOWN = 1;
+ public static final int STYLE_COMBO_EDIT_DROPDOWN = 1;
/**
* Simple dropdown control (just the dropdown button)
*/
- public static int STYLE_COMBO_SIMPLE_DROPDOWN = 2;
+ public static final int STYLE_COMBO_SIMPLE_DROPDOWN = 2;
/**
* An unsigned integer that specifies the style of this dropdown.
@@ -25,7 +25,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* for when debugging.
*/
public class CommandLineTextExtractor {
- public static String DIVIDER = "=======================";
+ public static final String DIVIDER = "=======================";
public static void main(String[] args) throws Exception {
if(args.length < 1) {
@@ -16,24 +16,24 @@ Licensed to the Apache Software Foundation (ASF) under one or more
==================================================================== */
package org.apache.poi.xslf.usermodel;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.POIXMLRelation;
import org.apache.poi.util.Beta;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
-import java.util.HashMap;
-import java.util.Map;
-
@Beta
public class XSLFRelation extends POIXMLRelation {
- private static POILogger log = POILogFactory.getLogger(XSLFRelation.class);
+ private static final POILogger log = POILogFactory.getLogger(XSLFRelation.class);
/**
* A map to lookup POIXMLRelation by its relation type
*/
- protected static Map<String, XSLFRelation> _table = new HashMap<String, XSLFRelation>();
+ protected static final Map<String, XSLFRelation> _table = new HashMap<String, XSLFRelation>();
public static final XSLFRelation MAIN = new XSLFRelation(
"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",
@@ -47,12 +47,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public final class XSSFRelation extends POIXMLRelation {
- private static POILogger log = POILogFactory.getLogger(XSSFRelation.class);
+ private static final POILogger log = POILogFactory.getLogger(XSSFRelation.class);
/**
* A map to lookup POIXMLRelation by its relation type
*/
- protected static Map<String, XSSFRelation> _table = new HashMap<String, XSSFRelation>();
+ protected static final Map<String, XSSFRelation> _table = new HashMap<String, XSSFRelation>();
public static final XSSFRelation WORKBOOK = new XSSFRelation(
@@ -31,7 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
* A map to lookup POIXMLRelation by its relation type
*/
- protected static Map<String, XWPFRelation> _table = new HashMap<String, XWPFRelation>();
+ protected static final Map<String, XWPFRelation> _table = new HashMap<String, XWPFRelation>();
public static final XWPFRelation DOCUMENT = new XWPFRelation(
@@ -18,7 +18,7 @@
====================================================================
-->
<FindBugsFilter>
-<Match>
-<Not><Bug pattern="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE"/></Not>
-</Match>
+ <Match>
+ <Bug pattern="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE,MS_PKGPROTECT,MS_MUTABLE_ARRAY"/>
+ </Match>
</FindBugsFilter>
@@ -17,10 +17,19 @@ Licensed to the Apache Software Foundation (ASF) under one or more
package org.apache.poi.hslf.dev;
-import org.apache.poi.util.LittleEndian;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+
import org.apache.poi.hslf.record.RecordTypes;
-import org.apache.poi.poifs.filesystem.*;
-import java.io.*;
+import org.apache.poi.poifs.filesystem.DocumentEntry;
+import org.apache.poi.poifs.filesystem.DocumentInputStream;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.util.LittleEndian;
/**
* Utility class which dumps raw contents of a ppt file into XML format
@@ -33,7 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
public static final int PICT_HEADER_SIZE = 25; //size of the picture header
public final static String PPDOC_ENTRY = "PowerPoint Document";
public final static String PICTURES_ENTRY = "Pictures";
- public static String CR = System.getProperty("line.separator");
+ public final static String CR = System.getProperty("line.separator");
protected Writer out;
protected byte[] docstream;
@@ -17,9 +17,15 @@ Licensed to the Apache Software Foundation (ASF) under one or more
package org.apache.poi.hslf.model;
-import org.apache.poi.ddf.EscherProperties;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Arc2D;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Line2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
-import java.awt.geom.*;
+import org.apache.poi.ddf.EscherProperties;
/**
* Stores definition of auto-shapes.
@@ -30,7 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* @author Yegor Kozlov
*/
public final class AutoShapes {
- protected static ShapeOutline[] shapes;
+ protected static final ShapeOutline[] shapes;
/**
Oops, something went wrong.

0 comments on commit 3ceb93b

Please sign in to comment.