poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1554535 - in /poi/trunk/src: java/org/apache/poi/hssf/record/aggregates/ java/org/apache/poi/ss/formula/functions/ ooxml/java/org/apache/poi/openxml4j/opc/internal/signature/ ooxml/java/org/apache/poi/openxml4j/opc/signature/ ooxml/java/or...
Date Tue, 31 Dec 2013 15:12:31 GMT
Author: centic
Date: Tue Dec 31 15:12:30 2013
New Revision: 1554535

URL: http://svn.apache.org/r1554535
Log:
remove some unused imports and some useless TODOs, slightly more
coverage, @Overrides, more info on failing test, fix some Eclipse
warnings

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java
    poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/signature/DigitalCertificatePart.java
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/signature/PackageDigitalSignature.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java
    poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java Tue
Dec 31 15:12:30 2013
@@ -25,8 +25,8 @@ import java.util.TreeMap;
 
 import org.apache.poi.hssf.model.RecordStream;
 import org.apache.poi.hssf.record.*;
-import org.apache.poi.ss.formula.FormulaShifter;
 import org.apache.poi.ss.SpreadsheetVersion;
+import org.apache.poi.ss.formula.FormulaShifter;
 
 /**
  *
@@ -237,14 +237,15 @@ public final class RowRecordsAggregate e
 		  rowIterator.next();
 		int result = 0;
 		while(rowIterator.hasNext() && (i++ < endIndex)) {
-		  Record rec = (Record)rowIterator.next();
+		  Record rec = rowIterator.next();
 		  result += rec.getRecordSize();
 		  rv.visitRecord(rec);
 		}
 		return result;
 	}
 
-	public void visitContainedRecords(RecordVisitor rv) {
+    @Override
+    public void visitContainedRecords(RecordVisitor rv) {
 
 		PositionTrackingVisitor stv = new PositionTrackingVisitor(rv, 0);
 		//DBCells are serialized before row records.

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java Tue Dec 31 15:12:30 2013
@@ -17,10 +17,11 @@
 
 package org.apache.poi.ss.formula.functions;
 
-import org.apache.poi.ss.formula.OperationEvaluationContext;
-import org.apache.poi.ss.formula.eval.*;
-
-import java.math.BigDecimal;
+import org.apache.poi.ss.formula.eval.ErrorEval;
+import org.apache.poi.ss.formula.eval.EvaluationException;
+import org.apache.poi.ss.formula.eval.OperandResolver;
+import org.apache.poi.ss.formula.eval.StringEval;
+import org.apache.poi.ss.formula.eval.ValueEval;
 
 /**
  * Implementation for Excel REPT () function.<p/>

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/signature/DigitalCertificatePart.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/signature/DigitalCertificatePart.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/signature/DigitalCertificatePart.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/signature/DigitalCertificatePart.java
Tue Dec 31 15:12:30 2013
@@ -41,38 +41,29 @@ public final class DigitalCertificatePar
 
 	@Override
 	public void close() {
-		// TODO Auto-generated method stub
-
 	}
 
 	@Override
 	public void flush() {
-		// TODO Auto-generated method stub
-
 	}
 
 	@Override
 	protected InputStream getInputStreamImpl() throws IOException {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
 	protected OutputStream getOutputStreamImpl() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
 	public boolean load(InputStream ios) throws InvalidFormatException {
-		// TODO Auto-generated method stub
 		return false;
 	}
 
 	@Override
 	public boolean save(OutputStream zos) throws OpenXML4JException {
-		// TODO Auto-generated method stub
 		return false;
 	}
-
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/signature/PackageDigitalSignature.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/signature/PackageDigitalSignature.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/signature/PackageDigitalSignature.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/signature/PackageDigitalSignature.java
Tue Dec 31 15:12:30 2013
@@ -34,37 +34,29 @@ public final class PackageDigitalSignatu
 
 	@Override
 	public void close() {
-		// TODO Auto-generated method stub
-
 	}
 
 	@Override
 	public void flush() {
-		// TODO Auto-generated method stub
-
 	}
 
 	@Override
 	protected InputStream getInputStreamImpl() throws IOException {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
 	protected OutputStream getOutputStreamImpl() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
 	public boolean load(InputStream ios) throws InvalidFormatException {
-		// TODO Auto-generated method stub
 		return false;
 	}
 
 	@Override
 	public boolean save(OutputStream zos) throws OpenXML4JException {
-		// TODO Auto-generated method stub
 		return false;
 	}
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java Tue Dec 31 15:12:30 2013
@@ -16,6 +16,10 @@
 ==================================================================== */
 package org.apache.poi.xslf;
 
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
 import org.apache.poi.POIXMLDocument;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
@@ -27,24 +31,7 @@ import org.apache.poi.util.Internal;
 import org.apache.poi.xslf.usermodel.XMLSlideShow;
 import org.apache.poi.xslf.usermodel.XSLFRelation;
 import org.apache.xmlbeans.XmlException;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTCommentList;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTNotesSlide;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTPresentation;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdList;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdListEntry;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideMaster;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideMasterIdList;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideMasterIdListEntry;
-import org.openxmlformats.schemas.presentationml.x2006.main.CmLstDocument;
-import org.openxmlformats.schemas.presentationml.x2006.main.NotesDocument;
-import org.openxmlformats.schemas.presentationml.x2006.main.PresentationDocument;
-import org.openxmlformats.schemas.presentationml.x2006.main.SldDocument;
-import org.openxmlformats.schemas.presentationml.x2006.main.SldMasterDocument;
-
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
+import org.openxmlformats.schemas.presentationml.x2006.main.*;
 
 /**
  * Experimental class to do low level processing of pptx files.
@@ -253,6 +240,7 @@ public class XSLFSlideShow extends POIXM
     /**
      * Get the document's embedded files.
      */
+    @Override
     public List<PackagePart> getAllEmbedds() throws OpenXML4JException {
         return embedds;
     }

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java Tue Dec 31 15:12:30
2013
@@ -22,15 +22,17 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 
 import junit.framework.TestCase;
 
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.openxml4j.opc.PackagePart;
 import org.apache.poi.openxml4j.opc.PackageRelationship;
-import org.apache.poi.util.TempFile;
 import org.apache.poi.util.PackageHelper;
+import org.apache.poi.util.TempFile;
 
 /**
  * Test recursive read and write of OPC packages
@@ -43,6 +45,7 @@ public final class TestPOIXMLDocument ex
             super(pkg);
         }
 
+        @Override
         public List<PackagePart> getAllEmbedds() {
             throw new RuntimeException("not supported");
         }
@@ -57,10 +60,12 @@ public final class TestPOIXMLDocument ex
         public TestFactory() {
             //
         }
+        @Override
         public POIXMLDocumentPart createDocumentPart(POIXMLDocumentPart parent, PackageRelationship
rel, PackagePart part){
             return new POIXMLDocumentPart(part, rel);
         }
 
+        @Override
         public POIXMLDocumentPart newDocumentPart(POIXMLRelation descriptor){
             throw new RuntimeException("not supported");
         }
@@ -73,6 +78,8 @@ public final class TestPOIXMLDocument ex
     private static void traverse(POIXMLDocumentPart part, HashMap<String,POIXMLDocumentPart>
context) throws IOException{
         context.put(part.getPackageRelationship().getTargetURI().toString(), part);
         for(POIXMLDocumentPart p : part.getRelations()){
+            assertNotNull(p.toString());
+            
             String uri = p.getPackageRelationship().getTargetURI().toString();
             if (!context.containsKey(uri)) {
                 traverse(p, context);
@@ -152,4 +159,19 @@ public final class TestPOIXMLDocument ex
         }
 
     }
+
+    public void testCommitNullPart() throws IOException, InvalidFormatException {
+        POIXMLDocumentPart part = new POIXMLDocumentPart();
+        part.prepareForCommit();
+        part.commit();
+        part.onSave(new HashSet<PackagePart>());
+
+        assertNull(part.getRelationById(null));
+        assertNull(part.getRelationId(null));
+        assertFalse(part.removeRelation(null, true));
+        part.removeRelation(null);
+        assertNull(part.toString());
+        part.onDocumentCreate();
+        //part.getTargetPart(null);
+    }
 }

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java Tue Dec
31 15:12:30 2013
@@ -18,7 +18,12 @@
  */
 package org.apache.poi.xslf.usermodel;
 
