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

Bug 334283

Summary: NoSuchElementException when a file path is empty
Product: [Modeling] Acceleo Reporter: Tristan Faure <faure.tristan>
Component: CoreAssignee: Laurent Goubet <laurent.goubet>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: contributed
Version: 3.0.0   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
a sample with error occuring
none
patch adding exception
laurent.goubet: iplog+
mylyn/context/zip none

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.