poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1649123 - in /poi/trunk/src: examples/src/org/apache/poi/xslf/usermodel/ examples/src/org/apache/poi/xslf/usermodel/tutorial/ examples/src/org/apache/poi/xssf/usermodel/examples/ examples/src/org/apache/poi/xwpf/usermodel/ excelant/java/or...
Date Fri, 02 Jan 2015 21:06:52 GMT
Author: centic
Date: Fri Jan  2 21:06:51 2015
New Revision: 1649123

URL: http://svn.apache.org/r1649123
Log:
Fix some Eclipse warnings

Modified:
    poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java
    poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java
    poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java
    poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step2.java
    poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithPictures.java
    poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java
    poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/UpdateEmbeddedDoc.java
    poi/trunk/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java
    poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java
    poi/trunk/src/java/org/apache/poi/hssf/util/HSSFColor.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
    poi/trunk/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java

Modified: poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java Fri Jan  2
21:06:51 2015
@@ -63,90 +63,101 @@ public class PieChartDemo {
         }
 
         BufferedReader modelReader = new BufferedReader(new FileReader(args[1]));
-
-        String chartTitle = modelReader.readLine();  // first line is chart title
-
-        XMLSlideShow pptx = new XMLSlideShow(new FileInputStream(args[0]));
-        XSLFSlide slide = pptx.getSlides()[0];
-
-        // find chart in the slide
-        XSLFChart chart = null;
-        for(POIXMLDocumentPart part : slide.getRelations()){
-            if(part instanceof XSLFChart){
-                chart = (XSLFChart) part;
-                break;
+        try {
+            String chartTitle = modelReader.readLine();  // first line is chart title
+    
+            XMLSlideShow pptx = new XMLSlideShow(new FileInputStream(args[0]));
+            XSLFSlide slide = pptx.getSlides()[0];
+    
+            // find chart in the slide
+            XSLFChart chart = null;
+            for(POIXMLDocumentPart part : slide.getRelations()){
+                if(part instanceof XSLFChart){
+                    chart = (XSLFChart) part;
+                    break;
+                }
             }
+    
+            if(chart == null) throw new IllegalStateException("chart not found in the template");
+    
+            // embedded Excel workbook that holds the chart data
+            POIXMLDocumentPart xlsPart = chart.getRelations().get(0);
+            XSSFWorkbook wb = new XSSFWorkbook();
+            try {
+                XSSFSheet sheet = wb.createSheet();
+        
+                CTChart ctChart = chart.getCTChart();
+                CTPlotArea plotArea = ctChart.getPlotArea();
+        
+                CTPieChart pieChart = plotArea.getPieChartArray(0);
+                //Pie Chart Series
+                CTPieSer ser = pieChart.getSerArray(0);
+        
+                // Series Text
+                CTSerTx tx = ser.getTx();
+                tx.getStrRef().getStrCache().getPtArray(0).setV(chartTitle);
+                sheet.createRow(0).createCell(1).setCellValue(chartTitle);
+                String titleRef = new CellReference(sheet.getSheetName(), 0, 1, true, true).formatAsString();
+                tx.getStrRef().setF(titleRef);
+        
+                // Category Axis Data
+                CTAxDataSource cat = ser.getCat();
+                CTStrData strData = cat.getStrRef().getStrCache();
+        
+                // Values
+                CTNumDataSource val = ser.getVal();
+                CTNumData numData = val.getNumRef().getNumCache();
+        
+                strData.setPtArray(null);  // unset old axis text
+                numData.setPtArray(null);  // unset old values
+        
+                // set model
+                int idx = 0;
+                int rownum = 1;
+                String ln;
+                while((ln = modelReader.readLine()) != null){
+                    String[] vals = ln.split("\\s+");
+                    CTNumVal numVal = numData.addNewPt();
+                    numVal.setIdx(idx);
+                    numVal.setV(vals[1]);
+        
+                    CTStrVal sVal = strData.addNewPt();
+                    sVal.setIdx(idx);
+                    sVal.setV(vals[0]);
+        
+                    idx++;
+                    XSSFRow row = sheet.createRow(rownum++);
+                    row.createCell(0).setCellValue(vals[0]);
+                    row.createCell(1).setCellValue(Double.valueOf(vals[1]));
+                }
+                numData.getPtCount().setVal(idx);
+                strData.getPtCount().setVal(idx);
+        
+                String numDataRange = new CellRangeAddress(1, rownum-1, 1, 1).formatAsString(sheet.getSheetName(),
true);
+                val.getNumRef().setF(numDataRange);
+                String axisDataRange = new CellRangeAddress(1, rownum-1, 0, 0).formatAsString(sheet.getSheetName(),
true);
+                cat.getStrRef().setF(axisDataRange);
+        
+                // updated the embedded workbook with the data
+                OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream();
+                try {
+                    wb.write(xlsOut);
+                } finally {
+                    xlsOut.close();
+                }
+        
+                // save the result
+                OutputStream out = new FileOutputStream("pie-chart-demo-output.pptx");
+                try {
+                    pptx.write(out);
+                } finally {
+                    out.close();
+                }
+            } finally {
+                wb.close();
+            }
+        } finally {
+            modelReader.close();
         }
-
-        if(chart == null) throw new IllegalStateException("chart not found in the template");
-
-        // embedded Excel workbook that holds the chart data
-        POIXMLDocumentPart xlsPart = chart.getRelations().get(0);
-        XSSFWorkbook wb = new XSSFWorkbook();
-        XSSFSheet sheet = wb.createSheet();
-
-        CTChart ctChart = chart.getCTChart();
-        CTPlotArea plotArea = ctChart.getPlotArea();
-
-        CTPieChart pieChart = plotArea.getPieChartArray(0);
-        //Pie Chart Series
-        CTPieSer ser = pieChart.getSerArray(0);
-
-        // Series Text
-        CTSerTx tx = ser.getTx();
-        tx.getStrRef().getStrCache().getPtArray(0).setV(chartTitle);
-        sheet.createRow(0).createCell(1).setCellValue(chartTitle);
-        String titleRef = new CellReference(sheet.getSheetName(), 0, 1, true, true).formatAsString();
-        tx.getStrRef().setF(titleRef);
-
-
-        // Category Axis Data
-        CTAxDataSource cat = ser.getCat();
-        CTStrData strData = cat.getStrRef().getStrCache();
-
-        // Values
-        CTNumDataSource val = ser.getVal();
-        CTNumData numData = val.getNumRef().getNumCache();
-
-        strData.setPtArray(null);  // unset old axis text
-        numData.setPtArray(null);  // unset old values
-
-
-        // set model
-        int idx = 0;
-        int rownum = 1;
-        String ln;
-        while((ln = modelReader.readLine()) != null){
-            String[] vals = ln.split("\\s+");
-            CTNumVal numVal = numData.addNewPt();
-            numVal.setIdx(idx);
-            numVal.setV(vals[1]);
-
-            CTStrVal sVal = strData.addNewPt();
-            sVal.setIdx(idx);
-            sVal.setV(vals[0]);
-
-            idx++;
-            XSSFRow row = sheet.createRow(rownum++);
-            row.createCell(0).setCellValue(vals[0]);
-            row.createCell(1).setCellValue(Double.valueOf(vals[1]));
-        }
-        numData.getPtCount().setVal(idx);
-        strData.getPtCount().setVal(idx);
-
-        String numDataRange = new CellRangeAddress(1, rownum-1, 1, 1).formatAsString(sheet.getSheetName(),
true);
-        val.getNumRef().setF(numDataRange);
-        String axisDataRange = new CellRangeAddress(1, rownum-1, 0, 0).formatAsString(sheet.getSheetName(),
true);
-        cat.getStrRef().setF(axisDataRange);
-
-        // updated the embedded workbook with the data
-        OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream();
-        wb.write(xlsOut);
-        xlsOut.close();
-
-        // save the result
-        FileOutputStream out = new FileOutputStream("pie-chart-demo-output.pptx");
-        pptx.write(out);
-        out.close();
     }
 }

