Thanks Mukul, thanks Michael for pointing out this important detail. Actually, I didn't pay my attention to those top level comments. my bad!. Well, I just wished that it'd be better if there were any indication about interning parameters in method-level comments as well. But that's OK. Thanks.
On 7/26/10, Michael Glavassevich <[email protected]> wrote: > > Hi Ishan, > > There is a comment at the top of the NamespaceSupport: > > /** > * Namespace support for XML document handlers. This class doesn't > * perform any error checking. and assumes that all strings passed > * as arguments to methods are unique symbols. The SymbolTable class > * can be used for this purpose. > */ > > and at the top of NamespaceContext (the interface which NamespaceSupport > implements): > > /** > * Represents an interface to query namespace information. > * <p> > * The prefix and namespace must be identical references for equal strings, > thus > * each string should be internalized (@see String.intern()) > * or added to the <code>SymbolTable</code> > * > * @see <a > href="../../../../../xerces2/org/apache/xerces/util/SymbolTable.html"> > * org.apache.xerces.util.SymbolTable..</a> > */ > > which describes what is expected of the user for every method they call on > a NamespaceContext (which has a string argument). Strings for XML names and > URIs are interned just about everywhere in Xerces, with strings compared > using '==' for performance reasons in many other places. It's something > that all Xerces developers should be aware of. It's an integral part of the > design. > > Thanks. > > Michael Glavassevich > XML Parser Development > IBM Toronto Lab > E-mail: [email protected] > E-mail: [email protected] > > Ishan Jayawardena <[email protected]> wrote on 07/26/2010 07:44:25 AM: > >> Hi Michael and Mukul, >> Actually, while I was developing the SCD parser, I came across this >> same problem that Mukul had. I was using these getURI() and >> declarePrefix() methods and I couldn't get the code working until I >> changed the input parameters into interened parameters, which I did >> without any underlying details about those methods as a result of a >> long trial and error process. But I guess this is not a very good >> characteristic of the API and instead we have to tell the programmers >> explicitly that when using such methods, they are supposed to pass >> interned parameters. WDYT? >> Thanks. >> >> On 7/24/10, Mukul Gandhi <[email protected]> wrote: >> > On Sat, Jul 24, 2010 at 11:01 PM, Michael Glavassevich >> > <[email protected]> wrote: >> >> FYI: You missed one spot. I've just fixed it. >> > >> > oops :( >> > >> > I just noticed that. Thanks for the correction. >> > >> > >> > -- >> > Regards, >> > Mukul Gandhi >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [email protected] >> > For additional commands, e-mail: [email protected] >> > >> > >> >> >> -- >> Best Regards, >> Ishan Jayawardena. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] -- Best Regards, Ishan Jayawardena. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
