cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Locking the JS global scope to avoid implicit declarations
Date Sun, 31 Oct 2004 09:41:42 GMT
Antonio Gallardo wrote:

>Hi Sylvain:
>
>I am sorry for being late. I am trying to keep up to date, but it is hard
>to me now. :-(
>
>I think, I found a problem with the current implementation of this feature.
>
>As all you already know, Jeremy requested me to help in a interesing
>sample using Lucene and OJB, aka. ORO or OBJ ;-)
>
>Well, while reviewing the Lucene sample I found it is not working anymore:
>
>http://localhost:8888/samples/blocks/lucene/query/advanced.html
>
>A small research showed that maybe this change broke the sample:
>
>http://marc.theaimsgroup.com/?l=xml-cocoon-cvs&m=109904263013273&w=2
>
>The sample is using at line 24:
>
>importPackage(Packages.org.apache.cocoon.bean.query);
>
>and then in line 55, we found:
>
>var contextAccess = cocoon.createObject(ContextAccess);
>
>A small workaround seems to change the above line with:
>
>var contextAccess =
>cocoon.createObject(Packages.org.apache.cocoon.bean.query.ContextAccess);
>
>But, now the problem is:
>
>Is useless the importPackage() function or we have a bug, in this case?
>  
>

Yup, this is a bug: the importPackage() doesn't declare the package's 
classes in the top-level scope immediately, but prepares some data in 
order to lazily load classes at their first use. And that's where the 
locking I added locks too much, since adding a property to the toplevel 
scope in that case is valid.

I added some additional checks for this particular case. It seems to run 
ok here, please cross-check!

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message