poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1521015 - in /poi/trunk/src: java/org/apache/poi/hssf/usermodel/ java/org/apache/poi/ss/usermodel/ ooxml/java/org/apache/poi/xssf/usermodel/ ooxml/testcases/org/apache/poi/xssf/usermodel/ testcases/org/apache/poi/hssf/eventusermodel/ testc...
Date Mon, 09 Sep 2013 09:41:31 GMT
Author: centic
Date: Mon Sep  9 09:41:31 2013
New Revision: 1521015

URL: http://svn.apache.org/r1521015
Log:
Remove Eclipse warnings, remove duplicate test, rename tests to also run tests in base class

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
    poi/trunk/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java Mon Sep  9 09:41:31
2013
@@ -64,7 +64,7 @@ public final class HSSFPalette {
     }
 
     /**
-     * Finds the first occurance of a given color
+     * Finds the first occurrence of a given color
      *
      * @param red the RGB red component, between 0 and 255 inclusive
      * @param green the RGB green component, between 0 and 255 inclusive
@@ -194,11 +194,13 @@ public final class HSSFPalette {
             _blue = blue;
         }
 
+        @Override
         public short getIndex()
         {
             return _byteOffset;
         }
 
+        @Override
         public short[] getTriplet()
         {
             return new short[]
@@ -209,6 +211,7 @@ public final class HSSFPalette {
             };
         }
 
+        @Override
         public String getHexString()
         {
             StringBuffer sb = new StringBuffer();

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java Mon Sep  9 09:41:31 2013
@@ -592,7 +592,8 @@ public interface Sheet extends Iterable<
      * @param leftcol the left column to show in desktop window pane
      * @deprecated Use {@link #showInPane(int, int)} as there can be more than 32767 rows.
      */
-    void showInPane(short toprow, short leftcol);
+    @Deprecated
+	void showInPane(short toprow, short leftcol);
 
     /**
      * Shifts rows between startRow and endRow n number of rows.

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java Mon Sep  9 09:41:31
2013
@@ -22,13 +22,13 @@ import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 
-import org.apache.poi.ss.formula.ptg.Ptg;
-import org.apache.poi.ss.formula.SharedFormula;
-import org.apache.poi.ss.formula.eval.ErrorEval;
 import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.formula.FormulaParser;
 import org.apache.poi.ss.formula.FormulaRenderer;
 import org.apache.poi.ss.formula.FormulaType;
+import org.apache.poi.ss.formula.SharedFormula;
+import org.apache.poi.ss.formula.eval.ErrorEval;
+import org.apache.poi.ss.formula.ptg.Ptg;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellStyle;
 import org.apache.poi.ss.usermodel.Comment;
@@ -39,9 +39,9 @@ import org.apache.poi.ss.usermodel.Hyper
 import org.apache.poi.ss.usermodel.RichTextString;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellReference;
+import org.apache.poi.util.Internal;
 import org.apache.poi.xssf.model.SharedStringsTable;
 import org.apache.poi.xssf.model.StylesTable;
-import org.apache.poi.util.Internal;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellFormulaType;
@@ -790,6 +790,7 @@ public final class XSSFCell implements C
      * Errors are displayed as #ERR&lt;errIdx&gt;
      * </p>
      */
+    @Override
     public String toString() {
         switch (getCellType()) {
             case CELL_TYPE_BLANK:

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java Mon Sep  9 09:41:31
2013
@@ -26,8 +26,6 @@ import org.apache.poi.ss.usermodel.CellS
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.util.Internal;
-import org.apache.poi.util.POILogFactory;
-import org.apache.poi.util.POILogger;
 import org.apache.poi.xssf.model.CalculationChain;
 import org.apache.poi.xssf.model.StylesTable;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
@@ -37,7 +35,7 @@ import org.openxmlformats.schemas.spread
  * High level representation of a row of a spreadsheet.
  */
 public class XSSFRow implements Row, Comparable<XSSFRow> {
-    private static final POILogger _logger = POILogFactory.getLogger(XSSFRow.class);
+    //private static final POILogger _logger = POILogFactory.getLogger(XSSFRow.class);
 
     /**
      * the xml bean containing all cell definitions for this row
@@ -93,7 +91,8 @@ public class XSSFRow implements Row, Com
      *
      * @return an iterator over cells in this row.
      */
-    public Iterator<Cell> cellIterator() {
+    @SuppressWarnings("unchecked")
+	public Iterator<Cell> cellIterator() {
         return (Iterator<Cell>)(Iterator<? extends Cell>)_cells.values().iterator();
     }
 
@@ -202,7 +201,7 @@ public class XSSFRow implements Row, Com
     public XSSFCell getCell(int cellnum, MissingCellPolicy policy) {
     	if(cellnum < 0) throw new IllegalArgumentException("Cell index must be >= 0");
 
-        XSSFCell cell = (XSSFCell)_cells.get(cellnum);
+        XSSFCell cell = _cells.get(cellnum);
     	if(policy == RETURN_NULL_AND_BLANK) {
     		return cell;
     	}

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java Mon Sep
 9 09:41:31 2013
@@ -51,7 +51,8 @@ public final class TestXSSFSheet extends
     }
 
     //TODO column styles are not yet supported by XSSF
-    public void testDefaultColumnStyle() {
+    @Override
+	public void testDefaultColumnStyle() {
         //super.testDefaultColumnStyle();
     }
 
@@ -914,7 +915,7 @@ public final class TestXSSFSheet extends
      * Rows and cells can be created in random order,
      * but CTRows are kept in ascending order
      */
-    public void testCreateRow() {
+    public void testCreateRowA() {
         XSSFWorkbook workbook = new XSSFWorkbook();
         XSSFSheet sheet = workbook.createSheet();
         CTWorksheet wsh = sheet.getCTWorksheet();

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java
(original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java
Mon Sep  9 09:41:31 2013
@@ -30,11 +30,11 @@ import org.apache.poi.hssf.model.HSSFFor
 import org.apache.poi.hssf.model.InternalWorkbook;
 import org.apache.poi.hssf.record.FormulaRecord;
 import org.apache.poi.hssf.record.Record;
-import org.apache.poi.ss.formula.ptg.Ptg;
-import org.apache.poi.ss.formula.ptg.Ref3DPtg;
 import org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.ss.formula.ptg.Ptg;
+import org.apache.poi.ss.formula.ptg.Ref3DPtg;
 /**
  * Tests for {@link EventWorkbookBuilder}
  */
@@ -42,6 +42,7 @@ public final class TestEventWorkbookBuil
 	private MockHSSFListener mockListen;
 	private SheetRecordCollectingListener listener;
 
+	@Override
 	public void setUp() {
 		HSSFRequest req = new HSSFRequest();
 		mockListen = new MockHSSFListener();
@@ -146,8 +147,8 @@ public final class TestEventWorkbookBuil
 
 	private static final class MockHSSFListener implements HSSFListener {
 		public MockHSSFListener() {}
-		private final List _records = new ArrayList();
-		private final List _frecs = new ArrayList();
+		private final List<Record> _records = new ArrayList<Record>();
+		private final List<Record> _frecs = new ArrayList<Record>();
 
 		public void processRecord(Record record) {
 			_records.add(record);

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java Mon Sep  9
09:41:31 2013
@@ -25,7 +25,6 @@ import junit.framework.TestCase;
 
 import org.apache.poi.hssf.HSSFTestDataSamples;
 import org.apache.poi.hssf.record.PaletteRecord;
-import org.apache.poi.hssf.usermodel.HSSFPalette;
 import org.apache.poi.hssf.util.HSSFColor;
 
 /**
@@ -36,6 +35,7 @@ public final class TestHSSFPalette exten
     private HSSFPalette _hssfPalette;
 
 
+    @Override
     public void setUp()
     {
         _palette = new PaletteRecord();
@@ -268,12 +268,12 @@ public final class TestHSSFPalette exten
     }
 
     private void compareToDefaults(ColorComparator c) {
-        Map colors = HSSFColor.getIndexHash();
-        Iterator it = colors.keySet().iterator();
+        Map<Integer,HSSFColor> colors = HSSFColor.getIndexHash();
+        Iterator<Integer> it = colors.keySet().iterator();
         while (it.hasNext())
         {
-            Number index = (Number) it.next();
-            HSSFColor expectedColor = (HSSFColor) colors.get(index);
+            Number index = it.next();
+            HSSFColor expectedColor = colors.get(index);
             HSSFColor paletteColor = _hssfPalette.getColor(index.shortValue());
             c.compare(expectedColor, paletteColor);
         }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java Mon Sep  9 09:41:31
2013
@@ -28,13 +28,13 @@ import org.apache.poi.ddf.EscherDgRecord
 import org.apache.poi.hssf.HSSFITestDataProvider;
 import org.apache.poi.hssf.HSSFTestDataSamples;
 import org.apache.poi.hssf.model.DrawingManager2;
-import org.apache.poi.hssf.model.InternalWorkbook;
 import org.apache.poi.hssf.model.InternalSheet;
+import org.apache.poi.hssf.model.InternalWorkbook;
 import org.apache.poi.hssf.record.*;
-import org.apache.poi.ss.formula.ptg.Ptg;
-import org.apache.poi.ss.formula.ptg.Area3DPtg;
 import org.apache.poi.hssf.record.aggregates.WorksheetProtectionBlock;
 import org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector;
+import org.apache.poi.ss.formula.ptg.Area3DPtg;
+import org.apache.poi.ss.formula.ptg.Ptg;
 import org.apache.poi.ss.usermodel.BaseTestSheet;
 import org.apache.poi.ss.usermodel.DataValidation;
 import org.apache.poi.ss.usermodel.DataValidationConstraint;
@@ -44,7 +44,6 @@ import org.apache.poi.ss.usermodel.Sheet
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellRangeAddressList;
-import org.apache.poi.ss.util.Region;
 import org.apache.poi.util.TempFile;
 
 /**
@@ -363,7 +362,7 @@ public final class TestHSSFSheet extends
         assertEquals(expectedHashA, sheet2.getSheet().getProtectionBlock().getPasswordHash());
     }
 
-    public void testProtectSheet() {
+    public void testProtectSheetA() {
         int expectedHash = (short)0xfef1;
         HSSFWorkbook wb = new HSSFWorkbook();
         HSSFSheet s = wb.createSheet();
@@ -517,21 +516,6 @@ public final class TestHSSFSheet extends
         assertEquals("HSSFSheet.getLeftCol()", leftcol, sheet.getLeftCol());
     }
 
-    /** cell with formula becomes null on cloning a sheet*/
-     public void test35084() {
-
-        HSSFWorkbook wb = new HSSFWorkbook();
-        HSSFSheet s = wb.createSheet("Sheet1");
-        HSSFRow r = s.createRow(0);
-        r.createCell(0).setCellValue(1);
-        r.createCell(1).setCellFormula("A1*2");
-        HSSFSheet s1 = wb.cloneSheet(0);
-        r = s1.getRow(0);
-        assertEquals("double", r.getCell(0).getNumericCellValue(), 1, 0); // sanity check
-        assertNotNull(r.getCell(1));
-        assertEquals("formula", r.getCell(1).getCellFormula(), "A1*2");
-    }
-
     /**
      *
      */
@@ -702,7 +686,7 @@ public final class TestHSSFSheet extends
         assertTrue(wb3.getSheetAt(3).getForceFormulaRecalculation());
     }
 
-    public void testColumnWidth() {
+    public void testColumnWidthA() {
         //check we can correctly read column widths from a reference workbook
         HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("colwidth.xls");
 

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java?rev=1521015&r1=1521014&r2=1521015&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java Mon Sep  9 09:41:31
2013
@@ -394,6 +394,7 @@ public abstract class BaseTestSheet exte
         assertEquals(40000, sheet.getColumnWidth(10));
     }
 
+    
     public void testDefaultRowHeight() {
         Workbook workbook = _testDataProvider.createWorkbook();
         Sheet sheet = workbook.createSheet();
@@ -538,8 +539,8 @@ public abstract class BaseTestSheet exte
         double marginRight = defaultMargins[1];
         double marginTop = defaultMargins[2];
         double marginBottom = defaultMargins[3];
-        double marginHeader = defaultMargins[4];
-        double marginFooter = defaultMargins[5];
+        //double marginHeader = defaultMargins[4];
+        //double marginFooter = defaultMargins[5];
 
         Workbook workbook = _testDataProvider.createWorkbook();
         Sheet sheet = workbook.createSheet("Sheet 1");



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


Mime
View raw message