Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361377 - CsvHelper: ArrayIndexOutOfBoundsException
Summary: CsvHelper: ArrayIndexOutOfBoundsException
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-19 07:25 EDT by Christoph Schwank CLA
Modified: 2021-08-19 11:24 EDT (History)
1 user (show)

See Also:
claudio.guglielmo: juno+


Attachments
patch for the described bug (1.79 KB, patch)
2011-10-19 07:26 EDT, Christoph Schwank CLA
claudio.guglielmo: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Schwank CLA 2011-10-19 07:25:14 EDT
Build Identifier: M20110210-1200

If the array holding the column names is not null but has no entries (length = 0) an ArrayIndexOutOfBoundsException occurs in the method importData because a check tries to check the first entry in the array (line 227).

Furthermore this exception will be catched a few lines below and a new exception will be thrown without passing the stack trace of the original exception.



Reproducible: Always

Steps to Reproduce:
1. set an empty List as column names: CsvHelper.setColumnNames(new ArrayList<String>())
2. import data: CsvHelper.importData(....) 
3.
Comment 1 Christoph Schwank CLA 2011-10-19 07:26:40 EDT
Created attachment 205506 [details]
patch for the described bug
Comment 2 Claudio Guglielmo CLA 2012-03-27 11:20:47 EDT
Thank you for the patch. Committed for 3.8.0. 

Btw: I removed the serializable check because I don't think it's necessary.
Comment 3 Matthias Zimmermann CLA 2012-07-09 06:50:10 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)