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 2016/07/24 11:38:50 UTC

svn commit: r1753912 - in /poi/trunk/src: java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java java/org/apache/poi/ss/usermodel/Workbook.java ooxml/java/org/apache/poi/POIXMLDocument.java ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java

Author: centic
Date: Sun Jul 24 11:38:50 2016
New Revision: 1753912

URL: http://svn.apache.org/viewvc?rev=1753912&view=rev
Log:
Bug 59634: Clarify and refine JavaDoc of various close() methods to consistently state that close() invalidates the object

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java
    poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java?rev=1753912&r1=1753911&r2=1753912&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java Sun Jul 24 11:38:50 2016
@@ -548,7 +548,7 @@ public final class HSSFWorkbook extends
      * the 'active' sheet (which is the sheet with focus).
      * Unselects sheets that are not in <code>indexes</code>.
      *
-     * @param indexes
+     * @param indexes Array of sheets to select, the index is 0-based.
      */
     public void setSelectedTabs(int[] indexes) {
         Collection<Integer> list = new ArrayList<Integer>(indexes.length);
@@ -563,7 +563,7 @@ public final class HSSFWorkbook extends
      * the 'active' sheet (which is the sheet with focus).
      * Unselects sheets that are not in <code>indexes</code>.
      *
-     * @param indexes
+     * @param indexes Collection of sheets to select, the index is 0-based.
      */
     public void setSelectedTabs(Collection<Integer> indexes) {
 
@@ -893,8 +893,7 @@ public final class HSSFWorkbook extends
      */
     @Override
     public Iterator<Sheet> sheetIterator() {
-        Iterator<Sheet> result = new SheetIterator<Sheet>();
-        return result;
+        return new SheetIterator<Sheet>();
     }
 
     /**
@@ -1280,9 +1279,9 @@ public final class HSSFWorkbook extends
 
     /**
      * Closes the underlying {@link NPOIFSFileSystem} from which
-     *  the Workbook was read, if any. Has no effect on Workbooks
-     *  opened from an InputStream, or newly created ones.
-     * <p>Once {@link #close()} has been called, no further 
+     *  the Workbook was read, if any.
+     *
+     * <p>Once this has been called, no further
      *  operations, updates or reads should be performed on the 
      *  Workbook.
      */

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java?rev=1753912&r1=1753911&r2=1753912&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java Sun Jul 24 11:38:50 2016
@@ -341,9 +341,11 @@ public interface Workbook extends Closea
 
     /**
      * Close the underlying input resource (File or Stream),
-     *  from which the Workbook was read. After closing, the
-     *  Workbook should no longer be used.
-     * <p>This will have no effect newly created Workbooks.
+     *  from which the Workbook was read.
+     *
+     * <p>Once this has been called, no further
+     *  operations, updates or reads should be performed on the
+     *  Workbook.
      */
     @Override
     void close() throws IOException;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java?rev=1753912&r1=1753911&r2=1753912&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java Sun Jul 24 11:38:50 2016
@@ -193,8 +193,12 @@ public abstract class POIXMLDocument ext
     /**
      * Closes the underlying {@link OPCPackage} from which this
      *  document was read, if there is one
-     * 
-     * @throws IOException for writable packages, if an IO exception occur during the saving process. 
+     *
+     * <p>Once this has been called, no further
+     *  operations, updates or reads should be performed on the
+     *  document.
+     *
+     * @throws IOException for writable packages, if an IO exception occur during the saving process.
      */
     @Override
     public void close() throws IOException {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java?rev=1753912&r1=1753911&r2=1753912&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java Sun Jul 24 11:38:50 2016
@@ -893,8 +893,11 @@ public class SXSSFWorkbook implements Wo
 
     /**
      * Closes the underlying {@link XSSFWorkbook} and {@link OPCPackage} 
-     *  on which this Workbook is based, if any. Has no effect on Workbooks
-     *  created from scratch.
+     *  on which this Workbook is based, if any.
+     *
+     * <p>Once this has been called, no further
+     *  operations, updates or reads should be performed on the
+     *  Workbook.
      */
     @Override
     public void close() throws IOException {



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