[squeak-dev] problem with filein

Jecel Assumpcao Jr. jecel at merlintec.com
Thu Aug 12 18:15:52 UTC 2010


Yesterday Lawson was having problems trying to file in code he had
exported from another image. All the instance methods from one of the
classes were missing - the browser showed them but when you clicked on
them the code pane remained blank. The class methods were ok, as was a
different class.

It took me a while to track down what was happening (single stepping
through logic mixed in a wierd way with gui code is tricky). The same
thing happened in both 4.1 and 3.10.2 and was a combination of things:

1) the class was defined as a subclass of something that was not in the
image, so the system was silently making it a subclass of ProtoObject
instead (though the browser said it was a subclass of Object - very
odd). Didn't we have a warning for this situation?

2) the last expression in the filein sent #initialize to the new class

3) the first line of the class method #initialize was "super
initialize."

4) due to the wrong superclass structure, this invoked the instance
method #initialize in Behavior

5) the first line in that method is "self methodDictionary: self
emptyMethodDictionary."

So the file in had actually worked just fine, but at this point deleted
all the instance methods that had just been created. This might cause
problems for others, but I didn't call it a "bug" since each part is
correct in itself. Perhaps there should be a warning for 1? I imagine
that would be annoying and even scary when loading stuff out of order.

-- Jecel




More information about the Squeak-dev mailing list