You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Marc van Kempen <ma...@bowtie.nl> on 2009/10/24 12:59:20 UTC

T4: bug in expression cache?

Hi,

I have copied and changed the Dialog component in my project (Tapestry  
4.1.5) in order to create a HelpBalloon popup. This gives me the  
following files that I've added to my project:

HelpBalloonDialog.java
HelpBalloonDialog.jwc
HelpBalloonDialog.script

  I kept the condition checking the same as in Dialog.script, i.e.:

<script>
     <input-symbol key="component" required="yes" />

     <initialization>
         <if expression="component.hidden">
		do_stuff();
         </if>
         <if-not expression="component.hidden">
		do_different_stuff();
         </if-not>
     </initialization>
</script>

This is essentially the same construction as Dialog.script uses, and  
most importantly the expression string "component.hidden" is exactly  
the same. Requesting a page however where Dialog is used gives me a  
cast exception when it tries to use the cached compiled expression  
that it finds. Changing the name "component" to something else makes  
the problem go away.

Now, looking at the code I'm seeing the following:

The ExpressionCache uses the symbol map in ScriptSessionImpl as its  
key, so therefore the cache should be local to a script and I should  
be allowed to use the same expression in different scripts.

Is this the intended behaviour, am I missing something or am I looking  
at a bug?

Kind regards,
Marc van Kempen.