From 796f89df27371a2272d59e4b6fc4623d3fb8cca8 Mon Sep 17 00:00:00 2001 From: Gabriel Darbord Date: Sun, 14 Jan 2024 23:02:04 +0100 Subject: [PATCH] Update exporter --- .../FamixValue2FASTJavaVisitor.class.st | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st b/src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st index f428bcc..af82bb0 100644 --- a/src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st +++ b/src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st @@ -73,7 +73,7 @@ FamixValue2FASTJavaVisitor >> findConstructorFor: object [ constructors detect: [ :constructor | constructor isPublic ] ifNone: [ "fallback to using reflection" - self markedForReflection add: constructors anyOne ] ] ] + self markedForReflection add: constructors first ] ] ] ] { #category : #private } @@ -163,12 +163,21 @@ FamixValue2FASTJavaVisitor >> makeReflectionSetterInvocation: attribute [ { #category : #ast } FamixValue2FASTJavaVisitor >> makeSetterInvocation: setter for: attribute [ + self + makeSetterInvocation: setter + for: attribute + named: (self varNameFor: attribute value) +] + +{ #category : #ast } +FamixValue2FASTJavaVisitor >> makeSetterInvocation: setter for: attribute named: aString [ + self statementBlock addStatement: (self model newExpressionStatement expression: (model newMethodInvocation receiver: (self makeIdentifier: attribute object); name: setter name; - addArgument: (self makeVariableExpression: attribute value); + addArgument: (model newVariableExpression name: aString); famixMethod: setter)) ]