Additionally, you will need to execute in VisualWorks:
| fileName stream rewriter parseTree | fileName := 'MyFilename.ig' asFilename. rewriter := ParseTreeRewriter new. rewriter replace: 'RestrictedEnvironment' with: 'SelectorEnvironment'. stream := fileName readStream. [parseTree := BRParser parseExpression: stream contents] ensure: [stream close]. rewriter executeTree: parseTree. parseTree := rewriter tree. stream := fileName writeStream. [stream nextPutAll: parseTree formattedCode] ensure: [stream close]and in VisualAge:
| fileName stream rewriter parseTree | fileName := 'MyFilename.ig'. rewriter := ParseTreeRewriter new. rewriter replace: 'RestrictedEnvironment' with: 'SelectorEnvironment'. stream := CfsReadFileStream open: fileName. [parseTree := BRParser parseExpression: stream contents] ensure: [stream close]. rewriter executeTree: parseTree. parseTree := rewriter tree. stream := CfsWriteFileStream open: fileName. [stream nextPutAll: parseTree formattedCode] ensure: [stream close]Be sure to change the filename before you execute the script.
In addition to fixing the attribute copy, the rename class refactoring was also fixed, to make sure that every application that defines an extension to the application is an edition. Previously, it only checked that the defining application was an edition.
Finally, whenever a class is renamed, the refactoring will convert all existing instances to the new class before trying to remove the class. Previously, if there were instances, the remove class would fail.