Skip to content

Commit

Permalink
Exporter: filterAttributesToSet:for: takes a type instead of an object
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed Oct 30, 2024
1 parent e18362d commit df294fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ FamixValue2FASTJavaVisitor >> ensureReflectionField: attribute [
]

{ #category : 'private' }
FamixValue2FASTJavaVisitor >> filterAttributesToSet: attributes for: object [
FamixValue2FASTJavaVisitor >> filterAttributesToSet: attributes for: type [
"No need to set attributes that are set in the constructor."

^ constructorCache
at: object type
at: type
ifPresent: [ :constructor |
constructorCache
at: constructor
Expand Down Expand Up @@ -487,7 +487,7 @@ FamixValue2FASTJavaVisitor >> makeHelperClass [
addModifier: (model newModifier token: 'public');
addDeclaration: (model newMethodEntity
name: 'ModestHelper';
modifiers: { (model newModifier token: 'private') };
addModifier: (model newModifier token: 'private');
statementBlock: model newStatementBlock);
yourself
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FamixValueHelperObjectExportStrategy >> buildMethodFor: object withParametersFor
visitor constructObject: object.
self
makeSetterInvocationsFor:
(visitor filterAttributesToSet: attributes for: object)
(visitor filterAttributesToSet: attributes for: object type)
on: visitor.
visitor statementBlock addStatement:
(model newReturnStatement expression:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ Class {
FamixValueInlineObjectExportStrategy >> export: object on: visitor [

visitor constructObject: object.
(visitor filterAttributesToSet: object relevantAttributes for: object)
do: [ :attribute | visitor visitObjectAttribute: attribute ]
(visitor
filterAttributesToSet: object relevantAttributes
for: object type) do: [ :attribute |
visitor visitObjectAttribute: attribute ]
]

{ #category : 'ast' }
Expand Down

0 comments on commit df294fa

Please sign in to comment.