[Bug 62993] SUMIF returns wrong result (POI 4.0.x)

2019-01-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62993

gallon.fi...@gmail.com  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #7 from gallon.fi...@gmail.com  ---
Fixed via r1850212. I rework both test and implementation but thanks to Axel
Howind for the report and the primary idea.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62993] SUMIF returns wrong result (POI 4.0.x)

2018-12-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62993

Axel Howind  changed:

   What|Removed |Added

 OS|Mac OS X 10.1   |All
   Hardware|PC  |All

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62993] SUMIF returns wrong result (POI 4.0.x)

2018-12-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62993

Axel Howind  changed:

   What|Removed |Added

  Attachment #36313|0   |1
is obsolete||
  Attachment #36315|0   |1
is obsolete||

--- Comment #5 from Axel Howind  ---
Created attachment 36319
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36319=edit
Patch with bugfix and testcase

Revised patch, now all unit tests pass. I have also added a new test case for
this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62993] SUMIF returns wrong result (POI 4.0.x)

2018-12-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62993

--- Comment #4 from Axel Howind  ---
Sorry, it seems this patch introduces a regression that I didn't see because
Junit was broken on my machine (I opened Bug 62996 for that problem). Now that
Junit is up and running again, I will look into the regression this has created
and create a updated patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62993] SUMIF returns wrong result (POI 4.0.x)

2018-12-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62993

--- Comment #3 from Axel Howind  ---
Created attachment 36315
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36315=edit
Patch that fixes bug 62993

Patch to fix Bug 62993

`XSSFEvaluationSheet` uses an internal cache to speed up evaluations. It also
contains an integer field `_lastDefinedRow` to avoid calling `getLastRowNum()`
for the spreadsheet which is costly because it looks up the last entry in a
sorted map which should be O(log(n)) for the implementation used (with n being
the number of rows).

The problem is, that `_lastDefinedRow` is evaluated only once when the
`XSSFEvaluationSheet` is created and not updated when rows are added later.

This patch removes `XSSFEvaluationSheet._lastDefinedRow` and instead always
uses `_xs.getLastRowNum()`. Runtime performance should be unaffected or even
better because I moved the optimization (caching of the last row number) up to
`XSSFSheet`, so that other code will also benefit.

Please review and comment.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62993] SUMIF returns wrong result (POI 4.0.x)

2018-12-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62993

--- Comment #2 from Axel Howind  ---
It turns out that this probably not only affects SUMIF but possibly all
functions that operate on ranges. Bug is triggered when rows are added after
the first formula evaluation is done. I have prepared a patch and will include
a more detailed description there.

Please note that this is almost certainly a regression from POI 3.x since the
Ruby code we use produced correct results before upgrading, and the changes
during upgrade were rather cosmetically (exchanging ints with enums in some
places).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62993] SUMIF returns wrong result (POI 4.0.x)

2018-12-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62993

--- Comment #1 from Axel Howind  ---
Created attachment 36313
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36313=edit
JUnit test for this

The attachment contains a JUnit test case for this bug. I am unsure where this
should end up in the POI source tree though.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org