joergreichert / spray

Automatically exported from code.google.com/p/spray
1 stars 2 forks source link

CreateConnectionFeature List in FeatureProvider lacks comma #107

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
    def generate_getCreateConnectionFeatures (Diagram diagram) '''
        «overrideHeader»
        public ICreateConnectionFeature[] getCreateConnectionFeatures() {
            return new ICreateConnectionFeature[] {
            «FOR cls : diagram.metaClasses.filter(e|e.representedBy instanceof Connection) SEPARATOR ","»
                new «cls.createFeatureClassName.shortName»(this)
            «ENDFOR»
            «IF ! diagram.metaClasses.filter(e|e.representedBy instanceof Connection).isEmpty »
            ,
            «ENDIF»
            «FOR metaClass : diagram.metaClasses»
                «FOR reference : metaClass.references.filter(ref|ref.representedBy != null) SEPARATOR ","»
                      new «reference.createReferenceAsConnectionFeatureClassName.shortName»(this)
                «ENDFOR»
            «ENDFOR»
            };
        }
    '''

When there are multiple references of the same kind there is no comma generated 
in the code.

Original issue reported on code.google.com by de.abg.r...@gmail.com on 11 Jan 2012 at 9:40

GoogleCodeExporter commented 9 years ago
head + tail + BEFORE (as ITERATOR is not supported anymore in FOR loops) to 
produce the comma

Original comment by de.abg.r...@gmail.com on 15 Jan 2012 at 3:35