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

Bug 342916

Summary: [domainmodel] Use filter in DomainmodelGenerator
Product: [Modeling] TMF Reporter: Karsten Thoms <karsten.thoms>
Component: CommonAssignee: Project Inbox <tmf.common-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: trivial    
Priority: P3 CC: christian.dietrich.opensource
Version: 2.0.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
proposed patch none

Description Karsten Thoms CLA 2011-04-15 00:00:31 EDT
In the Xtend class DomainmodelGenerator there is still a TODO to use filtering:

	override void doGenerate(Resource resource, IFileSystemAccess fsa) {
		// TODO: use filter
		for(element: resource.allContentsIterable) {
			if(element instanceof Entity) {
				val entity = element as Entity				
				fsa.generateFile(entity.fileName, entity.compile)
			}
		}
	}

	
This snippet should be changed to:

  override void doGenerate(Resource resource, IFileSystemAccess fsa) {
    for(entity: resource.allContentsIterable.filter(typeof(Entity))) {
        fsa.generateFile(entity.fileName, entity.compile)
    }
  }
Comment 1 Karsten Thoms CLA 2011-04-15 00:18:15 EDT
Created attachment 193320 [details]
proposed patch
Comment 2 Christian Dietrich CLA 2016-08-19 02:43:50 EDT
Domainmodel example is now based on jvm model inferrer.
other examples use filter