+import java.io.OutputStream;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
 import junit.framework.TestCase;
+
 import org.apache.poi.POIXMLDocumentPart;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellReference;
@@ -27,13 +32,6 @@ import org.apache.poi.xssf.usermodel.XSS
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.openxmlformats.schemas.drawingml.x2006.chart.*;
-import org.openxmlformats.schemas.drawingml.x2006.main.*;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector;
-
-import java.awt.*;
-import java.io.*;
-import java.util.LinkedHashMap;
-import java.util.Map;
 
 /**
  * @author Yegor Kozlov

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hssf/converter/TestExcelConverterSuite.java
Tue Dec 31 15:12:30 2013
@@ -63,6 +63,7 @@ public class TestExcelConverterSuite
             final String name = child.getName();
             suite.addTest( new TestCase( name + " [FO]" )
             {
+                @Override
                 public void runTest() throws Exception
                 {
                     testFo( child );
@@ -70,6 +71,7 @@ public class TestExcelConverterSuite
             } );
             suite.addTest( new TestCase( name + " [HTML]" )
             {
+                @Override
                 public void runTest() throws Exception
                 {
                     testHtml( child );

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java?rev=1554535&r1=1554534&r2=1554535&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java Tue Dec 31
15:12:30 2013
@@ -16,28 +16,6 @@
 ==================================================================== */
 package org.apache.poi.hssf.model;
 
-import junit.framework.TestCase;
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.HSSFTestDataSamples;
-import org.apache.poi.hssf.record.ContinueRecord;
-import org.apache.poi.hssf.record.DrawingRecord;
-import org.apache.poi.hssf.record.EOFRecord;
-import org.apache.poi.hssf.record.EscherAggregate;
-import org.apache.poi.hssf.record.NoteRecord;
-import org.apache.poi.hssf.record.ObjRecord;
-import org.apache.poi.hssf.record.Record;
-import org.apache.poi.hssf.record.RecordBase;
-import org.apache.poi.hssf.record.RecordFactory;
-import org.apache.poi.hssf.record.TextObjectRecord;
-import org.apache.poi.hssf.record.WindowTwoRecord;
-import org.apache.poi.hssf.record.aggregates.RowRecordsAggregate;
-import org.apache.poi.hssf.usermodel.HSSFPatriarch;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFTestHelper;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.util.HexDump;
-import org.apache.poi.util.HexRead;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -49,6 +27,23 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import junit.framework.TestCase;
+
+import org.apache.poi.ddf.DefaultEscherRecordFactory;
+import org.apache.poi.ddf.EscherContainerRecord;
+import org.apache.poi.ddf.EscherDggRecord;
+import org.apache.poi.ddf.EscherRecord;
+import org.apache.poi.ddf.EscherRecordFactory;
+import org.apache.poi.hssf.HSSFTestDataSamples;
+import org.apache.poi.hssf.record.*;
+import org.apache.poi.hssf.record.aggregates.RowRecordsAggregate;
+import org.apache.poi.hssf.usermodel.HSSFPatriarch;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFTestHelper;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.HexRead;
+
 /**
  * @author Yegor Kozlov
  * @author Evgeniy Berlog
@@ -179,6 +174,9 @@ public class TestDrawingAggregate extend
                     }
                 }
         );
+        assertNotNull(
+                "Need to find files in test-data path, had path: " + new File(System.getProperty("POI.testdata.path"),
"spreadsheet"), 
+                xls);
         for(File file : xls) {
             HSSFWorkbook wb;
             try {



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


Mime
View raw message