Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314832 - ->eAllContents is proposed but fails silently
Summary: ->eAllContents is proposed but fails silently
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 1.0.0   Edit
Hardware: PC All
: P2 major
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 321226 363444 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-28 05:16 EDT by Cedric Brun CLA
Modified: 2016-03-22 11:14 EDT (History)
4 users (show)

See Also:


Attachments
Patch (4.69 KB, patch)
2010-07-05 05:12 EDT, Stephane Begaudeau CLA
no flags Details | Diff
Patch v2 (1.95 KB, patch)
2010-07-06 08:20 EDT, Stephane Begaudeau CLA
laurent.goubet: iplog+
Details | Diff
revised patch (2.02 KB, patch)
2010-07-06 11:04 EDT, Laurent Goubet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2010-05-28 05:16:25 EDT
I'm using Acceleo 3.0.0RC2.
If I write :

[template public generate(e : Document)]
	
	[comment @main /]
	[file ('test.html', false, 'UTF-8')]
	<html>
	[e->eAllContents().toHTML()/]
	</html>
	[/file]
	
[/template] 


[template public toHTML (elem : OclAny) ]
<!-- not handled yet  [elem.eClass().name/] -->
[/template]

The template compile finely, the completion even proposed me the eAllContents string after the "->", but II only get 
"
	<html>
	org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1b12d63 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@11ae567 (name: OclInvalid_Class) (instanceClassName: null) (abstract: false, interface: false))
	</html>
"
in my generated file.

Once I change the ->eAllContents() to .eAllContents() then everything work as expected.
Comment 1 Jonathan MUSSET CLA 2010-05-28 05:32:11 EDT
Priority and severity have changed
Comment 2 Stephane Begaudeau CLA 2010-07-05 05:12:33 EDT
Created attachment 173396 [details]
Patch

With this patch, the completion process is improved.
- Now all the collection types (collection, set, ordered set, bag, sequence) will have access to our "collection non standard operations" in the completion window. These operations are Sep(String) : Sequence(OclAny) and Filter(OclType) : Collection(T)

- The ordered set and the sequence will have access to their non standard operations too. These operations are reverse() : OrderedSet(T) and lastIndexOf(T) : Integer
Comment 3 Stephane Begaudeau CLA 2010-07-06 08:20:43 EDT
Created attachment 173533 [details]
Patch v2

Refactoring of the previous patch
Comment 4 Laurent Goubet CLA 2010-07-06 11:04:32 EDT
Created attachment 173566 [details]
revised patch

This slightly revised patch removes unnecessary tests and prevents Acceleo from adding wrong completion proposals on Set and Bag.
Comment 5 Laurent Goubet CLA 2010-07-06 11:06:27 EDT
Patch commited on HEAD and available on maintenance
Comment 6 Laurent Goubet CLA 2010-07-29 10:18:50 EDT
*** Bug 321226 has been marked as a duplicate of this bug. ***
Comment 7 Stephane Begaudeau CLA 2010-09-13 23:29:14 EDT
Reopened because the patch has created a problem with the non standard library of Acceleo. This patch has been reverted in Acceleo 3.0.1 RC4 and Acceleo 3.1.0 M2. Another fix will be provided.
Comment 8 Stephane Begaudeau CLA 2011-11-10 04:59:18 EST
*** Bug 363444 has been marked as a duplicate of this bug. ***
Comment 9 Eclipse Genie CLA 2016-03-18 11:31:38 EDT
New Gerrit change created: https://git.eclipse.org/r/68784
Comment 10 Laurent Goubet CLA 2016-03-18 12:03:46 EDT
Review https://git.eclipse.org/r/#/c/68784/ removes EObject operation proposals from the collection completion ('->' operator) without presenting the bug 322145 regression observed back then.