@@ -197,27 +197,16 @@ FAMIX2JavaVisitor >> visitAnnotationInstanceAttribute: aAnnotationInstanceAttrib
197
197
FAMIX2JavaVisitor >> visitAttribute: aAttribute [
198
198
" Visit an attribute to print its annotations and its field."
199
199
200
- | body |
201
200
" Printing the annotations for the attribute"
202
201
aAttribute annotationInstances
203
202
do: [ :annotationInstance |
204
203
self clone visit: annotationInstance.
205
204
self crlf ].
206
205
207
206
" Printing modifiers"
208
- aAttribute modifiers
209
- ifNotEmpty: [ self
210
- << aAttribute modifiers first;
211
- space ].
212
- 2 to: aAttribute modifiers size - 1 do: [ :index |
213
- self
214
- space;
215
- <<< (aAttribute modifiers at: index) ].
216
- aAttribute modifiers size > 1
217
- ifTrue: [ self
218
- <<< aAttribute modifiers last;
219
- space ].
220
-
207
+ self indent.
208
+ aAttribute modifiers do: [ :modifier | self <<< modifier; space ].
209
+
221
210
" Declared Type"
222
211
self printDeclaredType: aAttribute declaredType.
223
212
" Attribute name"
@@ -226,15 +215,8 @@ FAMIX2JavaVisitor >> visitAttribute: aAttribute [
226
215
<<< aAttribute name;
227
216
space.
228
217
(aAttribute sourceAnchor sourceText includesSubstring: ' =' )
229
- ifTrue: [ body := aAttribute sourceAnchor sourceText
230
- copyFrom: (aAttribute sourceAnchor sourceText findString: ' =' )
231
- to:
232
- (aAttribute sourceAnchor sourceText
233
- findLastOccurrenceOfString: ' ;'
234
- startingAt: 0 ) ].
235
- body isNotNil
236
- ifTrue: [ self <<< body ]
237
- ifFalse: [ self <<< ' ;' ]
218
+ ifTrue: [ self <<< (aAttribute sourceAnchor sourceText copyFrom: (aAttribute sourceAnchor sourceText findString: ' =' ) to: aAttribute sourceAnchor sourceText size) ].
219
+ self <<< ' ;'
238
220
]
239
221
240
222
{ #category : #accessing }
@@ -320,7 +302,9 @@ FAMIX2JavaVisitor >> visitMethod: aMethod [
320
302
ifFalse: [ self
321
303
<<< aMethod name;
322
304
<<< ' (' .
323
- aMethod parameters do: [ :parameter | self clone visit: parameter ] separatedBy: [ self <<< ' ,' ].
305
+ (aMethod parameters sorted: [ :p :p2 | p sourceAnchor startPos < p2 sourceAnchor startPos ])
306
+ do: [ :parameter | self clone visit: parameter ]
307
+ separatedBy: [ self <<< ' , ' ].
324
308
self <<< ' )' ]
325
309
ifTrue: [ self << ' static' ].
326
310
" Printing body of method if class is not abstract or an interface"
0 commit comments