You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2017/09/23 10:26:27 UTC

svn commit: r1809388 - in /poi/trunk/src/examples/src/org/apache/poi: hssf/view/SVRowHeader.java ss/examples/ExcelComparator.java xssf/eventusermodel/XLSX2CSV.java xssf/streaming/examples/HybridStreaming.java

Author: centic
Date: Sat Sep 23 10:26:27 2017
New Revision: 1809388

URL: http://svn.apache.org/viewvc?rev=1809388&view=rev
Log:
Fix compiling Examples after adding new interface-method, fix compiler warnings and adjust some broken Javadoc

Modified:
    poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java
    poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
    poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
    poi/trunk/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java?rev=1809388&r1=1809387&r2=1809388&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java Sat Sep 23 10:26:27 2017
@@ -32,12 +32,12 @@ import org.apache.poi.hssf.usermodel.*;
  *
  * @author Jason Height
  */
-public class SVRowHeader extends JList {
+public class SVRowHeader extends JList<Object> {
   /** This model simply returns an integer number up to the number of rows
    *  that are present in the sheet.
    *
    */
-  private class SVRowHeaderModel extends AbstractListModel {
+  private class SVRowHeaderModel extends AbstractListModel<Object> {
     private HSSFSheet sheet;
 
     public SVRowHeaderModel(HSSFSheet sheet) {
@@ -55,7 +55,7 @@ public class SVRowHeader extends JList {
   }
 
   /** Renderes the row number*/
-  private class RowHeaderRenderer extends JLabel implements ListCellRenderer {
+  private class RowHeaderRenderer extends JLabel implements ListCellRenderer<Object> {
     private HSSFSheet sheet;
     private int extraHeight;
 
@@ -90,7 +90,7 @@ public class SVRowHeader extends JList {
   }
 
   public SVRowHeader(HSSFSheet sheet, JTable table, int extraHeight) {
-    ListModel lm = new SVRowHeaderModel(sheet);
+    ListModel<Object> lm = new SVRowHeaderModel(sheet);
     this.setModel(lm);
 
     setFixedCellWidth(50);

Modified: poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java?rev=1809388&r1=1809387&r2=1809388&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java Sat Sep 23 10:26:27 2017
@@ -28,6 +28,8 @@ import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Color;
 import org.apache.poi.ss.usermodel.DateUtil;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
@@ -109,10 +111,9 @@ public class ExcelComparator {
     /**
      * Utility to compare Excel File Contents cell by cell for all sheets.
      *
-     * @param workbook1 the workbook1
-     * @param workbook2 the workbook2
+     * @param wb1 the workbook1
+     * @param wb2 the workbook2
      * @return the Excel file difference containing a flag and a list of differences
-     * @throws ExcelCompareException the excel compare exception
      */
     public static List<String> compare(Workbook wb1, Workbook wb2) {
         Locator loc1 = new Locator();
@@ -130,11 +131,6 @@ public class ExcelComparator {
 
     /**
      * Compare data in all sheets.
-     *
-     * @param workbook1 the workbook1
-     * @param workbook2 the workbook2
-     * @param listOfDifferences the list of differences
-     * @throws ExcelCompareException the excel compare exception
      */
     private void compareDataInAllSheets(Locator loc1, Locator loc2) {
         for (int i = 0; i < loc1.workbook.getNumberOfSheets(); i++) {
@@ -291,15 +287,6 @@ public class ExcelComparator {
 
     /**
      * Compare sheet data.
-     *
-     * @param workbook1
-     *            the workbook1
-     * @param workbook2
-     *            the workbook2
-     * @param listOfDifferences
-     *
-     * @throws ExcelCompareException
-     *             the excel compare exception
      */
     private void compareSheetData(Locator loc1, Locator loc2) {
         compareNumberOfRowsInSheets(loc1, loc2);
@@ -343,13 +330,13 @@ public class ExcelComparator {
      */
     private void isCellAlignmentMatches(Locator loc1, Locator loc2) {
         // TODO: check for NPE
-        short align1 = loc1.cell.getCellStyle().getAlignment();
-        short align2 = loc2.cell.getCellStyle().getAlignment();
+        HorizontalAlignment align1 = loc1.cell.getCellStyle().getAlignmentEnum();
+        HorizontalAlignment align2 = loc2.cell.getCellStyle().getAlignmentEnum();
         if (align1 != align2) {
             addMessage(loc1, loc2,
                 "Cell Alignment does not Match ::",
-                Short.toString(align1),
-                Short.toString(align2)
+                align1.name(),
+                align2.name()
             );
         }
     }
@@ -424,7 +411,7 @@ public class ExcelComparator {
         Date date1 = loc1.cell.getDateCellValue();
         Date date2 = loc2.cell.getDateCellValue();
         if (!date1.equals(date2)) {
-            addMessage(loc1, loc2, CELL_DATA_DOES_NOT_MATCH, date1.toGMTString(), date2.toGMTString());
+            addMessage(loc1, loc2, CELL_DATA_DOES_NOT_MATCH, date1.toString(), date2.toString());
         }
     }
 
@@ -473,13 +460,13 @@ public class ExcelComparator {
      */
     private void isCellFillPatternMatches(Locator loc1, Locator loc2) {
         // TOOO: Check for NPE
-        short fill1 = loc1.cell.getCellStyle().getFillPattern();
-        short fill2 = loc2.cell.getCellStyle().getFillPattern();
+        FillPatternType fill1 = loc1.cell.getCellStyle().getFillPatternEnum();
+        FillPatternType fill2 = loc2.cell.getCellStyle().getFillPatternEnum();
         if (fill1 != fill2) {
             addMessage(loc1, loc2,
                 "Cell Fill pattern does not Match ::",
-                Short.toString(fill1),
-                Short.toString(fill2)
+                fill1.name(),
+                fill2.name()
             );
         }
     }
@@ -591,12 +578,6 @@ public class ExcelComparator {
 
     /**
      * Checks if cell under line matches.
-     *
-     * @param cellWorkBook1
-     *            the cell work book1
-     * @param cellWorkBook2
-     *            the cell work book2
-     * @return true, if cell under line matches
      */
     private void isCellUnderLineMatches(Locator loc1, Locator loc2) {
         // TOOO: distinguish underline type

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=1809388&r1=1809387&r2=1809388&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 Sat Sep 23 10:26:27 2017
@@ -140,6 +140,10 @@ public class XLSX2CSV {
         public void headerFooter(String text, boolean isHeader, String tagName) {
             // Skip, no headers or footers in CSV
         }
+
+        @Override
+        public void endSheet() {
+        }
     }
 
 

Modified: poi/trunk/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java?rev=1809388&r1=1809387&r2=1809388&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java Sat Sep 23 10:26:27 2017
@@ -75,6 +75,11 @@ public class HybridStreaming {
             @Override
             public void cell(String cellReference, String formattedValue, XSSFComment comment) {
             }
+
+            @Override
+            public void endSheet() {
+
+            }
         };
     }
 



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