Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the order of method parameters is sometimes incorrect #52

Open
peteruhnak opened this issue Oct 24, 2018 · 2 comments
Open

the order of method parameters is sometimes incorrect #52

peteruhnak opened this issue Oct 24, 2018 · 2 comments

Comments

@peteruhnak
Copy link

Sometimes the MSE contains method parameters out of order,

e.g. for method methodName(Type1 parameter1, Type2 parameter2, Type3 parameter3) it produced the following:

(in the order as they appeared in the MSE, with line numbers added:)

[...]
29734:
	(FAMIX.Parameter (id: 5273)
		(name 'parameter3')
		(declaredType (ref: 1236))
		(parentBehaviouralEntity (ref: 10032)))
[...]
50547:
	(FAMIX.Parameter (id: 8995)
		(name 'parameter1')
		(declaredType (ref: 15523))
		(parentBehaviouralEntity (ref: 10032)))
[...]
56409:
	(FAMIX.Method (id: 10032)
		(name 'methodName')
		(astStartPosition 7268)
		(astStopPosition 7284)
		(cyclomaticComplexity 2)
		(modifiers 'private')
		(parentType (ref: 16356))
		(signature 'methodName(Type1, Type2, Type3)'))
[ ... ]
96727:
	(FAMIX.Parameter (id: 17183)
		(name 'parameter2')
		(declaredType (ref: 19939))
		(parentBehaviouralEntity (ref: 10032)))
[...]

The parameters are incorrectly in the order 3,1,2.

I cannot share the source code, but the order changes every time I re-run the importer.

@NicolasAnquetil
Copy link

NicolasAnquetil commented Oct 24, 2018 via email

@peteruhnak
Copy link
Author

because FMMultiLink (which will contains all the parameters of a method) is not an ordered list.

FMMultiValueLink (on Pharo-side) uses internally OrderedCollection to store items, and as far as I could tell, the order in the model matched the order in the MSE.

Now that I'm looking at the code, the problem is on Java-side, which uses ch.akuhn.fame.internal.MultivalueSet (https://github.com/feenkcom/jdt2famix/blob/master/src/main/java/com/feenk/jdt2famix/model/famix/BehaviouralEntity.java#L390 ).

So changing the java-side collection would probably be enough. That would also fix #11 without needing to introduce ordering as a first-class concept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants