[jdom-interest] Reference comparisons in SAXHandler.startElement

Jason Hunter jhunter at collab.net
Tue Mar 13 15:27:08 PST 2001

> Good point. On the other hand, when the strings don't match,
> String.equals() is
> usually going to discover this by examining just the first
> character or two (in
> the most common cases). Not as fast as ==, but it won't have
> to check every
> single character. It just doesn't seem like this optimization
> is worth the bugs
> it'll introduce.

I never proposed to keep things as they are.  Check my previous post. 
My proposal is to intern in the constructor first thing and that doesn't
allow for any "bugs" to slip through.  It's the same effect as turning
on interning in the parser, but intead we explicitly turn it off in the
parser and do it in JDOM so we gain the interning benefits for manual
doc construction also.


More information about the jdom-interest mailing list