Bug loading D5 ViewResource into D6

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug loading D5 ViewResource into D6

Chris Uppal-3
I'm getting walkbacks attempting to load a D5 package into D6.  The problem
seems to be because the code which attempts to convert a D5 ViewResource into a
D6 ViewResource runs before class initialisation has occurred.

In more detail:

The package contains a ViewResource which represents an instance of a View
class defined in the package.

As that package is loaded, we enter ResourceIdentifier>>assign: (since that's
the doIt from the file-in).  That indirectly calls
ResourceIdentifier>>assignBinaryResourceData: which attempts to convert the old
format to a literal store array.  To do that it uses
ViewResource>>loadWithContext:forEdit:.   That, in turn, ends up in
View>>restorePlacement:resolution:.  And that in turn ends up in my View
class's own code.  Where it makes use of a flag defined as a classvar of that
class.

But since that class's #initialize has not yet been invoked (the package is
still not completely loaded), the values are undefined.  So I get a walkback.

I can hack around it on an individual basis by invoking the class
initialisation by hand and then restarting in the debugger, but obviously
that's not a general-purpose solution.

(BTW, the D5 package in question is 'CU Graphics Base' which is on my website
under "Experiments".  That is both an invitation to OA if they want to
investigate the problem with a real example, and a warning to anyone who wants
to use my stuff on D6.)

    -- chris