question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IndexOutOfBoundsException in StandardFormulaProcessor

See original GitHub issue

I use a snapshot build including #73 with activated exception throwing. A testcase fails:

AreaRef formulaTargetAreaRef = formulaCellData.getTargetParentAreaRef().get(i);

Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at org.jxls.formula.StandardFormulaProcessor.processAreaFormulas(StandardFormulaProcessor.java:63)
at org.jxls.area.XlsArea.processFormulas(XlsArea.java:571)
at org.jxls.util.JxlsHelper.processTemplate(JxlsHelper.java:273)

@leonate Can you fix this without a testcase? I can’t publish a testcase for this ugly complex report. But I can test it with our testcase from your feature branch.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
iamforrestcommented, May 2, 2022

@leonate I have tested the last codes, and I found that rows between commands still lost. After I debugged the codes, I found that line 178 in XlsArea.java:

transformStaticCells(cellRef, context, startRow, 0, startRow, startCol - 1);

should change to

transformStaticCells(cellRef, context, lastProcessedRow, 0, startRow, size.getWidth() - 1);

I am not sure whether it is a perfect solution for this issue. Hope it helps. Thanks.

1reaction
leonatecommented, Apr 2, 2022

Can you share more data variables from the 1st call to transformStaticCells() at XlsArea.applyAt(CellRef, Context) line: 178 ? I suspect this call should not have happened, so perhaps the condition has to be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IndexOutOfBoundsException in StandardFormulaProcessor
IndexOutOfBoundsException in StandardFormulaProcessor. Issue #207 resolved. Marcus Warm created an issue 2020-02-21.
Read more >
Why do I get IndexOutOfBoundsException - Stack Overflow
The exercise question: Create the method lengths that gets a list of String variables as a parameter and returns an ArrayList that contains...
Read more >
Version History - JXLS - - SourceForge
POI 4.0 requires Java 8 and so it is the recommended version to use. JXLS code base will be migrated to Java 8...
Read more >
jxls - bytemeta
IndexOutOfBoundsException in StandardFormulaProcessor · Tables Render Issue if they are of different number of columns · Exception when creating report 2nd time.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found