Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334283 - NoSuchElementException when a file path is empty
Summary: NoSuchElementException when a file path is empty
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Windows XP
: P3 normal
Target Milestone: Future   Edit
Assignee: Laurent Goubet CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2011-01-13 11:42 EST by Tristan Faure CLA
Modified: 2011-01-19 03:44 EST (History)
0 users

See Also:


Attachments
a sample with error occuring (19.06 KB, application/octet-stream)
2011-01-13 11:45 EST, Tristan Faure CLA
no flags Details
patch adding exception (2.41 KB, patch)
2011-01-18 03:08 EST, Tristan Faure CLA
laurent.goubet: iplog+
Details | Diff
mylyn/context/zip (767 bytes, application/octet-stream)
2011-01-18 03:08 EST, Tristan Faure CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Faure CLA 2011-01-13 11:42:34 EST
When you try to generate a file using a template to compute the path 
a exception occurs NosuchElementException. I am trying to create a sample project to make it reproducible, anyway the problem occurs when a file path is empty (not an empty string). 

[template public genFileName(classifier : uml::Classifier, ext : String) 
? (true) post(trim())][/template]
Comment 1 Tristan Faure CLA 2011-01-13 11:45:18 EST
Created attachment 186747 [details]
a sample with error occuring

launch Generate on the uml model, the error occurs
Comment 2 Tristan Faure CLA 2011-01-18 03:08:07 EST
Created attachment 186972 [details]
patch adding exception

the patch
Comment 3 Tristan Faure CLA 2011-01-18 03:08:09 EST
Created attachment 186973 [details]
mylyn/context/zip
Comment 4 Tristan Faure CLA 2011-01-18 03:08:23 EST
Thanks to laurent this patch throws a correct exception when the file name is empty. This log an error and the generation can continue.

Just a question, it seems the key AcceleoEvaluationVisitor.NotStringFileURL is not present in acceleoenginemessages.properties
Comment 5 Laurent Goubet CLA 2011-01-19 03:40:37 EST
Thanks for the patch, this has been commited on both HEAD and 3.0 maintenance. As for the NotStringFileURL key ... seems like an oversight. That's been fixed too.