String interning (WAS: SAX2/Java: Towards a final form)
David Brownell
david-b at pacbell.net
Fri Jan 14 20:35:02 GMT 2000
Miles Sabin wrote:
>
> David Brownell wrote,
> > Nope -- I want to see it _exposed_ but not mandated. It's
> > actually OK if parsers do this only for their own benefit,
> > but it's more useful if apps can tell when it's being done.
>
> OK, how does that pan out? Querying for String.intern() support
> via a getFeature() call? That'd work, but you need to spell it
> out a bit more, because the naive way of taking advantage of
> interning in a ContentHandler looks disgusting,
>
> if(hasInterning)
> {
> ...
> }
> else
> {
> ...
> }
I had in mind more like
if (!hasInterning)
throw new ConfigurationError ("get me a different parser");
For apps that don't care, they won't check the feature. For
those that do care, getting a parser that's not correctly
featured would be just another class of configuration bug.
- Dave
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN 981-02-3594-1
Please note: New list subscriptions now closed in preparation for transfer to OASIS.
More information about the Xml-dev
mailing list