joergreichert / spray

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

Remove workaround for Duplicate JVMIdentifiableElement #178

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
While inferring methods and their parameters I got a Duplicate 
JVMIdentifiableElement error for the created method parameters. This prevents 
the model inferrer to produce the Java code. I had to fix this be computing the 
parameter name by using the current model element name, although the parameter 
name is completely independent of the model element and its uniqueness should 
be scoped sufficiently by the inferred class.

Moreover as of modularization I have to generate a reassignment of the model 
element derived parameter name to the the actually intented parameter name, e.g.

parameters += element.toParameter("targetContainer" + 
element.name.toFirstUpper, targetContainer)
parameters += element.toParameter("sprayStyle" + element.name.toFirstUpper, 
sprayStyle)
body = [ 
  var appendable = append('''// Create a ContainerShape for this Shape''').newLine
  appendable = appendable.append(shapeGenerator.containerShapeType).append(''' targetContainer = targetContainer''' + element.name.toFirstUpper + ''';''').newLine
  appendable = appendable.append(shapeGenerator.iSprayStyleType).append(''' sprayStyle = sprayStyle''' + element.name.toFirstUpper + ''';''').newLine
  appendable = appendable.append(shapeGenerator.diagramType).append(''' diagram = peService.getDiagramForShape(targetContainer);''').newLine

cf. 
http://code.google.com/a/eclipselabs.org/p/spray/source/browse/plugins/org.eclip
selabs.spray.shapes/src/org/eclipselabs/spray/shapes/jvmmodel/ShapeDefinitionTyp
eInferrer.xtend

Original issue reported on code.google.com by de.abg.r...@gmail.com on 24 Sep 2012 at 5:10

GoogleCodeExporter commented 9 years ago
moved inferer code to branch:

http://code.google.com/a/eclipselabs.org/p/spray/source/browse/plugins/org.eclip
selabs.spray.shapes/src/org/eclipselabs/spray/shapes/jvmmodel/ShapeDefinitionTyp
eInferrer.xtend?name=styles_shapes_inferer

Original comment by de.abg.r...@gmail.com on 1 Oct 2012 at 8:19

GoogleCodeExporter commented 9 years ago
discontinued complete inferer migration in favor for combination of small 
inferer + common generator

Original comment by de.abg.r...@gmail.com on 10 Oct 2012 at 5:26