Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361377

Summary: CsvHelper: ArrayIndexOutOfBoundsException
Product: z_Archived Reporter: Christoph Schwank <christoph.schwank>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: claudio.guglielmo
Version: unspecifiedFlags: claudio.guglielmo: juno+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch for the described bug claudio.guglielmo: iplog+

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)