]> source.dussan.org Git - poi.git/commitdiff
add @Override annotation. Explicitly specify workbook type returned by SXSSFITestData...
authorJaven O'Neal <onealj@apache.org>
Mon, 30 Nov 2015 05:22:14 +0000 (05:22 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 30 Nov 2015 05:22:14 +0000 (05:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1717179 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java

index eab0413cc825e35d5f0bd724534e7efb65aac287..39b520fd0035b3b9d2779e6066a9410f8c4c8058 100644 (file)
@@ -46,6 +46,7 @@ public final class SXSSFITestDataProvider implements ITestDataProvider {
         // enforce singleton
     }
 
+    @Override
     public Workbook openSampleWorkbook(String sampleFileName) {
         XSSFWorkbook xssfWorkbook = XSSFITestDataProvider.instance.openSampleWorkbook(sampleFileName);
         SXSSFWorkbook swb = new SXSSFWorkbook(xssfWorkbook);
@@ -53,12 +54,16 @@ public final class SXSSFITestDataProvider implements ITestDataProvider {
         return swb;
     }
 
-    public Workbook writeOutAndReadBack(Workbook wb) {
+    /**
+     * Returns an XSSFWorkbook since SXSSFWorkbook is write-only
+     */
+    @Override
+    public XSSFWorkbook writeOutAndReadBack(Workbook wb) {
         if(!(wb instanceof SXSSFWorkbook)) {
             throw new IllegalArgumentException("Expected an instance of SXSSFWorkbook");
         }
 
-        Workbook result;
+        XSSFWorkbook result;
         try {
             ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
             wb.write(baos);
@@ -70,24 +75,29 @@ public final class SXSSFITestDataProvider implements ITestDataProvider {
         return result;
     }
 
+    @Override
     public SXSSFWorkbook createWorkbook(){
         SXSSFWorkbook wb = new SXSSFWorkbook();
         instances.add(wb);
         return wb;
     }
     
+    @Override
     public FormulaEvaluator createFormulaEvaluator(Workbook wb) {
         return new XSSFFormulaEvaluator(((SXSSFWorkbook) wb).getXSSFWorkbook());
     }
 
+    @Override
     public byte[] getTestDataFileContent(String fileName) {
         return POIDataSamples.getSpreadSheetInstance().readFile(fileName);
     }
 
+    @Override
     public SpreadsheetVersion getSpreadsheetVersion(){
         return SpreadsheetVersion.EXCEL2007;
     }
 
+    @Override
     public String getStandardFileNameExtension() {
         return "xlsx";
     }