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 2021/04/26 15:12:26 UTC
svn commit: r1889204 - in
/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming:
SXSSFEvaluationSheet.java SXSSFFormulaEvaluator.java
Author: centic
Date: Mon Apr 26 15:12:26 2021
New Revision: 1889204
URL: http://svn.apache.org/viewvc?rev=1889204&view=rev
Log:
Improve error message when formulas cannot be evaluated for some rows in SXSSF
Modified:
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFEvaluationSheet.java
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFEvaluationSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFEvaluationSheet.java?rev=1889204&r1=1889203&r2=1889204&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFEvaluationSheet.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFEvaluationSheet.java Mon Apr 26 15:12:26 2021
@@ -44,7 +44,7 @@ final class SXSSFEvaluationSheet impleme
public int getLastRowNum() {
return _xs.getLastRowNum();
}
-
+
/* (non-Javadoc)
* @see org.apache.poi.ss.formula.EvaluationSheet#isRowHidden(int)
* @since POI 4.1.0
@@ -60,7 +60,7 @@ final class SXSSFEvaluationSheet impleme
SXSSFRow row = _xs.getRow(rowIndex);
if (row == null) {
if (rowIndex <= _xs.getLastFlushedRowNum()) {
- throw new SXSSFFormulaEvaluator.RowFlushedException(rowIndex);
+ throw new SXSSFFormulaEvaluator.RowFlushedException(rowIndex, _xs.getLastFlushedRowNum());
}
return null;
}
@@ -70,7 +70,7 @@ final class SXSSFEvaluationSheet impleme
}
return new SXSSFEvaluationCell(cell, this);
}
-
+
/* (non-JavaDoc), inherit JavaDoc from EvaluationSheet
* @since POI 3.15 beta 3
*/
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java?rev=1889204&r1=1889203&r2=1889204&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java Mon Apr 26 15:12:26 2021
@@ -112,7 +112,10 @@ public final class SXSSFFormulaEvaluator
// Check if any rows have already been flushed out
int lastFlushedRowNum = ((SXSSFSheet) sheet).getLastFlushedRowNum();
if (lastFlushedRowNum > -1) {
- if (! skipOutOfWindow) throw new RowFlushedException(0);
+ if (!skipOutOfWindow) {
+ throw new RowFlushedException(0, lastFlushedRowNum);
+ }
+
LOG.atInfo().log("Rows up to {} have already been flushed, skipping", box(lastFlushedRowNum));
}
}
@@ -146,8 +149,8 @@ public final class SXSSFFormulaEvaluator
}
}
public static class RowFlushedException extends IllegalStateException {
- protected RowFlushedException(int rowNum) {
- super("Row " + rowNum + " has been flushed, cannot evaluate all cells");
+ protected RowFlushedException(int rowNum, int lastFlushedRowNum) {
+ super("Row " + rowNum + " has been flushed (rows up to " + lastFlushedRowNum + " have been flushed), cannot evaluate all cells");
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org