From 3ceb93b23df0a1633caca8a829b022e60a5e38ff Mon Sep 17 00:00:00 2001
From: Andreas Beeker byte[]
returned by {@link
* SummaryInformation#getThumbnail()}
Offset in bytes where the Clipboard Format starts in the @@ -42,7 +42,7 @@ public final class Thumbnail { *
This is only valid if the Clipboard Format Tag is {@link * #CFTAG_WINDOWS}
*/ - public static int OFFSET_CF = 8; + public static final int OFFSET_CF = 8; /** *Offset in bytes where the Windows Metafile (WMF) image data
@@ -60,7 +60,7 @@ public final class Thumbnail {
* image. It can be saved to disk with a .wmf
file
* type and read using a WMF-capable image viewer.
Clipboard Format Tag - Windows clipboard format
@@ -68,7 +68,7 @@ public final class Thumbnail { *A DWORD
indicating a built-in Windows clipboard
* format value
Clipboard Format Tag - Macintosh clipboard format
@@ -76,7 +76,7 @@ public final class Thumbnail { *A DWORD
indicating a Macintosh clipboard format
* value
Clipboard Format Tag - Format ID
@@ -84,7 +84,7 @@ public final class Thumbnail { *A GUID containing a format identifier (FMTID). This is * rarely used.
*/ - public static int CFTAG_FMTID = -3; + public static final int CFTAG_FMTID = -3; /** *Clipboard Format Tag - No Data
@@ -92,7 +92,7 @@ public final class Thumbnail { *A DWORD
indicating No data. This is rarely
* used.
Clipboard Format - Windows metafile format. This is the @@ -102,17 +102,17 @@ public final class Thumbnail { * regular WMF images. The clipboard version of this format has an * extra clipboard-specific header.
*/ - public static int CF_METAFILEPICT = 3; + public static final int CF_METAFILEPICT = 3; /** *Clipboard Format - Device Independent Bitmap
*/ - public static int CF_DIB = 8; + public static final int CF_DIB = 8; /** *Clipboard Format - Enhanced Windows metafile format
*/ - public static int CF_ENHMETAFILE = 14; + public static final int CF_ENHMETAFILE = 14; /** *Clipboard Format - Bitmap
@@ -121,7 +121,7 @@ public final class Thumbnail { * href="msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp * target="_blank">msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp. */ - public static int CF_BITMAP = 2; + public static final int CF_BITMAP = 2; /** *A byte[]
to hold a thumbnail image in ({@link
diff --git a/src/java/org/apache/poi/hpsf/VariantSupport.java b/src/java/org/apache/poi/hpsf/VariantSupport.java
index 44d4ad76c..fe327b3d9 100644
--- a/src/java/org/apache/poi/hpsf/VariantSupport.java
+++ b/src/java/org/apache/poi/hpsf/VariantSupport.java
@@ -49,7 +49,7 @@ import org.apache.poi.util.POILogger;
*/
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;
/**
diff --git a/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java b/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java
index 95438334e..1c85e9550 100644
--- a/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java
+++ b/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java
@@ -32,18 +32,18 @@ public final class FtCfSubRecord extends SubRecord {
/**
* 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;
diff --git a/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java b/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java
index 8562a0535..068d17a24 100644
--- a/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java
+++ b/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java
@@ -33,53 +33,53 @@ public final class FtPioGrbitSubRecord extends SubRecord {
* 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;
diff --git a/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java b/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
index c6255e7d3..93a0430eb 100644
--- a/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
+++ b/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
@@ -16,8 +16,11 @@
==================================================================== */
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 class LbsDataSubRecord extends SubRecord {
/**
* 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.
diff --git a/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java b/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java
index 76cb44d4f..8f9ea7599 100644
--- a/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java
+++ b/src/ooxml/java/org/apache/poi/extractor/CommandLineTextExtractor.java
@@ -25,7 +25,7 @@ import org.apache.poi.POITextExtractor;
* 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) {
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java
index 046e71e6a..82e073167 100644
--- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java
+++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java
@@ -16,24 +16,24 @@
==================================================================== */
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 MapShape
object depending on its type
@@ -32,7 +44,7 @@ import java.util.Iterator;
*/
public final class ShapeFactory {
// For logging
- protected static POILogger logger = POILogFactory.getLogger(ShapeFactory.class);
+ protected static final POILogger logger = POILogFactory.getLogger(ShapeFactory.class);
/**
* Create a new shape from the data provided.
diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/ShapePainter.java b/src/scratchpad/src/org/apache/poi/hslf/model/ShapePainter.java
index 09474a0b8..c9954a8de 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/model/ShapePainter.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/model/ShapePainter.java
@@ -18,19 +18,22 @@
package org.apache.poi.hslf.model;
-import org.apache.poi.util.POILogger;
-import org.apache.poi.util.POILogFactory;
-
-import java.awt.*;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Stroke;
import java.awt.geom.Rectangle2D;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
+
/**
* Paint a shape into java.awt.Graphics2D
*
* @author Yegor Kozlov
*/
public final class ShapePainter {
- protected static POILogger logger = POILogFactory.getLogger(ShapePainter.class);
+ protected static final POILogger logger = POILogFactory.getLogger(ShapePainter.class);
public static void paint(SimpleShape shape, Graphics2D graphics){
Rectangle2D anchor = shape.getLogicalAnchor2D();
diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java b/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
index 7b5a17dec..4840c9313 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
@@ -17,10 +17,10 @@
package org.apache.poi.hslf.model;
-import org.apache.poi.hslf.exceptions.HSLFException;
-
-import java.util.HashMap;
import java.lang.reflect.Field;
+import java.util.HashMap;
+
+import org.apache.poi.hslf.exceptions.HSLFException;
/**
* Contains all known shape types in PowerPoint
@@ -38,7 +38,7 @@ public final class ShapeTypes implements org.apache.poi.sl.usermodel.ShapeTypes
return name;
}
- public static HashMap types;
+ public static final HashMap types;
static {
types = new HashMap();
try {
diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/CharFlagsTextProp.java b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/CharFlagsTextProp.java
index f03878153..1afd6b181 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/CharFlagsTextProp.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/CharFlagsTextProp.java
@@ -32,7 +32,7 @@ public class CharFlagsTextProp extends BitMaskTextProp {
public static final int ENABLE_NUMBERING_1_IDX = 11;
public static final int ENABLE_NUMBERING_2_IDX = 12;
- public static String NAME = "char_flags";
+ public static final String NAME = "char_flags";
public CharFlagsTextProp() {
super(2,0xffff, NAME, new String[] {
"bold", // 0x0001 A bit that specifies whether the characters are bold.
diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java
index f1bce9593..c0501d2f9 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java
@@ -28,7 +28,7 @@ public final class ParagraphFlagsTextProp extends BitMaskTextProp {
public static final int BULLET_HARDCOLOR_IDX = 2;
public static final int BULLET_HARDSIZE_IDX = 4;
- public static String NAME = "paragraph_flags";
+ public static final String NAME = "paragraph_flags";
public ParagraphFlagsTextProp() {
super(2, 0xF, NAME, new String[] {
diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/Record.java b/src/scratchpad/src/org/apache/poi/hslf/record/Record.java
index 5530e2454..eb6944ac6 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/record/Record.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/record/Record.java
@@ -38,7 +38,7 @@ import org.apache.poi.util.POILogger;
public abstract class Record
{
// For logging
- protected static POILogger logger = POILogFactory.getLogger(Record.class);
+ protected static final POILogger logger = POILogFactory.getLogger(Record.class);
/**
* Is this record type an Atom record (only has data),
diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java b/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
index 2b2dc4bdd..51b8f26a8 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
@@ -17,8 +17,8 @@
package org.apache.poi.hslf.record;
-import java.util.HashMap;
import java.lang.reflect.Field;
+import java.util.HashMap;
/**
* List of all known record types in a PowerPoint document, and the
@@ -31,8 +31,8 @@ import java.lang.reflect.Field;
* @author Nick Burch
*/
public final class RecordTypes {
- public static HashMap