Modified: poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java Fri Jan  2 21:06:51
2015
@@ -34,7 +34,7 @@ public class Tutorial1 {
         XMLSlideShow ppt = new XMLSlideShow();
 
         // XSLFSlide#createSlide() with no arguments creates a blank slide
-        XSLFSlide blankSlide = ppt.createSlide();
+        /*XSLFSlide blankSlide =*/ ppt.createSlide();
 
         
         XSLFSlideMaster master = ppt.getSlideMasters()[0];

Modified: poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java Fri Jan  2 21:06:51
2015
@@ -41,7 +41,7 @@ public class Tutorial5 {
         byte[] data = IOUtils.toByteArray(new FileInputStream(img));
         int pictureIndex = ppt.addPicture(data, XSLFPictureData.PICTURE_TYPE_PNG);
 
-        XSLFPictureShape shape = slide.createPicture(pictureIndex);
+        /*XSLFPictureShape shape =*/ slide.createPicture(pictureIndex);
 
         FileOutputStream out = new FileOutputStream("images.pptx");
         ppt.write(out);

Modified: poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step2.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step2.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step2.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step2.java Fri Jan 
2 21:06:51 2015
@@ -47,7 +47,7 @@ public class Step2 {
         }
 
         // blank slide
-        XSLFSlide blankSlide = ppt.createSlide();
+        /*XSLFSlide blankSlide =*/ ppt.createSlide();
 
         XSLFSlideMaster defaultMaster = ppt.getSlideMasters()[0];
 

Modified: poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithPictures.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithPictures.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithPictures.java
(original)
+++ poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithPictures.java
Fri Jan  2 21:06:51 2015
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.OutputStream;
 
 /**
  * Demonstrates how to insert pictures in a SpreadsheetML document
@@ -36,34 +37,41 @@ public class WorkingWithPictures {
 
         //create a new workbook
         Workbook wb = new XSSFWorkbook(); //or new HSSFWorkbook();
-        CreationHelper helper = wb.getCreationHelper();
-
-        //add a picture in this workbook.
-        InputStream is = new FileInputStream(args[0]);
-        byte[] bytes = IOUtils.toByteArray(is);
-        is.close();
-        int pictureIdx = wb.addPicture(bytes, Workbook.PICTURE_TYPE_JPEG);
-
-        //create sheet
-        Sheet sheet = wb.createSheet();
-
-        //create drawing
-        Drawing drawing = sheet.createDrawingPatriarch();
-
-        //add a picture shape
-        ClientAnchor anchor = helper.createClientAnchor();
-        anchor.setCol1(1);
-        anchor.setRow1(1);
-        Picture pict = drawing.createPicture(anchor, pictureIdx);
-
-        //auto-size picture
-        pict.resize(2);
-
-        //save workbook
-        String file = "picture.xls";
-        if(wb instanceof XSSFWorkbook) file += "x";
-        FileOutputStream fileOut = new FileOutputStream(file);
-        wb.write(fileOut);
-        fileOut.close();
+        try {
+            CreationHelper helper = wb.getCreationHelper();
+    
+            //add a picture in this workbook.
+            InputStream is = new FileInputStream(args[0]);
+            byte[] bytes = IOUtils.toByteArray(is);
+            is.close();
+            int pictureIdx = wb.addPicture(bytes, Workbook.PICTURE_TYPE_JPEG);
+    
+            //create sheet
+            Sheet sheet = wb.createSheet();
+    
+            //create drawing
+            Drawing drawing = sheet.createDrawingPatriarch();
+    
+            //add a picture shape
+            ClientAnchor anchor = helper.createClientAnchor();
+            anchor.setCol1(1);
+            anchor.setRow1(1);
+            Picture pict = drawing.createPicture(anchor, pictureIdx);
+    
+            //auto-size picture
+            pict.resize(2);
+    
+            //save workbook
+            String file = "picture.xls";
+            if(wb instanceof XSSFWorkbook) file += "x";
+            OutputStream fileOut = new FileOutputStream(file);
+            try {
+                wb.write(fileOut);
+            } finally {
+                fileOut.close();
+            }
+        } finally {
+            wb.close();
+        }
     }
 }

Modified: poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java
(original)
+++ poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java
Fri Jan  2 21:06:51 2015
@@ -20,6 +20,7 @@ package org.apache.poi.xssf.usermodel.ex
 import org.apache.poi.xssf.usermodel.*;
 
 import java.io.FileOutputStream;
+import java.io.OutputStream;
 
 /**
  * Demonstrates how to work with rich text
@@ -29,33 +30,39 @@ public class WorkingWithRichText {
     public static void main(String[] args) throws Exception {
 
         XSSFWorkbook wb = new XSSFWorkbook(); //or new HSSFWorkbook();
-
-        XSSFSheet sheet = wb.createSheet();
-        XSSFRow row = sheet.createRow((short) 2);
-
-        XSSFCell cell = row.createCell(1);
-        XSSFRichTextString rt = new XSSFRichTextString("The quick brown fox");
-
-        XSSFFont font1 = wb.createFont();
-        font1.setBold(true);
-        font1.setColor(new XSSFColor(new java.awt.Color(255, 0, 0)));
-        rt.applyFont(0, 10, font1);
-
-        XSSFFont font2 = wb.createFont();
-        font2.setItalic(true);
-        font2.setUnderline(XSSFFont.U_DOUBLE);
-        font2.setColor(new XSSFColor(new java.awt.Color(0, 255, 0)));
-        rt.applyFont(10, 19, font2);
-
-        XSSFFont font3 = wb.createFont();
-        font3.setColor(new XSSFColor(new java.awt.Color(0, 0, 255)));
-        rt.append(" Jumped over the lazy dog", font3);
-
-        cell.setCellValue(rt);
-
-        // Write the output to a file
-        FileOutputStream fileOut = new FileOutputStream("xssf-richtext.xlsx");
-        wb.write(fileOut);
-        fileOut.close();
+        try {
+            XSSFSheet sheet = wb.createSheet();
+            XSSFRow row = sheet.createRow((short) 2);
+    
+            XSSFCell cell = row.createCell(1);
+            XSSFRichTextString rt = new XSSFRichTextString("The quick brown fox");
+    
+            XSSFFont font1 = wb.createFont();
+            font1.setBold(true);
+            font1.setColor(new XSSFColor(new java.awt.Color(255, 0, 0)));
+            rt.applyFont(0, 10, font1);
+    
+            XSSFFont font2 = wb.createFont();
+            font2.setItalic(true);
+            font2.setUnderline(XSSFFont.U_DOUBLE);
+            font2.setColor(new XSSFColor(new java.awt.Color(0, 255, 0)));
+            rt.applyFont(10, 19, font2);
+    
+            XSSFFont font3 = wb.createFont();
+            font3.setColor(new XSSFColor(new java.awt.Color(0, 0, 255)));
+            rt.append(" Jumped over the lazy dog", font3);
+    
+            cell.setCellValue(rt);
+    
+            // Write the output to a file
+            OutputStream fileOut = new FileOutputStream("xssf-richtext.xlsx");
+            try {
+                wb.write(fileOut);
+            } finally {
+                fileOut.close();
+            }
+        } finally {
+            wb.close();
+        }
     }
 }

Modified: poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/UpdateEmbeddedDoc.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/UpdateEmbeddedDoc.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/UpdateEmbeddedDoc.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/UpdateEmbeddedDoc.java Fri Jan
 2 21:06:51 2015
@@ -19,6 +19,8 @@
 
 package org.apache.poi.xwpf.usermodel;
 
+import static org.junit.Assert.assertEquals;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -27,7 +29,6 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Iterator;
 
-import junit.framework.Assert;
 import org.apache.poi.openxml4j.opc.PackagePart;
 import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
 import org.apache.poi.ss.usermodel.WorkbookFactory;
@@ -194,7 +195,7 @@ public class UpdateEmbeddedDoc {
                     sheet = workbook.getSheetAt(SHEET_NUM);
                     row = sheet.getRow(ROW_NUM);
                     cell = row.getCell(CELL_NUM);
-                    Assert.assertEquals(cell.getNumericCellValue(), NEW_VALUE);
+                    assertEquals(cell.getNumericCellValue(), NEW_VALUE, 0.0001);
                 }
             }
         }

Modified: poi/trunk/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java (original)
+++ poi/trunk/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java Fri Jan
 2 21:06:51 2015
@@ -61,7 +61,7 @@ public class ExcelAntHandlerTask extends
     public void execute() throws BuildException {
         log( "handling the workbook with class " + className, Project.MSG_INFO ) ;
         try {
-            Class clazz = Class.forName( className ) ;
+            Class<?> clazz = Class.forName( className ) ;
             Object handlerObj = clazz.newInstance() ;
             if( handlerObj instanceof IExcelAntWorkbookHandler ) {
                 IExcelAntWorkbookHandler iHandler = (IExcelAntWorkbookHandler)handlerObj
;

Modified: poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java Fri Jan  2 21:06:51 2015
@@ -1627,9 +1627,9 @@ public final class InternalSheet {
 
     private void recalcRowGutter() {
         int maxLevel = 0;
-        Iterator iterator = _rowsAggregate.getIterator();
+        Iterator<RowRecord> iterator = _rowsAggregate.getIterator();
         while (iterator.hasNext()) {
-            RowRecord rowRecord = (RowRecord) iterator.next();
+            RowRecord rowRecord = iterator.next();
             maxLevel = Math.max(rowRecord.getOutlineLevel(), maxLevel);
         }
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/util/HSSFColor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/util/HSSFColor.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/util/HSSFColor.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/util/HSSFColor.java Fri Jan  2 21:06:51 2015
@@ -164,7 +164,7 @@ public class HSSFColor implements Color
 
             String hexString = color.getHexString();
             if (result.containsKey(hexString)) {
-            	HSSFColor other = (HSSFColor)result.get(hexString);
+            	HSSFColor other = result.get(hexString);
                 throw new RuntimeException(
                 		"Dup color hexString (" + hexString
                         + ") for color (" + color.getClass().getName() + ") - "

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Fri Jan
 2 21:06:51 2015
@@ -18,13 +18,7 @@
 package org.apache.poi.xssf.usermodel;
 
 import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -52,29 +46,11 @@ import org.apache.poi.ss.formula.eval.Er
 import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.formula.functions.Function;
-import org.apache.poi.ss.usermodel.BaseTestBugzillaIssues;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.CellValue;
-import org.apache.poi.ss.usermodel.ClientAnchor;
-import org.apache.poi.ss.usermodel.Comment;
-import org.apache.poi.ss.usermodel.CreationHelper;
-import org.apache.poi.ss.usermodel.DataFormatter;
-import org.apache.poi.ss.usermodel.DateUtil;
-import org.apache.poi.ss.usermodel.Drawing;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.FormulaError;
-import org.apache.poi.ss.usermodel.FormulaEvaluator;
-import org.apache.poi.ss.usermodel.Hyperlink;
-import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.Name;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.usermodel.WorkbookFactory;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.AreaReference;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellReference;
+import org.apache.poi.ss.util.RegionUtil;
 import org.apache.poi.util.TempFile;
 import org.apache.poi.xssf.XLSBUnsupportedException;
 import org.apache.poi.xssf.XSSFITestDataProvider;
@@ -1800,9 +1776,10 @@ public final class TestXSSFBugs extends
     /**
      * New hyperlink with no initial cell reference, still need
      *  to be able to change it
+     * @throws IOException 
      */
     @Test
-    public void testBug56527() {
+    public void testBug56527() throws IOException {
         XSSFWorkbook wb = new XSSFWorkbook();
         XSSFSheet sheet = wb.createSheet();
         XSSFCreationHelper creationHelper = wb.getCreationHelper();
@@ -1829,6 +1806,7 @@ public final class TestXSSFBugs extends
         assertEquals(3, hyperlink.getFirstColumn());
         assertEquals(5, hyperlink.getLastRow());
         assertEquals(3, hyperlink.getLastColumn());
+        wb.close();
     }
     
     /**

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java?rev=1649123&r1=1649122&r2=1649123&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java Fri Jan 
2 21:06:51 2015
@@ -64,7 +64,7 @@ public final class TestMergeCellsRecord
 	};
 	public void testMCTable_bug46009() {
 		MergedCellsTable mct = new MergedCellsTable();
-		List recList = new ArrayList();
+		List<Record> recList = new ArrayList<Record>();
 		CellRangeAddress[] cras = new CellRangeAddress[] {
 				new CellRangeAddress(0, 0, 0, 3), 
 		};



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


Mime
View raw message