On 22 juin 2011, at 10:36, Cyrille Delaunay wrote:

Hello,

I'm not sure this is a problem, but here is the error I had:

FAMIXMethod >> numberOfMessageSends
<property: #MSG longName: 'Number of message sends' description:
'The number of message from a method'>
^self
lookUpPropertyNamed: #MSG
computedAs:
[self mooseModel isSmalltalk
ifTrue:
[| parser |
parser := VisualWorksParseTreeMetricCalculator new.
parser processMethod: self usingImporter: nil inModel: nil.
parser numberOfMessageSends]
ifFalse: [-1]]

Here, to compute this property, we ask the smalltalk compiled method (throught the method in bold).
So, if I generate a model, then remove a method in pharo, then ask the corresponding FAMIXMethod for #numberOfMessageSends, it will raise an error because it does not find the compiled method anyMore.
Maybe we should force the computation of this kind of property at the model computation ?

Nope, since the idea is to lazily compute metrics.

I would rather add an exception handler to catch such error and return -1


--
Simon Denier