While checking some packaging today, I noticed that the Kernel package is dirty because Mondrian seems to override ClassDescription>>numberOfLinesOfCode
Kernel implementation: numberOfLinesOfCode "Return the number of lines of code" | str | str := String new writeStream. Object fileOutOn: str. ^ str contents lineCount
Mondrian impl: numberOfLinesOfCode ^ self methods inject: 5 into: [ :sum :compiledMethod | (compiledMethod propertyValueAt: #numberOfLinesOfCode) ifNil: [ compiledMethod propertyValueAt: #numberOfLinesOfCode put: compiledMethod getSource lineCount ]. sum + (compiledMethod propertyValueAt: #numberOfLinesOfCode) ]
I am not sure I understand the purpose of the override. Caching? Why is there a 'self methods inject: 5' at the beginning?
And, do we absolutely need this override? :)
-- Simon