Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error during read file java.lang.IndexOutOfBoundsException #91

Closed
marekzzz opened this issue May 8, 2017 · 7 comments
Closed

error during read file java.lang.IndexOutOfBoundsException #91

marekzzz opened this issue May 8, 2017 · 7 comments

Comments

@marekzzz
Copy link

marekzzz commented May 8, 2017

Detailed printstack:

java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
	at java.util.ArrayList.get(ArrayList.java:429)
	at com.monitorjbl.xlsx.impl.StreamingWorkbookReader.loadSheets(StreamingWorkbookReader.java:146)
	at com.monitorjbl.xlsx.impl.StreamingWorkbookReader.init(StreamingWorkbookReader.java:129)
	at com.monitorjbl.xlsx.impl.StreamingWorkbookReader.init(StreamingWorkbookReader.java:88)
	at com.monitorjbl.xlsx.StreamingReader$Builder.open(StreamingReader.java:263)

I use version 1.1.0

<groupId>com.monitorjbl</groupId>
<artifactId>xlsx-streamer</artifactId>

Additional info:
File contines 4 sheet-s.

@monitorjbl
Copy link
Owner

Yeah, I just ran into this as well. Most of the unit tests were still using the old API, so this particular bit of code was not tested as thoroughly. I was in the process of converting them over as the old API is going to be removed in the near future and I hit this.

Not sure what triggers it yet, at first glance it appears that some workbooks have two sets of sheet properties for the same sheet.

@monitorjbl
Copy link
Owner

There's a fix in the latest code if you'd like to try it out. I still have no idea why some sheets have two sets of sheet refs for the same sheet though. The problem stems from this call, in almost every case that iterator contains the same number of values as there are sheets. But for a couple of test cases, it has a duplicate value.

@marekzzz
Copy link
Author

marekzzz commented May 9, 2017

Additionally

It occurs when a ran code:

InputStream is = new FileInputStream(new File(path));
Workbook workbook = StreamingReader.builder()
                .rowCacheSize(100)
                .bufferSize(4096).open(is);

I can test latest code. Could You give me a maven dependency to some snapshot jar.

Regards Marek

@marekzzz
Copy link
Author

Hello, when might the version with the bug fix will be released?

@monitorjbl
Copy link
Owner

It's going to be a couple of weeks. In the meantime you can install the code locally to see if this fixes your issue.

@marthursson
Copy link

The bug fix appears to be working (verified against latest code in repo). Any new info on when the 1.2 version might be released?

@monitorjbl
Copy link
Owner

Just released to Maven Central now. Should be available in the next few hours!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants