On 17/12/11 11:00 PM, Martin Dias wrote:
For example, in the method
Object >> arrayWithSomething ^Array with: OldClass with: #OldClass
if you inspect Object >> #arrayWithSomething, in the literals you will see: - for the first array element, an association #OldClass->OldClass, which is an entry in Smalltalk globals. This association should be materialized as #NewClass->NewClass.
Yes, it should be mapped, in that case. Now, the feature is a renaming of Smalltalk globals, not just classes, if it's implemented in this way, for method literals.
- for the second array element, the symbol #OldClass. Here is my dubt: 1) materialize as #NewSymbol or 2) as #OldSymbol?
1) I think in this case we want to materialize the method as:
arrayWithSomething ^Array with: NewClass with: #NewClass
Without other information, there's no way in general to know that #OldClass is meant to refer to the OldClass class. IMHO, it's better to leave it alone, in that case. There's usually a facade that would construct the class names from parameters, or the class is known by a fixed name. Trying to address a problem that doesn't occur in real code, might cause other problems.
2) suppose that in the same file we serialized some other object (not the above mentioned method) who points to the symbol #OldClass. Maybe we don't want to rename the symbol in this case.
I think it's better to leave it alone, in this case too.