First, apologies for cross-posting.
I noticed recently that in Lift, part of the ItemsList test were commented out for 2.8 because it was failing tests, so I looked into why it was failing.
It seems to be an issue with initialization order. Was this changed in 2.8? Where can I find out more information?
Here's the culprit:
trait ItemsList[T <: MetaMapper[T]]{
...
def metaMapper: T with MetaMapper[T]
...
def reload {
refresh
...
}
def refresh {
current = metaMapper.findAll
}
...
reload
}
So 'refresh', which is called on instantiation, assumes 'metaMapper' has been initialized.
However, in ItemsListSpecs the following code
new ItemsList[SampleItem] {
val metaMapper = SampleItem
}
throws a NullPointerException: at the time refresh is called metaMapper has in fact not been instantiated, apparently.
There are a few simple solutions but I'd first like some reference or background on this change.
Thanks.