poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1705779 [1/2] - in /poi: site/src/documentation/content/xdocs/ site/src/documentation/content/xdocs/document/ trunk/src/examples/src/org/apache/poi/hslf/examples/ trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/ trunk/src/exa...
Date Mon, 28 Sep 2015 21:26:07 GMT
Author: kiwiwings
Date: Mon Sep 28 21:26:06 2015
New Revision: 1705779

URL: http://svn.apache.org/viewvc?rev=1705779&view=rev
Log:
Removed HDF API
Sonar fixes

Removed:
    poi/trunk/src/scratchpad/src/org/apache/poi/hdf/
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hdf/
Modified:
    poi/site/src/documentation/content/xdocs/document/index.xml
    poi/site/src/documentation/content/xdocs/status.xml
    poi/trunk/src/examples/src/org/apache/poi/hslf/examples/CreateHyperlink.java
    poi/trunk/src/examples/src/org/apache/poi/hslf/examples/HeadersFootersDemo.java
    poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
    poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
    poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/NewSheet.java
    poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/DataExtraction.java
    poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
    poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateUserDefinedDataFormats.java
    poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/SelectedSheet.java
    poi/trunk/src/integrationtest/org/apache/poi/stress/HDGFFileHandler.java
    poi/trunk/src/integrationtest/org/apache/poi/stress/HWPFFileHandler.java
    poi/trunk/src/integrationtest/org/apache/poi/stress/POIFSFileHandler.java
    poi/trunk/src/java/org/apache/poi/hpsf/IndirectPropertyName.java
    poi/trunk/src/java/org/apache/poi/hssf/record/SSTRecord.java
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCBit.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/DOPAbstractType.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/TLPAbstractType.java

Modified: poi/site/src/documentation/content/xdocs/document/index.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/document/index.xml?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/document/index.xml (original)
+++ poi/site/src/documentation/content/xdocs/document/index.xml Mon Sep 28 21:26:06 2015
@@ -62,15 +62,9 @@
    <section>
     <title>An overview of the code</title>
     <p>
-        Source code in the
-        <em>org.apache.poi.hdf</em>
-        tree is the old legacy code. Source in the
-        <em>org.apache.poi.hwpf.model</em>
-        tree is the old legacy code refactored into an new object model. Those packages contains
-        Java representation of internal Word format structure. This code is "internal", it shall not
-        be used by your code. Because of backward-compatibility some API still has references to
-        those packages. They are subject to be deprecated and removed. Code from
-        <em>org.apache.poi.hwpf.usermodel</em>
+        Source in the <em>org.apache.poi.hwpf.model</em> tree is the Java representation of
+        internal Word format structure. This code is "internal", it shall not
+        be used by your code. Code from <em>org.apache.poi.hwpf.usermodel</em>
         package is actual public and user-friendly (as much as possible) API to access document
         parts. Source code in the
         <em>org.apache.poi.hwpf.extractor</em>

Modified: poi/site/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/status.xml?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/status.xml (original)
+++ poi/site/src/documentation/content/xdocs/status.xml Mon Sep 28 21:26:06 2015
@@ -38,8 +38,9 @@
         <person id="YK" name="Yegor Kozlov" email="yegor@apache.org" />
     </devs>
 
-    <!-- release version="3.14-beta1" date="2015-11-??">
-    </release -->
+    <release version="3.14-beta1" date="2015-11-??">
+        <action dev="PD" type="fix">Removed deprecated HDF API</action>
+    </release>
 
     <release version="3.13" date="2015-09-25">
         <action dev="DN" type="fix" fixes-bug="58350">Make XSSF and HSSF consistent on Sheet.getMergedRegions: return empty list if there are none.</action>

Modified: poi/trunk/src/examples/src/org/apache/poi/hslf/examples/CreateHyperlink.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hslf/examples/CreateHyperlink.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hslf/examples/CreateHyperlink.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hslf/examples/CreateHyperlink.java Mon Sep 28 21:26:06 2015
@@ -19,6 +19,7 @@ package org.apache.poi.hslf.examples;
 
 import java.awt.Rectangle;
 import java.io.FileOutputStream;
+import java.io.IOException;
 
 import org.apache.poi.hslf.usermodel.HSLFHyperlink;
 import org.apache.poi.hslf.usermodel.HSLFSlide;
@@ -27,17 +28,14 @@ import org.apache.poi.hslf.usermodel.HSL
 
 /**
  * Demonstrates how to create hyperlinks in PowerPoint presentations
- *
- * @author Yegor Kozlov
  */
-public final class CreateHyperlink {
-
-    @SuppressWarnings("unused")
-    public static void main(String[] args) throws Exception {
+public abstract class CreateHyperlink {
+    
+    public static void main(String[] args) throws IOException {
         HSLFSlideShow ppt = new HSLFSlideShow();
 
         HSLFSlide slideA = ppt.createSlide();
-        HSLFSlide slideB = ppt.createSlide();
+        ppt.createSlide();
         HSLFSlide slideC = ppt.createSlide();
 
         // link to a URL

Modified: poi/trunk/src/examples/src/org/apache/poi/hslf/examples/HeadersFootersDemo.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hslf/examples/HeadersFootersDemo.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hslf/examples/HeadersFootersDemo.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hslf/examples/HeadersFootersDemo.java Mon Sep 28 21:26:06 2015
@@ -17,18 +17,16 @@
 package org.apache.poi.hslf.examples;
 
 import java.io.FileOutputStream;
+import java.io.IOException;
 
 import org.apache.poi.hslf.model.HeadersFooters;
-import org.apache.poi.hslf.usermodel.HSLFSlide;
 import org.apache.poi.hslf.usermodel.HSLFSlideShow;
 
 /**
  * Demonstrates how to set headers / footers
- *
- * @author Yegor Kozlov
  */
-public class HeadersFootersDemo {
-    public static void main(String[] args) throws Exception {
+public abstract class HeadersFootersDemo {
+    public static void main(String[] args) throws IOException {
         HSLFSlideShow ppt = new HSLFSlideShow();
         
         HeadersFooters slideHeaders = ppt.getSlideHeadersFooters();
@@ -40,7 +38,7 @@ public class HeadersFootersDemo {
         notesHeaders.setFootersText("My notes footers");
         notesHeaders.setHeaderText("My notes header");
 
-        HSLFSlide slide = ppt.createSlide();
+        ppt.createSlide();
 
         FileOutputStream out = new FileOutputStream("headers_footers.ppt");
         ppt.write(out);

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java Mon Sep 28 21:26:06 2015
@@ -158,7 +158,7 @@ public class BigExample {
 
         // demonstrate adding/naming and deleting a sheet
         // create a sheet, set its title then delete it
-        s = wb.createSheet();
+        wb.createSheet();
         wb.setSheetName(1, "DeletedSheet");
         wb.removeSheetAt(1);
         //end deleted sheet
@@ -167,5 +167,6 @@ public class BigExample {
         // close our file (don't blow out our file handles
         wb.write(out);
         out.close();
+        wb.close();
     }
 }

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java Mon Sep 28 21:26:06 2015
@@ -38,9 +38,6 @@ import org.apache.poi.ss.util.CellRangeA
  * THIS IS NOT THE MAIN HSSF FILE!! This is a utility for testing functionality.
  * It does contain sample API usage that may be educational to regular API
  * users.
- *
- * @see #main
- * @author Andrew Oliver (acoliver at apache dot org)
  */
 public final class HSSFReadWrite {
 
@@ -48,7 +45,12 @@ public final class HSSFReadWrite {
 	 * creates an {@link HSSFWorkbook} the specified OS filename.
 	 */
 	private static HSSFWorkbook readFile(String filename) throws IOException {
-		return new HSSFWorkbook(new FileInputStream(filename));
+	    FileInputStream fis = new FileInputStream(filename);
+	    try {
+	        return new HSSFWorkbook(fis);
+	    } finally {
+	        fis.close();
+	    }
 	}
 
 	/**
@@ -115,7 +117,7 @@ public final class HSSFReadWrite {
 
 		// end draw thick black border
 		// create a sheet, set its title then delete it
-		s = wb.createSheet();
+		wb.createSheet();
 		wb.setSheetName(1, "DeletedSheet");
 		wb.removeSheetAt(1);
 
@@ -123,6 +125,8 @@ public final class HSSFReadWrite {
 		FileOutputStream out = new FileOutputStream(outputFilename);
 		wb.write(out);
 		out.close();
+		
+		wb.close();
 	}
 
 	/**
@@ -198,6 +202,7 @@ public final class HSSFReadWrite {
 						}
 					}
 				}
+				wb.close();
 			} else if (args.length == 2) {
 				if (args[1].toLowerCase(Locale.ROOT).equals("write")) {
 					System.out.println("Write mode");
@@ -213,6 +218,7 @@ public final class HSSFReadWrite {
 
 					wb.write(stream);
 					stream.close();
+					wb.close();
 				}
 			} else if (args.length == 3 && args[2].toLowerCase(Locale.ROOT).equals("modify1")) {
 				// delete row 0-24, row 74 - 99 && change cell 3 on row 39 to string "MODIFIED CELL!!"
@@ -237,6 +243,7 @@ public final class HSSFReadWrite {
 
 				wb.write(stream);
 				stream.close();
+				wb.close();
 			}
 		} catch (Exception e) {
 			e.printStackTrace();

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/NewSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/NewSheet.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/NewSheet.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/NewSheet.java Mon Sep 28 21:26:06 2015
@@ -17,27 +17,27 @@
 
 package org.apache.poi.hssf.usermodel.examples;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.ss.util.WorkbookUtil;
 
-import java.io.IOException;
-import java.io.FileOutputStream;
-
 /**
  * Creates a new workbook with a sheet that's been explicitly defined.
- *
- * @author Glen Stampoultzis (glens at apache.org)
  */
-public class NewSheet {
+public abstract class NewSheet {
     public static void main(String[] args) throws IOException {
         HSSFWorkbook wb = new HSSFWorkbook();
-        HSSFSheet sheet1 = wb.createSheet("new sheet");
-        HSSFSheet sheet2 = wb.createSheet(); // create with default name
+        wb.createSheet("new sheet");
+        // create with default name
+        wb.createSheet();
         final String name = "second sheet";
-        wb.setSheetName(1, WorkbookUtil.createSafeSheetName(name)); // setting sheet name later
+        // setting sheet name later
+        wb.setSheetName(1, WorkbookUtil.createSafeSheetName(name));
         FileOutputStream fileOut = new FileOutputStream("workbook.xls");
         wb.write(fileOut);
         fileOut.close();
+        wb.close();
     }
 }

Modified: poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/DataExtraction.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/DataExtraction.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/DataExtraction.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/DataExtraction.java Mon Sep 28 21:26:06 2015
@@ -21,35 +21,37 @@ package org.apache.poi.xslf.usermodel;
 
 import java.awt.Dimension;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
-import java.util.List;
+import java.io.PrintStream;
 
+import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
 import org.apache.poi.openxml4j.opc.PackagePart;
 
 /**
  * Demonstrates how you can extract data from a .pptx file
- *
- * @author Yegor Kozlov
  */
 public final class DataExtraction {
 
-    @SuppressWarnings("unused")
-    public static void main(String args[]) throws Exception {
+    public static void main(String args[]) throws IOException, OpenXML4JException {
+
+        PrintStream out = System.out;
 
         if (args.length == 0) {
-           System.out.println("Input file is required");
+           out.println("Input file is required");
            return;
         }
-
+        
         FileInputStream is = new FileInputStream(args[0]);
         XMLSlideShow ppt = new XMLSlideShow(is);
         is.close();
 
         // Get the document's embedded files.
-        List<PackagePart> embeds = ppt.getAllEmbedds();
-        for (PackagePart p : embeds) {
+        for (PackagePart p : ppt.getAllEmbedds()) {
             String type = p.getContentType();
-            String name = p.getPartName().getName();  //typically file name
+            // typically file name
+            String name = p.getPartName().getName();  
+            out.println("Embedded file ("+type+"): "+name);
             
             InputStream pIs = p.getInputStream();
             // make sense of the part data
@@ -58,33 +60,31 @@ public final class DataExtraction {
         }
 
         // Get the document's embedded files.
-        List<XSLFPictureData> images = ppt.getPictureData();
-        for (XSLFPictureData data : images) {
-            PackagePart p = data.getPackagePart();
-
-            String type = p.getContentType();
+        for (XSLFPictureData data : ppt.getPictureData()) {
+            String type = data.getContentType();
             String name = data.getFileName();
+            out.println("Picture ("+type+"): "+name);
 
-            InputStream pIs = p.getInputStream();
+            InputStream pIs = data.getInputStream();
             // make sense of the image data
             pIs.close();
-
-
-
         }
 
-        Dimension pageSize = ppt.getPageSize();  // size of the canvas in points
+        // size of the canvas in points
+        Dimension pageSize = ppt.getPageSize();
+        out.println("Pagesize: "+pageSize);
+        
         for(XSLFSlide slide : ppt.getSlides()) {
             for(XSLFShape shape : slide){
                 if(shape instanceof XSLFTextShape) {
                     XSLFTextShape txShape = (XSLFTextShape)shape;
-                    System.out.println(txShape.getText());
+                    out.println(txShape.getText());
                 } else if (shape instanceof XSLFPictureShape){
                     XSLFPictureShape pShape = (XSLFPictureShape)shape;
                     XSLFPictureData pData = pShape.getPictureData();
-                    System.out.println(pData.getFileName());
+                    out.println(pData.getFileName());
                 } else {
-                    System.out.println("Process me: " + shape.getClass());
+                    out.println("Process me: " + shape.getClass());
                 }
             }
         }

Modified: poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java Mon Sep 28 21:26:06 2015
@@ -170,32 +170,30 @@ public class XLSX2CSV {
                 this.formatString = null;
                 String cellType = attributes.getValue("t");
                 String cellStyleStr = attributes.getValue("s");
-                if ("b".equals(cellType))
+                if ("b".equals(cellType)) {
                     nextDataType = xssfDataType.BOOL;
-                else if ("e".equals(cellType))
+                } else if ("e".equals(cellType)) {
                     nextDataType = xssfDataType.ERROR;
-                else if ("inlineStr".equals(cellType))
+                } else if ("inlineStr".equals(cellType)) {
                     nextDataType = xssfDataType.INLINESTR;
-                else if ("s".equals(cellType))
+                } else if ("s".equals(cellType)) {
                     nextDataType = xssfDataType.SSTINDEX;
-                else if ("str".equals(cellType))
+                } else if ("str".equals(cellType)) {
                     nextDataType = xssfDataType.FORMULA;
-                else if (cellStyleStr != null) {
+                } else if (cellStyleStr != null) {
                     // It's a number, but almost certainly one
                     //  with a special style or format 
-                    XSSFCellStyle style = null;
-                    if (cellStyleStr != null) {
-                        int styleIndex = Integer.parseInt(cellStyleStr);
-                        style = stylesTable.getStyleAt(styleIndex);
-                    }
+                    int styleIndex = Integer.parseInt(cellStyleStr);
+                    XSSFCellStyle style = stylesTable.getStyleAt(styleIndex);
                     if (style == null && stylesTable.getNumCellStyles() > 0) {
                         style = stylesTable.getStyleAt(0);
                     }
                     if (style != null) {
                         this.formatIndex = style.getDataFormat();
                         this.formatString = style.getDataFormatString();
-                        if (this.formatString == null)
+                        if (this.formatString == null) {
                             this.formatString = BuiltinFormats.getBuiltinFormat(this.formatIndex);
+                        }
                     }
                 }
             }

Modified: poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateUserDefinedDataFormats.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateUserDefinedDataFormats.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateUserDefinedDataFormats.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateUserDefinedDataFormats.java Mon Sep 28 21:26:06 2015
@@ -18,6 +18,7 @@
 package org.apache.poi.xssf.usermodel.examples;
 
 import java.io.FileOutputStream;
+import java.io.IOException;
 
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellStyle;
@@ -33,7 +34,7 @@ import org.apache.poi.xssf.usermodel.XSS
 public class CreateUserDefinedDataFormats {
 
 
-    public static void main(String[]args) throws Exception {
+    public static void main(String[]args) throws IOException {
         Workbook wb = new XSSFWorkbook();  //or new HSSFWorkbook();
         Sheet sheet = wb.createSheet("format sheet");
         CellStyle style;
@@ -43,14 +44,14 @@ public class CreateUserDefinedDataFormat
         short rowNum = 0;
         short colNum = 0;
 
-        row = sheet.createRow(rowNum++);
+        row = sheet.createRow(rowNum);
         cell = row.createCell(colNum);
         cell.setCellValue(11111.25);
         style = wb.createCellStyle();
         style.setDataFormat(format.getFormat("0.0"));
         cell.setCellStyle(style);
 
-        row = sheet.createRow(rowNum++);
+        row = sheet.createRow(++rowNum);
         cell = row.createCell(colNum);
         cell.setCellValue(11111.25);
         style = wb.createCellStyle();
@@ -60,6 +61,8 @@ public class CreateUserDefinedDataFormat
         FileOutputStream fileOut = new FileOutputStream("ooxml_dataFormat.xlsx");
         wb.write(fileOut);
         fileOut.close();
+        
+        wb.close();
     }
 
 }

Modified: poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/SelectedSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/SelectedSheet.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/SelectedSheet.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/SelectedSheet.java Mon Sep 28 21:26:06 2015
@@ -17,18 +17,19 @@
 package org.apache.poi.xssf.usermodel.examples;
 
 import java.io.FileOutputStream;
+import java.io.IOException;
 
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
-public class SelectedSheet {
-
-    public static void main(String[]args) throws Exception {
+public abstract class SelectedSheet {
+    
+    public static void main(String[]args) throws IOException {
         Workbook wb = new XSSFWorkbook(); //or new HSSFWorkbook();
 
-        Sheet sheet = wb.createSheet("row sheet");
-        Sheet sheet2 = wb.createSheet("another sheet");
+        wb.createSheet("row sheet");
+        wb.createSheet("another sheet");
         Sheet sheet3 = wb.createSheet(" sheet 3 ");
         sheet3.setSelected(true);
         wb.setActiveSheet(2);
@@ -38,6 +39,8 @@ public class SelectedSheet {
         FileOutputStream fileOut = new FileOutputStream("selectedSheet.xlsx");
         wb.write(fileOut);
         fileOut.close();
+        
+        wb.close();
     }
 
 }

Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/HDGFFileHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/HDGFFileHandler.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/HDGFFileHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/HDGFFileHandler.java Mon Sep 28 21:26:06 2015
@@ -33,7 +33,8 @@ import org.junit.Test;
 public class HDGFFileHandler extends POIFSFileHandler {
 	@Override
 	public void handleFile(InputStream stream) throws Exception {
-		HDGFDiagram diagram = new HDGFDiagram(new POIFSFileSystem(stream));
+	    POIFSFileSystem poifs = new POIFSFileSystem(stream);
+		HDGFDiagram diagram = new HDGFDiagram(poifs);
 		Stream[] topLevelStreams = diagram.getTopLevelStreams();
 		assertNotNull(topLevelStreams);
 		for(Stream str : topLevelStreams) {
@@ -44,6 +45,8 @@ public class HDGFFileHandler extends POI
 		assertNotNull(trailerStream);
 		assertTrue(trailerStream.getPointer().getLength() >= 0);
 		
+		poifs.close();
+		
 		// writing is not yet implemented... handlePOIDocument(diagram);
 	}
 	

Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/HWPFFileHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/HWPFFileHandler.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/HWPFFileHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/HWPFFileHandler.java Mon Sep 28 21:26:06 2015
@@ -18,21 +18,14 @@ package org.apache.poi.stress;
 
 import static org.junit.Assert.assertNotNull;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.IOException;
 import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 
-import org.apache.poi.hdf.extractor.WordDocument;
 import org.apache.poi.hwpf.HWPFDocument;
 import org.apache.poi.hwpf.extractor.WordExtractor;
 import org.junit.Test;
 
-@SuppressWarnings("deprecation")
 public class HWPFFileHandler extends POIFSFileHandler {
 	@Override
 	public void handleFile(InputStream stream) throws Exception {
@@ -42,25 +35,6 @@ public class HWPFFileHandler extends POI
 		assertNotNull(doc.getEndnotes());
 		
 		handlePOIDocument(doc);
-		
-		// fails for many documents, but is deprecated anyway... 
-		// handleWordDocument(doc);
-	}
-
-	protected void handleWordDocument(HWPFDocument doc) throws IOException {
-		ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-		doc.write(outStream);
-
-		WordDocument wordDoc = new WordDocument(new ByteArrayInputStream(outStream.toByteArray()));
-        
-        StringWriter docTextWriter = new StringWriter();
-        PrintWriter out = new PrintWriter(docTextWriter);
-        try {
-        	wordDoc.writeAllText(out);
-        } finally {
-        	out.close();
-        }
-        docTextWriter.close();
 	}
 
 	// a test-case to test this locally without executing the full TestAllFiles

Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/POIFSFileHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/POIFSFileHandler.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/POIFSFileHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/POIFSFileHandler.java Mon Sep 28 21:26:06 2015
@@ -31,6 +31,7 @@ public class POIFSFileHandler extends Ab
     public void handleFile(InputStream stream) throws Exception {
 		POIFSFileSystem fs = new POIFSFileSystem(stream);
 		handlePOIFSFileSystem(fs);
+		fs.close();
 	}
 
 	private void handlePOIFSFileSystem(POIFSFileSystem fs) {
@@ -45,5 +46,6 @@ public class POIFSFileHandler extends Ab
 		ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
 		POIFSFileSystem fs = new POIFSFileSystem(in);
 		handlePOIFSFileSystem(fs);
+		fs.close();
 	}
 }

Modified: poi/trunk/src/java/org/apache/poi/hpsf/IndirectPropertyName.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/IndirectPropertyName.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/IndirectPropertyName.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/IndirectPropertyName.java Mon Sep 28 21:26:06 2015
@@ -23,7 +23,7 @@ class IndirectPropertyName
 {
     private CodePageString _value;
 
-    IndirectPropertyName( byte[] data, int offset )
+    IndirectPropertyName( byte[] data, int offset ) //NOSONAR
     {
         _value = new CodePageString( data, offset );
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/SSTRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/SSTRecord.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/SSTRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/SSTRecord.java Mon Sep 28 21:26:06 2015
@@ -296,15 +296,17 @@ public final class SSTRecord extends Con
      * @return  The new SST record.
      */
     public ExtSSTRecord createExtSSTRecord(int sstOffset) {
-        if (bucketAbsoluteOffsets == null || bucketAbsoluteOffsets == null)
+        if (bucketAbsoluteOffsets == null || bucketRelativeOffsets == null) {
             throw new IllegalStateException("SST record has not yet been serialized.");
+        }
 
         ExtSSTRecord extSST = new ExtSSTRecord();
         extSST.setNumStringsPerBucket((short)8);
         int[] absoluteOffsets = bucketAbsoluteOffsets.clone();
         int[] relativeOffsets = bucketRelativeOffsets.clone();
-        for ( int i = 0; i < absoluteOffsets.length; i++ )
+        for ( int i = 0; i < absoluteOffsets.length; i++ ) {
             absoluteOffsets[i] += sstOffset;
+        }
         extSST.setBucketOffsets(absoluteOffsets, relativeOffsets);
         return extSST;
     }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java Mon Sep 28 21:26:06 2015
@@ -244,10 +244,12 @@ public abstract class OPCPackage impleme
     */
    public static OPCPackage open(File file, PackageAccess access)
          throws InvalidFormatException {
-      if (file == null)
-			throw new IllegalArgumentException("'file' must be given");
-      if (file == null || (file.exists() && file.isDirectory()))
-			throw new IllegalArgumentException("file must not be a directory");
+      if (file == null) {
+          throw new IllegalArgumentException("'file' must be given");
+      }
+      if (file.exists() && file.isDirectory()) {
+          throw new IllegalArgumentException("file must not be a directory");
+      }
 
       OPCPackage pack = new ZipPackage(file, access);
       if (pack.partList == null && access != PackageAccess.WRITE) {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java Mon Sep 28 21:26:06 2015
@@ -54,7 +54,7 @@ public final class XSLFPictureData exten
     private Long checksum = null;
 
     // original image dimensions (for formats supported by BufferedImage)
-    private Dimension _origSize = null;
+    private Dimension origSize = null;
     private int index = -1;
 
     /**
@@ -107,8 +107,9 @@ public final class XSLFPictureData exten
      */
     public String getFileName() {
         String name = getPackagePart().getPartName().getName();
-        if (name == null)
+        if (name == null) {
             return null;
+        }
         return name.substring(name.lastIndexOf('/') + 1);
     }
 
@@ -132,7 +133,7 @@ public final class XSLFPictureData exten
     @Override
     public Dimension getImageDimension() {
         cacheProperties();
-        return _origSize;
+        return origSize;
     }
 
     @Override
@@ -148,21 +149,21 @@ public final class XSLFPictureData exten
      * Determine and cache image properties
      */
     protected void cacheProperties() {
-        if (_origSize == null || checksum == null) {
+        if (origSize == null || checksum == null) {
             byte data[] = getData();
             checksum = IOUtils.calculateChecksum(data);
             
             switch (getType()) {
             case EMF:
-                _origSize = new EMF.NativeHeader(data, 0).getSize();
+                origSize = new EMF.NativeHeader(data, 0).getSize();
                 break;
             case WMF:
                 // wmf files in pptx usually have their placeable header 
                 // stripped away, so this returns only the dummy size
-                _origSize = new WMF.NativeHeader(data, 0).getSize();
+                origSize = new WMF.NativeHeader(data, 0).getSize();
                 break;
             case PICT:
-                _origSize = new PICT.NativeHeader(data, 0).getSize();
+                origSize = new PICT.NativeHeader(data, 0).getSize();
                 break;
             default:
                 BufferedImage img = null;
@@ -172,7 +173,7 @@ public final class XSLFPictureData exten
                     logger.log(POILogger.WARN, "Can't determine image dimensions", e);
                 }
                 // set dummy size, in case of dummy dimension can't be set
-                _origSize = (img == null)
+                origSize = (img == null)
                     ? new Dimension(200,200)
                     : new Dimension(
                         (int)Units.pixelToPoints(img.getWidth()),
@@ -204,7 +205,7 @@ public final class XSLFPictureData exten
         // recalculate now since we already have the data bytes available anyhow
         checksum = IOUtils.calculateChecksum(data);
 
-        _origSize = null; // need to recalculate image size
+        origSize = null; // need to recalculate image size
     }
 
     @Override

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java Mon Sep 28 21:26:06 2015
@@ -112,8 +112,9 @@ public class XWPFPictureData extends POI
      */
     public String getFileName() {
         String name = getPackagePart().getPartName().getName();
-        if (name == null)
+        if (name == null) {
             return null;
+        }
         return name.substring(name.lastIndexOf('/') + 1);
     }
 

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java Mon Sep 28 21:26:06 2015
@@ -23,7 +23,6 @@ import org.apache.poi.hdgf.chunks.ChunkF
 import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
-import org.apache.poi.util.StringUtil;
 
 /**
  * Base of all chunks, which hold data, flags etc
@@ -55,7 +54,7 @@ public final class Chunk {
 		this.header = header;
 		this.trailer = trailer;
 		this.separator = separator;
-		this.contents = contents;
+		this.contents = contents.clone();
 	}
 
 	public byte[] _getContents() {
@@ -116,14 +115,14 @@ public final class Chunk {
 
 		// Loop over the definitions, building the commands
 		//  and getting their values
-		ArrayList<Command> commands = new ArrayList<Command>();
-		for(int i=0; i<commandDefinitions.length; i++) {
-			int type = commandDefinitions[i].getType();
-			int offset = commandDefinitions[i].getOffset();
+		ArrayList<Command> commandList = new ArrayList<Command>();
+		for(CommandDefinition cdef : commandDefinitions) {
+			int type = cdef.getType();
+			int offset = cdef.getOffset();
 
 			// Handle virtual commands
 			if(type == 10) {
-				name = commandDefinitions[i].getName();
+				name = cdef.getName();
 				continue;
 			} else if(type == 18) {
 				continue;
@@ -133,9 +132,9 @@ public final class Chunk {
 			// Build the appropriate command for the type
 			Command command;
 			if(type == 11 || type == 21) {
-				command = new BlockOffsetCommand(commandDefinitions[i]);
+				command = new BlockOffsetCommand(cdef);
 			} else {
-				command = new Command(commandDefinitions[i]);
+				command = new Command(cdef);
 			}
 
 			// Bizarely, many of the offsets are from the start of the
@@ -234,12 +233,12 @@ public final class Chunk {
 			}
 
 			// Add to the array
-			commands.add(command);
+			commandList.add(command);
 		}
 
 		// Save the commands we liked the look of
-		this.commands = commands.toArray(
-							new Command[commands.size()] );
+		this.commands = commandList.toArray(
+							new Command[commandList.size()] );
 
 		// Now build up the blocks, if we had a command that tells
 		//  us where a block is
@@ -280,13 +279,11 @@ public final class Chunk {
 	 * A special kind of command that holds the offset to
 	 *  a block
 	 */
-	public static class BlockOffsetCommand extends Command {
-		private int offset;
+	private static class BlockOffsetCommand extends Command {
 		private BlockOffsetCommand(CommandDefinition definition) {
 			super(definition, null);
 		}
 		private void setOffset(int offset) {
-			this.offset = offset;
 			value = Integer.valueOf(offset);
 		}
 	}

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java Mon Sep 28 21:26:06 2015
@@ -49,7 +49,7 @@ public class MAPIAttribute {
    public MAPIAttribute(MAPIProperty property, int type, byte[] data) {
       this.property = property;
       this.type = type;
-      this.data = data;
+      this.data = data.clone();
    }
 
    public MAPIProperty getProperty() {

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCBit.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCBit.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCBit.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCBit.java Mon Sep 28 21:26:06 2015
@@ -34,7 +34,7 @@ public abstract class QCBit {
 	public QCBit(String thingType, String bitType, byte[] data) {
 		this.thingType = thingType;
 		this.bitType = bitType;
-		this.data = data;
+		this.data = data.clone();
 	}
 
 	/**

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java Mon Sep 28 21:26:06 2015
@@ -19,18 +19,18 @@ package org.apache.poi.hslf.dev;
 
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
+import java.io.PrintStream;
 import java.util.Locale;
 
 import org.apache.poi.ddf.DefaultEscherRecordFactory;
 import org.apache.poi.ddf.EscherContainerRecord;
 import org.apache.poi.ddf.EscherRecord;
 import org.apache.poi.ddf.EscherTextboxRecord;
+import org.apache.poi.hslf.record.HSLFEscherRecordFactory;
 import org.apache.poi.hslf.record.RecordTypes;
 import org.apache.poi.poifs.filesystem.DocumentEntry;
 import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
-import org.apache.poi.hslf.record.HSLFEscherRecordFactory;
-import org.apache.poi.hslf.record.RecordTypes;
+import org.apache.poi.util.HexDump;
 import org.apache.poi.util.LittleEndian;
 
 /**
@@ -46,14 +46,14 @@ import org.apache.poi.util.LittleEndian;
  *  from hslf.record.RecordTypes also)
  */
 public final class SlideShowDumper {
-  private NPOIFSFileSystem filesystem;
-
-  private byte[] _docstream;
+  private byte[] docstream;
 
   /** Do we try to use DDF to understand the escher objects? */
   private boolean ddfEscher = false;
   /** Do we use our own built-in basic escher groker to understand the escher objects? */
   private boolean basicEscher = false;
+  
+  private PrintStream out;
 
   /**
    *  right now this function takes one parameter: a ppt file, and outputs
@@ -71,7 +71,9 @@ public final class SlideShowDumper {
 		filename = args[1];
 	}
 
-	SlideShowDumper foo = new SlideShowDumper(filename);
+	NPOIFSFileSystem poifs = new NPOIFSFileSystem(new File(filename));
+	SlideShowDumper foo = new SlideShowDumper(poifs, System.out);
+    poifs.close();
 
 	if(args.length > 1) {
 		if(args[0].equalsIgnoreCase("-escher")) {
@@ -82,33 +84,6 @@ public final class SlideShowDumper {
 	}
 
 	foo.printDump();
-	foo.close();
-  }
-
-
-  /**
-   * Constructs a Powerpoint dump from fileName. Parses the document
-   * and dumps out the contents
-   *
-   * @param fileName The name of the file to read.
-   * @throws IOException if there is a problem while parsing the document.
-   */
-  public SlideShowDumper(String fileName) throws IOException
-  {
-  	this(new NPOIFSFileSystem(new File(fileName)));
-  }
-
-  /**
-   * Constructs a Powerpoint dump from an input stream. Parses the
-   * document and dumps out the contents
-   *
-   * @param inputStream the source of the data
-   * @throws IOException if there is a problem while parsing the document.
-   */
-  public SlideShowDumper(InputStream inputStream) throws IOException
-  {
-	//do Ole stuff
-	this(new NPOIFSFileSystem(inputStream));
   }
 
   /**
@@ -118,17 +93,15 @@ public final class SlideShowDumper {
    * @param filesystem the POIFS FileSystem to read from
    * @throws IOException if there is a problem while parsing the document.
    */
-  public SlideShowDumper(NPOIFSFileSystem filesystem) throws IOException
-  {
-	this.filesystem = filesystem;
-
+  public SlideShowDumper(NPOIFSFileSystem filesystem, PrintStream out) throws IOException {
 	// Get the main document stream
 	DocumentEntry docProps =
 		(DocumentEntry)filesystem.getRoot().getEntry("PowerPoint Document");
 
 	// Grab the document stream
-	_docstream = new byte[docProps.getSize()];
-	filesystem.createDocumentInputStream("PowerPoint Document").read(_docstream);
+	docstream = new byte[docProps.getSize()];
+	filesystem.createDocumentInputStream("PowerPoint Document").read(docstream);
+	this.out = out;
   }
 
   /**
@@ -148,18 +121,7 @@ public final class SlideShowDumper {
 	ddfEscher = !(grok);
   }
 
-  /**
-   * Shuts things down. Closes underlying streams etc
-   *
-   * @throws IOException
-   */
-  public void close() throws IOException
-  {
-	filesystem.close();
-  }
-
-
-  public void printDump() {
+  public void printDump() throws IOException {
 	// The format of records in a powerpoint file are:
 	//   <little endian 2 byte "info">
 	//   <little endian 2 byte "type">
@@ -189,75 +151,53 @@ public final class SlideShowDumper {
 	//  0x0f (15) and get back 0x0f, you know it has children. Otherwise
 	//  it doesn't
 
-	walkTree(0,0,_docstream.length);
-}
-
-public String makeHex(short s) {
-	String hex = Integer.toHexString(s).toUpperCase(Locale.ROOT);
-	if(hex.length() == 1) { return "0" + hex; }
-	return hex;
-}
-public String makeHex(int i) {
-	String hex = Integer.toHexString(i).toUpperCase(Locale.ROOT);
-	if(hex.length() == 1) { return "000" + hex; }
-	if(hex.length() == 2) { return "00" + hex; }
-	if(hex.length() == 3) { return "0" + hex; }
-	return hex;
+	walkTree(0,0,docstream.length);
 }
 
-public void walkTree(int depth, int startPos, int maxLen) {
+public void walkTree(int depth, int startPos, int maxLen) throws IOException {
 	int pos = startPos;
 	int endPos = startPos + maxLen;
-	int indent = depth;
+	final String ind = (depth == 0) ? "%1$s" : "%1$"+depth+"s";
 	while(pos <= endPos - 8) {
-		long type = LittleEndian.getUShort(_docstream,pos+2);
-		long len = LittleEndian.getUInt(_docstream,pos+4);
-		byte opt = _docstream[pos];
-
-		String ind = "";
-		for(int i=0; i<indent; i++) { ind += " "; }
+		long type = LittleEndian.getUShort(docstream,pos+2);
+		long len = LittleEndian.getUInt(docstream,pos+4);
+		byte opt = docstream[pos];
 
-		System.out.println(ind + "At position " + pos + " (" + makeHex(pos) + "):");
-		System.out.println(ind + "Type is " + type + " (" + makeHex((int)type) + "), len is " + len + " (" + makeHex((int)len) + ")");
+		String fmt = ind+"At position %2$d (%2$04x): type is %3$d (%3$04x), len is %4$d (%4$04x)";
+		out.println(String.format(Locale.ROOT, fmt, "", pos, type, len));
 
 		// See if we know about the type of it
 		String recordName = RecordTypes.recordName((int)type);
 
 		// Jump over header, and think about going on more
 		pos += 8;
-		if(recordName != null) {
-			System.out.println(ind + "That's a " + recordName);
+		out.println(String.format(Locale.ROOT, ind+"That's a %2$s", "", recordName));
 
-			// Now check if it's a container or not
-			int container = opt & 0x0f;
+		// Now check if it's a container or not
+		int container = opt & 0x0f;
 
-			// BinaryTagData seems to contain records, but it
-			//  isn't tagged as doing so. Try stepping in anyway
-			if(type == 5003L && opt == 0L) {
-				container = 0x0f;
-			}
-
-			if(type == 0L || (container != 0x0f)) {
-				System.out.println();
-			} else if (type == 1035l || type == 1036l) {
-				// Special Handling of 1035=PPDrawingGroup and 1036=PPDrawing
-				System.out.println();
-
-				if(ddfEscher) {
-					// Seems to be:
-					walkEscherDDF((indent+3),pos+8,(int)len-8);
-				} else if(basicEscher) {
-					walkEscherBasic((indent+3),pos+8,(int)len-8);
-				}
-			} else {
-				// General container record handling code
-				System.out.println();
-				walkTree((indent+2),pos,(int)len);
-			}
-		} else {
-			System.out.println(ind + "** unknown record **");
-			System.out.println();
+		// BinaryTagData seems to contain records, but it
+		//  isn't tagged as doing so. Try stepping in anyway
+		if(type == 5003L && opt == 0L) {
+			container = 0x0f;
+		}
+
+        out.println();
+		if (type != 0L && container == 0x0f) {
+		    if (type == 1035l || type == 1036l) {
+    			// Special Handling of 1035=PPDrawingGroup and 1036=PPDrawing
+    			if(ddfEscher) {
+    				// Seems to be:
+    				walkEscherDDF((depth+3),pos+8,(int)len-8);
+    			} else if(basicEscher) {
+    				walkEscherBasic((depth+3),pos+8,(int)len-8);
+    			}
+    		} else {
+    			// General container record handling code
+    			walkTree((depth+2),pos,(int)len);
+    		}
 		}
+
 		pos += (int)len;
 	}
   }
@@ -268,11 +208,10 @@ public void walkTree(int depth, int star
   public void walkEscherDDF(int indent, int pos, int len) {
 	if(len < 8) { return; }
 
-	String ind = "";
-	for(int i=0; i<indent; i++) { ind += " "; }
+	final String ind = (indent == 0) ? "%1$s" : "%1$"+indent+"s";
 
 	byte[] contents = new byte[len];
-	System.arraycopy(_docstream,pos,contents,0,len);
+	System.arraycopy(docstream,pos,contents,0,len);
 	DefaultEscherRecordFactory erf = new HSLFEscherRecordFactory();
 	EscherRecord record = erf.createRecord(contents,0);
 
@@ -285,22 +224,21 @@ public void walkTree(int depth, int star
 	// This (should) include the 8 byte header size
 	int recordLen = record.getRecordSize();
 
-
-	System.out.println(ind + "At position " + pos + " (" + makeHex(pos) + "):");
-	System.out.println(ind + "Type is " + atomType + " (" + makeHex((int)atomType) + "), len is " + atomLen + " (" + makeHex((int)atomLen) + ") (" + (atomLen+8) + ") - record claims " + recordLen);
-
+    String fmt = ind+"At position %2$d (%2$04x): type is %3$d (%3$04x), len is %4$d (%4$04x) (%5$d) - record claims %6$d";
+    out.println(String.format(Locale.ROOT, fmt, "", pos, atomType, atomLen, atomLen+8, recordLen));
+	
+	
 	// Check for corrupt / lying ones
 	if(recordLen != 8 && (recordLen != (atomLen+8))) {
-		System.out.println(ind + "** Atom length of " + atomLen + " (" + (atomLen+8) + ") doesn't match record length of " + recordLen);
+		out.println(String.format(Locale.ROOT, ind+"** Atom length of $2d ($3d) doesn't match record length of %4d", "", atomLen, atomLen+8, recordLen));
 	}
 
 	// Print the record's details
-	if(record instanceof EscherContainerRecord) {
-		EscherContainerRecord ecr = (EscherContainerRecord)record;
-		System.out.println(ind + ecr.toString());
+    String recordStr = record.toString().replace("\n", String.format(Locale.ROOT,  "\n"+ind, ""));
+    out.println(String.format(Locale.ROOT, ind+"%2$s", "", recordStr));
+
+    if(record instanceof EscherContainerRecord) {
 		walkEscherDDF((indent+3), pos + 8, (int)atomLen );
-	} else {
-		System.out.println(ind + record.toString());
 	}
 
 	// Handle records that seem to lie
@@ -313,7 +251,7 @@ public void walkTree(int depth, int star
 		recordLen = (int)atomLen + 8;
 		record.fillFields( contents, 0, erf );
 		if(! (record instanceof EscherTextboxRecord)) {
-			System.out.println(ind + "** Really a msofbtClientTextbox !");
+			out.println(String.format(Locale.ROOT, ind+"%2$s", "", "** Really a msofbtClientTextbox !"));
 		}
 	}
 
@@ -344,58 +282,31 @@ public void walkTree(int depth, int star
   /**
    * Use the basic record format groking code to walk the Escher records
    */
-  public void walkEscherBasic(int indent, int pos, int len) {
+  public void walkEscherBasic(int indent, int pos, int len) throws IOException {
 	if(len < 8) { return; }
 
-	String ind = "";
-	for(int i=0; i<indent; i++) { ind += " "; }
+	final String ind = (indent == 0) ? "%1$s" : "%1$"+indent+"s";
 
-	long type = LittleEndian.getUShort(_docstream,pos+2);
-	long atomlen = LittleEndian.getUInt(_docstream,pos+4);
-	String typeS = makeHex((int)type);
+	long type = LittleEndian.getUShort(docstream,pos+2);
+	long atomlen = LittleEndian.getUInt(docstream,pos+4);
 
-	System.out.println(ind + "At position " + pos + " (" + makeHex(pos) + "):");
-	System.out.println(ind + "Type is " + type + " (" + typeS + "), len is " + atomlen + " (" + makeHex((int)atomlen) + ")");
+	String fmt = ind+"At position %2$d ($2$04x): type is %3$d (%3$04x), len is %4$d (%4$04x)";
+	out.println(String.format(Locale.ROOT, fmt, "", pos, type, atomlen));
 
 	String typeName = RecordTypes.recordName((int)type);
-	if(typeName != null) {
-		System.out.println(ind + "That's an Escher Record: " + typeName);
-	} else {
-		System.out.println(ind + "(Unknown Escher Record)");
-	}
-
-
-	// Code to print the first 8 bytes
-//	System.out.print(ind);
-//	for(int i=0; i<8; i++) {
-//		short bv = _docstream[i+pos];
-//		if(bv < 0) { bv += 256; }
-//		System.out.print(i + "=" + bv + " (" + makeHex(bv) + ")  ");
-//	}
-//	System.out.println("");
+	out.println(String.format(Locale.ROOT, ind+"%2$s", "That's an Escher Record: ", typeName));
 
 	// Record specific dumps
 	if(type == 61453l) {
 		// Text Box. Print out first 8 bytes of data, then 8 4 later
-		System.out.print(ind);
-		for(int i=8; i<16; i++) {
-			short bv = _docstream[i+pos];
-			if(bv < 0) { bv += 256; }
-			System.out.print(i + "=" + bv + " (" + makeHex(bv) + ")  ");
-		}
-		System.out.println("");
-		System.out.print(ind);
-		for(int i=20; i<28; i++) {
-			short bv = _docstream[i+pos];
-			if(bv < 0) { bv += 256; }
-			System.out.print(i + "=" + bv + " (" + makeHex(bv) + ")  ");
-		}
-		System.out.println("");
+	    HexDump.dump(docstream, 0, out, pos+8, 8);
+	    HexDump.dump(docstream, 0, out, pos+20, 8);
+		out.println();
 	}
 
 
 	// Blank line before next entry
-	System.out.println("");
+	out.println();
 
 	// Look in children if we are a container
 	if(type == 61443l || type == 61444l) {

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java Mon Sep 28 21:26:06 2015
@@ -233,14 +233,21 @@ public final class PowerPointExtractor e
                 }
             }
 
-            for (int i = 0; i < _slides.size(); i++) {
-				HSLFSlide slide = _slides.get(i);
-
-				// Slide header, if set
-				HeadersFooters hf = slide.getHeadersFooters();
-				if (hf != null && hf.isHeaderVisible() && hf.getHeaderText() != null) {
-					ret.append(hf.getHeaderText() + "\n");
-				}
+            for (HSLFSlide slide : _slides) {
+                String headerText = "";
+                String footerText = "";
+                HeadersFooters hf = slide.getHeadersFooters();
+                if (hf != null) {
+                    if (hf.isHeaderVisible()) {
+                        headerText = safeLine(hf.getHeaderText());
+                    }
+                    if (hf.isFooterVisible()) {
+                        footerText = safeLine(hf.getFooterText());
+                    }
+                }
+                
+                // Slide header, if set
+				ret.append(headerText);
 
 				// Slide text
                 textRunsToText(ret, slide.getTextParagraphs());
@@ -252,9 +259,7 @@ public final class PowerPointExtractor e
                     }
                 }
                 // Slide footer, if set
-				if (hf != null && hf.isFooterVisible() && hf.getFooterText() != null) {
-					ret.append(hf.getFooterText() + "\n");
-				}
+                ret.append(footerText);
 
 				// Comments, if requested and present
 				if (getCommentText) {
@@ -274,7 +279,18 @@ public final class PowerPointExtractor e
 			// master sheets in. Grab Slide list, then work from there,
 			// but ensure no duplicates
 			HashSet<Integer> seenNotes = new HashSet<Integer>();
+            String headerText = "";
+            String footerText = "";
 			HeadersFooters hf = _show.getNotesHeadersFooters();
+			if (hf != null) {
+			    if (hf.isHeaderVisible()) {
+			        headerText = safeLine(hf.getHeaderText());
+			    }
+			    if (hf.isFooterVisible()) {
+                    footerText = safeLine(hf.getFooterText());
+			    }
+			}
+			
 
 			for (int i = 0; i < _slides.size(); i++) {
 				HSLFNotes notes = _slides.get(i).getNotes();
@@ -288,22 +304,22 @@ public final class PowerPointExtractor e
 				seenNotes.add(id);
 
 				// Repeat the Notes header, if set
-				if (hf != null && hf.isHeaderVisible() && hf.getHeaderText() != null) {
-					ret.append(hf.getHeaderText() + "\n");
-				}
+			    ret.append(headerText);
 
 				// Notes text
                 textRunsToText(ret, notes.getTextParagraphs());
 
 				// Repeat the notes footer, if set
-				if (hf != null && hf.isFooterVisible() && hf.getFooterText() != null) {
-					ret.append(hf.getFooterText() + "\n");
-				}
+                ret.append(footerText);
 			}
 		}
 
 		return ret.toString();
 	}
+	
+	private static String safeLine(String text) {
+	    return (text == null) ? "" : (text+'\n');
+	}
 
     private void extractTableText(StringBuffer ret, HSLFTable table) {
         for (int row = 0; row < table.getNumberOfRows(); row++){

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java Mon Sep 28 21:26:06 2015
@@ -220,8 +220,7 @@ public final class RecordTypes {
      */
     public static String recordName(int type) {
         String name = typeToName.get(Integer.valueOf(type));
-        if (name == null) name = "Unknown" + type;
-        return name;
+        return (name == null) ? ("Unknown" + type) : name;
     }
 
     /**

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java Mon Sep 28 21:26:06 2015
@@ -189,13 +189,14 @@ public class ExcelToFoConverter extends
      * @return <tt>false</tt> if cell style by itself (without text, i.e.
      *         borders, fill, etc.) worth a mention, <tt>true</tt> otherwise
      */
-    protected boolean isEmptyStyle( CellStyle cellStyle )
-    {
-        return cellStyle.getFillPattern() == 0 //
-                && cellStyle.getBorderTop() == HSSFCellStyle.BORDER_NONE //
-                && cellStyle.getBorderRight() == HSSFCellStyle.BORDER_NONE //
-                && cellStyle.getBorderBottom() == HSSFCellStyle.BORDER_NONE //
-                && cellStyle.getBorderLeft() == HSSFCellStyle.BORDER_NONE; //
+    protected boolean isEmptyStyle( CellStyle cellStyle ) {
+        return cellStyle == null || (
+               cellStyle.getFillPattern() == 0
+            && cellStyle.getBorderTop() == HSSFCellStyle.BORDER_NONE
+            && cellStyle.getBorderRight() == HSSFCellStyle.BORDER_NONE
+            && cellStyle.getBorderBottom() == HSSFCellStyle.BORDER_NONE
+            && cellStyle.getBorderLeft() == HSSFCellStyle.BORDER_NONE
+        );
     }
 
     protected boolean processCell( HSSFWorkbook workbook, HSSFCell cell,
@@ -226,20 +227,17 @@ public class ExcelToFoConverter extends
                 }
                 break;
             case HSSFCell.CELL_TYPE_NUMERIC:
-                HSSFCellStyle style = cellStyle;
-                if ( style == null )
-                {
-                    value = String.valueOf( cell.getNumericCellValue() );
-                }
-                else
-                {
-                    value = ( _formatter.formatRawCellContents(
-                            cell.getNumericCellValue(), style.getDataFormat(),
-                            style.getDataFormatString() ) );
+                double nValue = cell.getNumericCellValue();
+                if ( cellStyle == null ) {
+                    value = Double.toString( nValue );
+                } else {
+                    short df = cellStyle.getDataFormat();
+                    String dfs = cellStyle.getDataFormatString();
+                    value = _formatter.formatRawCellContents(nValue, df, dfs );
                 }
                 break;
             case HSSFCell.CELL_TYPE_BOOLEAN:
-                value = String.valueOf( cell.getBooleanCellValue() );
+                value = Boolean.toString( cell.getBooleanCellValue() );
                 break;
             case HSSFCell.CELL_TYPE_ERROR:
                 value = ErrorEval.getText( cell.getErrorCellValue() );
@@ -260,7 +258,7 @@ public class ExcelToFoConverter extends
             value = _formatter.formatCellValue( cell );
             break;
         case HSSFCell.CELL_TYPE_BOOLEAN:
-            value = String.valueOf( cell.getBooleanCellValue() );
+            value = Boolean.toString( cell.getBooleanCellValue() );
             break;
         case HSSFCell.CELL_TYPE_ERROR:
             value = ErrorEval.getText( cell.getErrorCellValue() );
@@ -272,20 +270,16 @@ public class ExcelToFoConverter extends
         }
 
         final boolean noText = ExcelToHtmlUtils.isEmpty( value );
-        final boolean wrapInDivs = !noText && !cellStyle.getWrapText();
+        final boolean wrapInDivs = !noText && (cellStyle == null || !cellStyle.getWrapText());
 
         final boolean emptyStyle = isEmptyStyle( cellStyle );
-        if ( !emptyStyle )
-        {
-            if ( noText )
-            {
-                /*
-                 * if cell style is defined (like borders, etc.) but cell text
-                 * is empty, add "&nbsp;" to output, so browser won't collapse
-                 * and ignore cell
-                 */
-                value = "\u00A0";
-            }
+        if ( !emptyStyle && noText ) {
+            /*
+             * if cell style is defined (like borders, etc.) but cell text
+             * is empty, add "&nbsp;" to output, so browser won't collapse
+             * and ignore cell
+             */
+            value = "\u00A0";
         }
 
         if ( isOutputLeadingSpacesAsNonBreaking() && value.startsWith( " " ) )
@@ -293,13 +287,15 @@ public class ExcelToFoConverter extends
             StringBuilder builder = new StringBuilder();
             for ( int c = 0; c < value.length(); c++ )
             {
-                if ( value.charAt( c ) != ' ' )
+                if ( value.charAt( c ) != ' ' ) {
                     break;
+                }
                 builder.append( '\u00a0' );
             }
 
-            if ( value.length() != builder.length() )
+            if ( value.length() != builder.length() ) {
                 builder.append( value.substring( builder.length() ) );
+            }
 
             value = builder.toString();
         }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java Mon Sep 28 21:26:06 2015
@@ -155,25 +155,21 @@ public class ExcelToHtmlConverter extend
         style.append( "white-space:pre-wrap;" );
         ExcelToHtmlUtils.appendAlign( style, cellStyle.getAlignment() );
 
-        if ( cellStyle.getFillPattern() == 0 )
-        {
+        switch (cellStyle.getFillPattern()) {
             // no fill
-        }
-        else if ( cellStyle.getFillPattern() == 1 )
-        {
-            final HSSFColor foregroundColor = cellStyle
-                    .getFillForegroundColorColor();
-            if ( foregroundColor != null )
-                style.append( "background-color:"
-                        + ExcelToHtmlUtils.getColor( foregroundColor ) + ";" );
-        }
-        else
-        {
-            final HSSFColor backgroundColor = cellStyle
-                    .getFillBackgroundColorColor();
-            if ( backgroundColor != null )
-                style.append( "background-color:"
-                        + ExcelToHtmlUtils.getColor( backgroundColor ) + ";" );
+            case 0: break;
+            case 1:
+                final HSSFColor foregroundColor = cellStyle.getFillForegroundColorColor();
+                if ( foregroundColor == null ) break;
+                String fgCol = ExcelToHtmlUtils.getColor( foregroundColor );
+                style.append( "background-color:" + fgCol + ";" );
+                break;
+            default:
+                final HSSFColor backgroundColor = cellStyle.getFillBackgroundColorColor();
+                if ( backgroundColor == null ) break;
+                String bgCol = ExcelToHtmlUtils.getColor( backgroundColor );
+                style.append( "background-color:" + bgCol + ";" );
+                break;
         }
 
         buildStyle_border( workbook, style, "top", cellStyle.getBorderTop(),
@@ -194,8 +190,9 @@ public class ExcelToHtmlConverter extend
     private void buildStyle_border( HSSFWorkbook workbook, StringBuilder style,
             String type, short xlsBorder, short borderColor )
     {
-        if ( xlsBorder == HSSFCellStyle.BORDER_NONE )
+        if ( xlsBorder == HSSFCellStyle.BORDER_NONE ) {
             return;
+        }
 
         StringBuilder borderStyle = new StringBuilder();
         borderStyle.append( ExcelToHtmlUtils.getBorderWidth( xlsBorder ) );
@@ -315,16 +312,13 @@ public class ExcelToHtmlConverter extend
                 }
                 break;
             case HSSFCell.CELL_TYPE_NUMERIC:
-                HSSFCellStyle style = cellStyle;
-                if ( style == null )
-                {
-                    value = String.valueOf( cell.getNumericCellValue() );
-                }
-                else
-                {
-                    value = ( _formatter.formatRawCellContents(
-                            cell.getNumericCellValue(), style.getDataFormat(),
-                            style.getDataFormatString() ) );
+                double nValue = cell.getNumericCellValue();
+                if ( cellStyle == null ) {
+                    value = Double.toString(nValue);
+                } else {
+                    short df = cellStyle.getDataFormat();
+                    String dfs = cellStyle.getDataFormatString();
+                    value = _formatter.formatRawCellContents(nValue, df, dfs);
                 }
                 break;
             case HSSFCell.CELL_TYPE_BOOLEAN:
@@ -362,27 +356,22 @@ public class ExcelToHtmlConverter extend
 
         final boolean noText = ExcelToHtmlUtils.isEmpty( value );
         final boolean wrapInDivs = !noText && isUseDivsToSpan()
-                && !cellStyle.getWrapText();
+                && (cellStyle == null || !cellStyle.getWrapText());
 
-        final short cellStyleIndex = cellStyle.getIndex();
-        if ( cellStyleIndex != 0 )
+        if ( cellStyle != null && cellStyle.getIndex() != 0 )
         {
             @SuppressWarnings("resource")
             HSSFWorkbook workbook = cell.getRow().getSheet().getWorkbook();
             String mainCssClass = getStyleClassName( workbook, cellStyle );
             
-            if ( wrapInDivs )
-            {
+            if ( wrapInDivs ) {
                 tableCellElement.setAttribute( "class", mainCssClass + " "
                         + cssClassContainerCell );
-            }
-            else
-            {
+            } else {
                 tableCellElement.setAttribute( "class", mainCssClass );
             }
 
-            if ( noText )
-            {
+            if ( noText ) {
                 /*
                  * if cell style is defined (like borders, etc.) but cell text
                  * is empty, add "&nbsp;" to output, so browser won't collapse
@@ -429,8 +418,9 @@ public class ExcelToHtmlConverter extend
             innerDivStyle.append( "overflow:hidden;max-height:" );
             innerDivStyle.append( normalHeightPt );
             innerDivStyle.append( "pt;white-space:nowrap;" );
-            ExcelToHtmlUtils.appendAlign( innerDivStyle,
-                    cellStyle.getAlignment() );
+            if (cellStyle != null) {
+                ExcelToHtmlUtils.appendAlign( innerDivStyle, cellStyle.getAlignment() );
+            }
             htmlDocumentFacade.addStyleClass( outerDiv, cssClassPrefixDiv,
                     innerDivStyle.toString() );
 
@@ -443,7 +433,7 @@ public class ExcelToHtmlConverter extend
             tableCellElement.appendChild( text );
         }
 
-        return ExcelToHtmlUtils.isEmpty( value ) && cellStyleIndex == 0;
+        return ExcelToHtmlUtils.isEmpty( value ) && (cellStyle == null || cellStyle.getIndex() == 0);
     }
 
     protected void processColumnHeaders( HSSFSheet sheet, int maxSheetColumns,

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/DOPAbstractType.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/DOPAbstractType.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/DOPAbstractType.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/DOPAbstractType.java Mon Sep 28 21:26:06 2015
@@ -20,7 +20,6 @@ package org.apache.poi.hwpf.model.types;
 
 import java.util.Arrays;
 
-import org.apache.poi.hdf.model.hdftypes.HDFType;
 import org.apache.poi.util.BitField;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LittleEndian;
@@ -33,61 +32,61 @@ import org.apache.poi.util.LittleEndian;
  * @author S. Ryan Ackley
  */
 @Internal
-public abstract class DOPAbstractType implements HDFType {
+public abstract class DOPAbstractType {
 
     protected byte field_1_formatFlags;
-    /**/private static BitField fFacingPages = new BitField(0x01);
-    /**/private static BitField fWidowControl = new BitField(0x02);
-    /**/private static BitField fPMHMainDoc = new BitField(0x04);
-    /**/private static BitField grfSupression = new BitField(0x18);
-    /**/private static BitField fpc = new BitField(0x60);
-    /**/private static BitField unused1 = new BitField(0x80);
+    private static final BitField fFacingPages = new BitField(0x01);
+    private static final BitField fWidowControl = new BitField(0x02);
+    private static final BitField fPMHMainDoc = new BitField(0x04);
+    private static final BitField grfSupression = new BitField(0x18);
+    private static final BitField fpc = new BitField(0x60);
+    private static final BitField unused1 = new BitField(0x80);
     protected byte field_2_unused2;
     protected short field_3_footnoteInfo;
-    /**/private static BitField rncFtn = new BitField(0x0003);
-    /**/private static BitField nFtn = new BitField(0xfffc);
+    private static final BitField rncFtn = new BitField(0x0003);
+    private static final BitField nFtn = new BitField(0xfffc);
     protected byte field_4_fOutlineDirtySave;
     protected byte field_5_docinfo;
-    /**/private static BitField fOnlyMacPics = new BitField(0x01);
-    /**/private static BitField fOnlyWinPics = new BitField(0x02);
-    /**/private static BitField fLabelDoc = new BitField(0x04);
-    /**/private static BitField fHyphCapitals = new BitField(0x08);
-    /**/private static BitField fAutoHyphen = new BitField(0x10);
-    /**/private static BitField fFormNoFields = new BitField(0x20);
-    /**/private static BitField fLinkStyles = new BitField(0x40);
-    /**/private static BitField fRevMarking = new BitField(0x80);
+    private static final BitField fOnlyMacPics = new BitField(0x01);
+    private static final BitField fOnlyWinPics = new BitField(0x02);
+    private static final BitField fLabelDoc = new BitField(0x04);
+    private static final BitField fHyphCapitals = new BitField(0x08);
+    private static final BitField fAutoHyphen = new BitField(0x10);
+    private static final BitField fFormNoFields = new BitField(0x20);
+    private static final BitField fLinkStyles = new BitField(0x40);
+    private static final BitField fRevMarking = new BitField(0x80);
     protected byte field_6_docinfo1;
-    /**/private static BitField fBackup = new BitField(0x01);
-    /**/private static BitField fExactCWords = new BitField(0x02);
-    /**/private static BitField fPagHidden = new BitField(0x04);
-    /**/private static BitField fPagResults = new BitField(0x08);
-    /**/private static BitField fLockAtn = new BitField(0x10);
-    /**/private static BitField fMirrorMargins = new BitField(0x20);
-    /**/private static BitField unused3 = new BitField(0x40);
-    /**/private static BitField fDfltTrueType = new BitField(0x80);
+    private static final BitField fBackup = new BitField(0x01);
+    private static final BitField fExactCWords = new BitField(0x02);
+    private static final BitField fPagHidden = new BitField(0x04);
+    private static final BitField fPagResults = new BitField(0x08);
+    private static final BitField fLockAtn = new BitField(0x10);
+    private static final BitField fMirrorMargins = new BitField(0x20);
+    private static final BitField unused3 = new BitField(0x40);
+    private static final BitField fDfltTrueType = new BitField(0x80);
     protected byte field_7_docinfo2;
-    /**/private static BitField fPagSupressTopSpacing = new BitField(0x01);
-    /**/private static BitField fProtEnabled = new BitField(0x02);
-    /**/private static BitField fDispFormFldSel = new BitField(0x04);
-    /**/private static BitField fRMView = new BitField(0x08);
-    /**/private static BitField fRMPrint = new BitField(0x10);
-    /**/private static BitField unused4 = new BitField(0x20);
-    /**/private static BitField fLockRev = new BitField(0x40);
-    /**/private static BitField fEmbedFonts = new BitField(0x80);
+    private static final BitField fPagSupressTopSpacing = new BitField(0x01);
+    private static final BitField fProtEnabled = new BitField(0x02);
+    private static final BitField fDispFormFldSel = new BitField(0x04);
+    private static final BitField fRMView = new BitField(0x08);
+    private static final BitField fRMPrint = new BitField(0x10);
+    private static final BitField unused4 = new BitField(0x20);
+    private static final BitField fLockRev = new BitField(0x40);
+    private static final BitField fEmbedFonts = new BitField(0x80);
     protected short field_8_docinfo3;
-    /**/private static BitField oldfNoTabForInd = new BitField(0x0001);
-    /**/private static BitField oldfNoSpaceRaiseLower = new BitField(0x0002);
-    /**/private static BitField oldfSuppressSpbfAfterPageBreak = new BitField(0x0004);
-    /**/private static BitField oldfWrapTrailSpaces = new BitField(0x0008);
-    /**/private static BitField oldfMapPrintTextColor = new BitField(0x0010);
-    /**/private static BitField oldfNoColumnBalance = new BitField(0x0020);
-    /**/private static BitField oldfConvMailMergeEsc = new BitField(0x0040);
-    /**/private static BitField oldfSupressTopSpacing = new BitField(0x0080);
-    /**/private static BitField oldfOrigWordTableRules = new BitField(0x0100);
-    /**/private static BitField oldfTransparentMetafiles = new BitField(0x0200);
-    /**/private static BitField oldfShowBreaksInFrames = new BitField(0x0400);
-    /**/private static BitField oldfSwapBordersFacingPgs = new BitField(0x0800);
-    /**/private static BitField unused5 = new BitField(0xf000);
+    private static final BitField oldfNoTabForInd = new BitField(0x0001);
+    private static final BitField oldfNoSpaceRaiseLower = new BitField(0x0002);
+    private static final BitField oldfSuppressSpbfAfterPageBreak = new BitField(0x0004);
+    private static final BitField oldfWrapTrailSpaces = new BitField(0x0008);
+    private static final BitField oldfMapPrintTextColor = new BitField(0x0010);
+    private static final BitField oldfNoColumnBalance = new BitField(0x0020);
+    private static final BitField oldfConvMailMergeEsc = new BitField(0x0040);
+    private static final BitField oldfSupressTopSpacing = new BitField(0x0080);
+    private static final BitField oldfOrigWordTableRules = new BitField(0x0100);
+    private static final BitField oldfTransparentMetafiles = new BitField(0x0200);
+    private static final BitField oldfShowBreaksInFrames = new BitField(0x0400);
+    private static final BitField oldfSwapBordersFacingPgs = new BitField(0x0800);
+    private static final BitField unused5 = new BitField(0xf000);
     protected int field_9_dxaTab;
     protected int field_10_wSpare;
     protected int field_11_dxaHotz;
@@ -103,16 +102,16 @@ public abstract class DOPAbstractType im
     protected int field_21_cPg;
     protected int field_22_cParas;
     protected short field_23_Edn;
-    /**/private static BitField rncEdn = new BitField(0x0003);
-    /**/private static BitField nEdn = new BitField(0xfffc);
+    private static final BitField rncEdn = new BitField(0x0003);
+    private static final BitField nEdn = new BitField(0xfffc);
     protected short field_24_Edn1;
-    /**/private static BitField epc = new BitField(0x0003);
-    /**/private static BitField nfcFtnRef1 = new BitField(0x003c);
-    /**/private static BitField nfcEdnRef1 = new BitField(0x03c0);
-    /**/private static BitField fPrintFormData = new BitField(0x0400);
-    /**/private static BitField fSaveFormData = new BitField(0x0800);
-    /**/private static BitField fShadeFormData = new BitField(0x1000);
-    /**/private static BitField fWCFtnEdn = new BitField(0x8000);
+    private static final BitField epc = new BitField(0x0003);
+    private static final BitField nfcFtnRef1 = new BitField(0x003c);
+    private static final BitField nfcEdnRef1 = new BitField(0x03c0);
+    private static final BitField fPrintFormData = new BitField(0x0400);
+    private static final BitField fSaveFormData = new BitField(0x0800);
+    private static final BitField fShadeFormData = new BitField(0x1000);
+    private static final BitField fWCFtnEdn = new BitField(0x8000);
     protected int field_25_cLines;
     protected int field_26_cWordsFtnEnd;
     protected int field_27_cChFtnEdn;
@@ -121,55 +120,55 @@ public abstract class DOPAbstractType im
     protected int field_30_cLinesFtnEdn;
     protected int field_31_lKeyProtDoc;
     protected short field_32_view;
-    /**/private static BitField wvkSaved = new BitField(0x0007);
-    /**/private static BitField wScaleSaved = new BitField(0x0ff8);
-    /**/private static BitField zkSaved = new BitField(0x3000);
-    /**/private static BitField fRotateFontW6 = new BitField(0x4000);
-    /**/private static BitField iGutterPos = new BitField(0x8000);
+    private static final BitField wvkSaved = new BitField(0x0007);
+    private static final BitField wScaleSaved = new BitField(0x0ff8);
+    private static final BitField zkSaved = new BitField(0x3000);
+    private static final BitField fRotateFontW6 = new BitField(0x4000);
+    private static final BitField iGutterPos = new BitField(0x8000);
     protected int field_33_docinfo4;
-    /**/private static BitField fNoTabForInd = new BitField(0x00000001);
-    /**/private static BitField fNoSpaceRaiseLower = new BitField(0x00000002);
-    /**/private static BitField fSupressSpdfAfterPageBreak = new BitField(0x00000004);
-    /**/private static BitField fWrapTrailSpaces = new BitField(0x00000008);
-    /**/private static BitField fMapPrintTextColor = new BitField(0x00000010);
-    /**/private static BitField fNoColumnBalance = new BitField(0x00000020);
-    /**/private static BitField fConvMailMergeEsc = new BitField(0x00000040);
-    /**/private static BitField fSupressTopSpacing = new BitField(0x00000080);
-    /**/private static BitField fOrigWordTableRules = new BitField(0x00000100);
-    /**/private static BitField fTransparentMetafiles = new BitField(0x00000200);
-    /**/private static BitField fShowBreaksInFrames = new BitField(0x00000400);
-    /**/private static BitField fSwapBordersFacingPgs = new BitField(0x00000800);
-    /**/private static BitField fSuppressTopSPacingMac5 = new BitField(0x00010000);
-    /**/private static BitField fTruncDxaExpand = new BitField(0x00020000);
-    /**/private static BitField fPrintBodyBeforeHdr = new BitField(0x00040000);
-    /**/private static BitField fNoLeading = new BitField(0x00080000);
-    /**/private static BitField fMWSmallCaps = new BitField(0x00200000);
+    private static final BitField fNoTabForInd = new BitField(0x00000001);
+    private static final BitField fNoSpaceRaiseLower = new BitField(0x00000002);
+    private static final BitField fSupressSpdfAfterPageBreak = new BitField(0x00000004);
+    private static final BitField fWrapTrailSpaces = new BitField(0x00000008);
+    private static final BitField fMapPrintTextColor = new BitField(0x00000010);
+    private static final BitField fNoColumnBalance = new BitField(0x00000020);
+    private static final BitField fConvMailMergeEsc = new BitField(0x00000040);
+    private static final BitField fSupressTopSpacing = new BitField(0x00000080);
+    private static final BitField fOrigWordTableRules = new BitField(0x00000100);
+    private static final BitField fTransparentMetafiles = new BitField(0x00000200);
+    private static final BitField fShowBreaksInFrames = new BitField(0x00000400);
+    private static final BitField fSwapBordersFacingPgs = new BitField(0x00000800);
+    private static final BitField fSuppressTopSPacingMac5 = new BitField(0x00010000);
+    private static final BitField fTruncDxaExpand = new BitField(0x00020000);
+    private static final BitField fPrintBodyBeforeHdr = new BitField(0x00040000);
+    private static final BitField fNoLeading = new BitField(0x00080000);
+    private static final BitField fMWSmallCaps = new BitField(0x00200000);
     protected short field_34_adt;
     protected byte[] field_35_doptypography;
     protected byte[] field_36_dogrid;
     protected short field_37_docinfo5;
-    /**/private static BitField lvl = new BitField(0x001e);
-    /**/private static BitField fGramAllDone = new BitField(0x0020);
-    /**/private static BitField fGramAllClean = new BitField(0x0040);
-    /**/private static BitField fSubsetFonts = new BitField(0x0080);
-    /**/private static BitField fHideLastVersion = new BitField(0x0100);
-    /**/private static BitField fHtmlDoc = new BitField(0x0200);
-    /**/private static BitField fSnapBorder = new BitField(0x0800);
-    /**/private static BitField fIncludeHeader = new BitField(0x1000);
-    /**/private static BitField fIncludeFooter = new BitField(0x2000);
-    /**/private static BitField fForcePageSizePag = new BitField(0x4000);
-    /**/private static BitField fMinFontSizePag = new BitField(0x8000);
+    private static final BitField lvl = new BitField(0x001e);
+    private static final BitField fGramAllDone = new BitField(0x0020);
+    private static final BitField fGramAllClean = new BitField(0x0040);
+    private static final BitField fSubsetFonts = new BitField(0x0080);
+    private static final BitField fHideLastVersion = new BitField(0x0100);
+    private static final BitField fHtmlDoc = new BitField(0x0200);
+    private static final BitField fSnapBorder = new BitField(0x0800);
+    private static final BitField fIncludeHeader = new BitField(0x1000);
+    private static final BitField fIncludeFooter = new BitField(0x2000);
+    private static final BitField fForcePageSizePag = new BitField(0x4000);
+    private static final BitField fMinFontSizePag = new BitField(0x8000);
     protected short field_38_docinfo6;
-    /**/private static BitField fHaveVersions = new BitField(0x0001);
-    /**/private static BitField fAutoVersions = new BitField(0x0002);
+    private static final BitField fHaveVersions = new BitField(0x0001);
+    private static final BitField fAutoVersions = new BitField(0x0002);
     protected byte[] field_39_asumyi;
     protected int field_40_cChWS;
     protected int field_41_cChWSFtnEdn;
     protected int field_42_grfDocEvents;
     protected int field_43_virusinfo;
-    /**/private static BitField fVirusPrompted = new BitField(0x0001);
-    /**/private static BitField fVirusLoadSafe = new BitField(0x0002);
-    /**/private static BitField KeyVirusSession30 = new BitField(0xfffffffc);
+    private static final BitField fVirusPrompted = new BitField(0x0001);
+    private static final BitField fVirusLoadSafe = new BitField(0x0002);
+    private static final BitField KeyVirusSession30 = new BitField(0xfffffffc);
     protected byte[] field_44_Spare;
     protected int field_45_reserved1;
     protected int field_46_reserved2;

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java?rev=1705779&r1=1705778&r2=1705779&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java Mon Sep 28 21:26:06 2015
@@ -17,7 +17,6 @@
 
 package org.apache.poi.hwpf.model.types;
 
-import org.apache.poi.hdf.model.hdftypes.HDFType;
 import org.apache.poi.util.BitField;
 import org.apache.poi.util.Internal;
 
@@ -34,21 +33,21 @@ import org.apache.poi.util.Internal;
  *         File Format Specification [*.doc]
  */
 @Internal
-public abstract class FLDAbstractType implements HDFType
+public abstract class FLDAbstractType
 {
 
     protected byte field_1_chHolder;
-    private static BitField ch = new BitField( 0x1f );
-    private static BitField reserved = new BitField( 0xe0 );
+    private static final BitField ch = new BitField( 0x1f );
+    private static final BitField reserved = new BitField( 0xe0 );
     protected byte field_2_flt;
-    private static BitField fDiffer = new BitField( 0x01 );
-    private static BitField fZombieEmbed = new BitField( 0x02 );
-    private static BitField fResultDirty = new BitField( 0x04 );
-    private static BitField fResultEdited = new BitField( 0x08 );
-    private static BitField fLocked = new BitField( 0x10 );
-    private static BitField fPrivateResult = new BitField( 0x20 );
-    private static BitField fNested = new BitField( 0x40 );
-    private static BitField fHasSep = new BitField( 0x40 );
+    private static final BitField fDiffer = new BitField( 0x01 );
+    private static final BitField fZombieEmbed = new BitField( 0x02 );
+    private static final BitField fResultDirty = new BitField( 0x04 );
+    private static final BitField fResultEdited = new BitField( 0x08 );
+    private static final BitField fLocked = new BitField( 0x10 );
+    private static final BitField fPrivateResult = new BitField( 0x20 );
+    private static final BitField fNested = new BitField( 0x40 );
+    private static final BitField fHasSep = new BitField( 0x40 );
 
     public FLDAbstractType()
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message