Skip to content

Commit

Permalink
follow famix2Java style
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed May 2, 2024
1 parent 486dbef commit 89b5763
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Carrefour-Exporter/CRFExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ CRFExporter >> visitMethod: aMethod [
aMethod isStub ifTrue: [ ^ self ].
self printMethodAnnotations: aMethod.
self indent.
aMethod isPrivate ifTrue: [ self <<< 'private ' ].
aMethod isProtected ifTrue: [ self <<< 'protected ' ].
aMethod isPublic ifTrue: [ self <<< 'public ' ].
aMethod isClassSide ifTrue: [ self <<< 'static ' ].
aMethod isPrivate ifTrue: [ self << 'private ' ].
aMethod isProtected ifTrue: [ self << 'protected ' ].
aMethod isPublic ifTrue: [ self << 'public ' ].
aMethod isClassSide ifTrue: [ self << 'static ' ].
"Printing return type for method"
aMethod declaredType ifNotNil: [ :declaredType |
self printDeclaredType: declaredType.
Expand All @@ -27,28 +27,28 @@ CRFExporter >> visitMethod: aMethod [
aMethod isAnInitializer and: [ aMethod isConstructor not ] ])
ifFalse: [
self
<<< aMethod name;
<<< '('.
<< aMethod name;
<< '('.
(aMethod parameters sorted: [ :p :p2 |
p sourceAnchor startPos < p2 sourceAnchor startPos ])
do: [ :parameter | parameter accept: self clone ]
separatedBy: [ self <<< ', ' ].
self <<< ')' ]
separatedBy: [ self << ', ' ].
self << ')' ]
ifTrue: [ self << 'static' ].
"print exception"
((aMethod withMethodsOverriding collect: [ :m |
m thrownExceptions , m declaredExceptions ]) flattened asSet
asOrderedCollection sorted: #name ascending) ifNotEmpty: [
:exceptions |
self <<< ' throws '.
self << ' throws '.
exceptions
do: [ :exception | self <<< exception name ]
separatedBy: [ self <<< ', ' ] ].
do: [ :exception | self << exception name ]
separatedBy: [ self << ', ' ] ].

"Printing body of method if class is not abstract or an interface"
((aMethod atScope: FamixTClass) anyOne isInterface or: [
aMethod isAbstract isNotNil and: [ aMethod isAbstract ] ])
ifTrue: [ self <<< ';' ]
ifTrue: [ self << ';' ]
ifFalse: [
aMethod fast
ifNotNil: [ :fastMethod |
Expand All @@ -57,14 +57,14 @@ CRFExporter >> visitMethod: aMethod [
outputStream: self currentStream;
indentSize: tabulationSize;
yourself.
self <<< ' '.
self << ' '.
1 to: tabs do: [ :tab | fastJavaExporterVisitor indent ].
fastMethod statementBlock accept: fastJavaExporterVisitor ]
ifNil: [
currentStream << ' {'.
self << ' {'.
self eol.
self <<< aMethod bodySourceText.
self << aMethod bodySourceText.
self
eol;
<< '}' ] ]
<<| '}' ] ]
]

0 comments on commit 89b5763

Please sign in to comment.