[Pharo-dev] Patches for Pharo packages you are maintaining
camillobruni at gmail.com
Sat Nov 23 03:51:39 EST 2013
opened https://pharo.fogbugz.com/f/cases/12229/XML-Tools-improvement otherwise these changes are as good as lost.
sending mcz via mail is from the last century.
On 2013-11-23, at 09:00, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
> No time so fr to handle it.
> Begin forwarded message:
>> From: "monty" <monty.os at engineer.com>
>> Subject: Patches for Pharo packages you are maintaining
>> Date: November 21, 2013 3:14:25 AM GMT+01:00
>> To: stephane.ducasse at inria.fr
>> Prof. Stef, I have produced updates to the XML-Parser, XML-Parser-Testing, and XML-Writer-Core packages you are maintaining.
>> These updates add validation against internal and external DTDs, proper replacement of general and parameter entites, customizable resolution of external parsed entities using Zinc and FileSystem, awareness of notations and unparsed entities, preservation of the internal DTD subset by the DOM parser (so printing a parsed doc with a DTD will produce approximately what was input), line numbers reporting in error messages, and better well-formed and validity constraints.
>> I had to largely rewrite the tokenizer to make everything work, but I followed the spec closely, and it is about the same speed as long as there is no DTD to validate against.
>> One problem is that while the tests I added and the existing tests all pass, for some reason helper messages in some test classes starting with "should" (in the style of should:raise:) are being interpreted as tests and run by TestRuner, even though they don't begin with "test" and take arguments! This is possibly a bug in TestRunner.
>> Another problem is that there are so many deprecated methods cluttering up classes, some of which have been deprecated for years! It is confusing and hard to see which methods to use just by browsing the protocols. I would really suggest using this code to get rid of the XML-Parser methods that have been deprecated for at least a year:
>> expiry := 1 year.
>> (SystemNavigation default allClassesInPackageNamed: 'XML-Parser')
>> do: [:class |
>> class selectors do: [:selector | | compiledMethod timeStamp |
>> compiledMethod := class compiledMethodAt: selector.
>> timeStamp := compiledMethod timeStamp copyAfter: Character space.
>> (compiledMethod isDeprecated
>> and: [(DateAndTime now - (DateAndTime fromString: timeStamp)) > expiry])
>> ifTrue: [class removeSelector: selector]]].
>> I ran and checked it myself and it doesn't break anything. Running the above with XML-Writer-Core might not be a bad idea either.
>> I also updated BitmapCharacterSet to use less memory.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 447 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the Pharo-dev