logo       

Re: PATCH: String Comparison in ElementProxy: msg#00008

Subject: Re: PATCH: String Comparison in ElementProxy
Vishal the problem is that this codes is called gazillion of times, and even it
seems a small thing, it takes a lot of accumulated time, I even think
in remove this checking altogether or control it by a property.
Perhaps there is a feature set in your DOM parser that interns the
namespaces. I have test with several DOM parsers (xerces, xmlbeans,
jaxb) and all of them the namespaces strings are interns.
If you are not able too toggle the behavior, We can begin to think in
other possibilities (create code on the fly, create an interface with
one implementation or the other a let the JVM inline it). But I think
will be the last resort.

Regards,
Raul

On 10/2/06, Vishal Mahajan <vmahajan@xxxxxxxxxxxxxx> wrote:
Any signature verification was failing for me, and I have a different
DOM implementation in my environment, so probably you are right. It was
such a basic error that it had to be something like this. In any case, I
think we should keep string comparison safe.

Vishal

Raul Benito wrote:
> Hi Vishal,
>
> The namespaces strings are intern, at least in xerces.
>
> Can you post the code that is failing?
>
> On 10/2/06, Vishal Mahajan <vmahajan@xxxxxxxxxxxxxx> wrote:
>> This problem was not allowing successful creation of signature space
>> elements. Fix attached.
>>
>> Vishal
>>
>>
>>
>> Index: ElementProxy.java
>> ===================================================================
>> --- ElementProxy.java   (revision 451991)
>> +++ ElementProxy.java   (working copy)
>> @@ -281,7 +281,7 @@
>>
>>        String localnameIS = this._constructionElement.getLocalName();
>>        String namespaceIS = this._constructionElement.getNamespaceURI();
>> -      if ((namespaceSHOULDBE!=namespaceIS) ||
>> +      if (!namespaceSHOULDBE.equals(namespaceIS) ||
>>         !localnameSHOULDBE.equals(localnameIS) ) {
>>           Object exArgs[] = { namespaceIS +":"+ localnameIS,
>>             namespaceSHOULDBE +":"+ localnameSHOULDBE};
>>
>>
>>
>
>





--
http://r-bg.com



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe