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 ] )
> and Class >> 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: [^
> (usedInstanceCount between: 11 and: 100) ifTrue: [^
> (usedInstanceCount between: 101 and: 1000) ifTrue: [^
> (usedInstanceCount between: 1001 and: 10000) ifTrue: [^
> (usedInstanceCount between: 10001 and: 100000) ifTrue: [^
> (usedInstanceCount between: 100001 and: 1000000) ifTrue: [^
> 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.
> Moose-dev mailing list
Moose-dev mailing list