On Thu, Aug 26, 2010 at 12:27 PM, Cyrille Delaunay <cy.delaunay(a)gmail.com>wrote:
Class >> propertyInstancesStatesAndAmount doesn't return
a default value
outside all the 'ifTrue:' blocks. I guess that maybe for some classes all
the conditions are not satisfied, and therefore that this method just return
'self' (so this class itself).
Maybe try to ^#error at the end of the method and see if the DM display
#error as a property value
Hi Cyrille, thanks a lot :)
It was totally my fault. It was what you said.
Sorry for saying it was a Moose bug ;)
2010/8/26 Mariano Martinez Peck <marianopeck(a)gmail.com>
> Hi. I am having a funny bug (I think). For a reason I don't know, some
> properties (the ones that I think do not have any ocurrences), show a class
> name instead of the selector.
>
> Look and the attached picture. My example is something like
> DistributionMap class >> anExample
>
> ^ (self onContainers: (self listOfCorePackagesNamesWithoutTests
> collect: [ :each | (PackageInfo named: each) ]) elements: #classes
> properties: [:element | element propertyInstancesStatesAndAmount ] )
> render
> open.
>
>
>
> and Class >> propertyInstancesStatesAndAmount
>
> propertyInstancesStatesAndAmount
> | usedInstanceCount unusedInstanceCount |
> usedInstanceCount := 0.
> unusedInstanceCount := 0.
> self isAbstractClass ifTrue: [
> (UnusedObjectDiscoverer current primitiveGetUsedBit: self)
> ifTrue: [ ^ #abstractUsedClass ]
> ifFalse: [ ^ #abstractNotUsedClass].
> ].
> self instanceCount = 0 ifTrue: [ ^ #noInstances].
> self allInstancesDo: [:inst | (UnusedObjectDiscoverer current
> primitiveGetUsedBit: inst) ifTrue: [ usedInstanceCount := usedInstanceCount
> + 1 ] ifFalse: [ unusedInstanceCount := unusedInstanceCount +1 ] ].
> (unusedInstanceCount = 0) ifTrue: [ ^ #hasInstancesButNotUsed].
> (usedInstanceCount between: 1 and: 10) ifTrue: [^
> #usedInstancesBetween1And10].
> (usedInstanceCount between: 11 and: 100) ifTrue: [^
> #usedInstancesBetween11And100].
> (usedInstanceCount between: 101 and: 1000) ifTrue: [^
> #usedInstancesBetween101And1000].
> (usedInstanceCount between: 1001 and: 10000) ifTrue: [^
> #usedInstancesBetween1001And1000].
> (usedInstanceCount between: 10001 and: 100000) ifTrue: [^
> #usedInstancesBetween10001And100000].
> (usedInstanceCount between: 100001 and: 1000000) ifTrue: [^
> #usedInstancesBetween100001And1000000].
>
>
>
> The last 3 properties: #usedInstancesBetween1001And1000,
> #usedInstancesBetween10001And100000, #usedInstancesBetween100001And1000000
> I guess they have no ocurrences, but, in the reference place in the DM, it
> shows a class name instead of theor own name, lilke the rest.
>
> I tried to track down the issue, but I didn't find anything.
>
> Thanks for any help.
>
> Mariano
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev