You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Reggie Riser (JIRA)" <ji...@apache.org> on 2006/11/28 23:32:21 UTC

[jira] Created: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Call to evaluate inside of macro fails with 1.5 beta2
-----------------------------------------------------

                 Key: VELOCITY-504
                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.5 beta2
         Environment: Windows XP, Sun J2SE 1.5.0_09
            Reporter: Reggie Riser


When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.

I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461821 ] 

Nathan Bubna commented on VELOCITY-504:
---------------------------------------

what?!  but that's CRAZY!  ;-)

ok, seriously, someone needs to create that directive.    we should at least include that in the org.apache.velocity.runtime.directive package as a corollary to VelocityEngine. 

Then, when we have something to evaluate (pun intended), we can debate whether or not to include it in the default directive.properties or leave it as something that must be enabled by users.

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461861 ] 

Will Glass-Husain commented on VELOCITY-504:
--------------------------------------------

ok, I'll make a separate issue for this.

What did you mean "corollary to VelocityEngine"?

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen resolved VELOCITY-504.
---------------------------------------------

    Resolution: Won't Fix

Well, there is not much that I can add. Your analysis is spot on and basically VELOCITY-285 and this report show two sides of the same medal. I like the idea of #evaluate(), however I don't think that it will (or should) make the boat for 1.5. Maybe this is a good reason to have an 1.6 really soon.

I think the current behaviour (having the loop variable as a local) is consistent with most other programming languages (especially Java... ;-) ), so I'd say "won't fix" is the right resolution. 

Thanks for digging into this.


> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461906 ] 

Will Glass-Husain commented on VELOCITY-504:
--------------------------------------------

Henning -- you have previously assigned this issue to yourself.

I was going to mark this "wontfix" but i think you should have the final word since it is technically your issue.  Please resolve if you are satisfied here.

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
     [ http://issues.apache.org/jira/browse/VELOCITY-504?page=all ]

Will Glass-Husain updated VELOCITY-504:
---------------------------------------

    Fix Version/s: 1.5

Thanks -- will try to dig into this.

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=comments#action_12454158 ] 
            
Will Glass-Husain commented on VELOCITY-504:
--------------------------------------------

thanks so much for reporting this.  we'll look into it asap.

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461748 ] 

Will Glass-Husain commented on VELOCITY-504:
--------------------------------------------

attached Junit test case (slightly simpler illustration of issue): evaltooltest.patch

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Reggie Riser (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=comments#action_12461104 ] 
            
Reggie Riser commented on VELOCITY-504:
---------------------------------------

After doing a little tracing, it appears that the foreach counter and the loop variable are showing up in the context for Test 3 in my example when using beta 1, but not appearing in the context in beta 2.  It looks like it may have something to do with local scope as ForEach.java now puts the counter and loop variable in the local context with beta 2.  The call to Velocity.evaluate does not appear to be seeing this local context, thus causing the "cannot be resolved" error.

I'm not that familiar with the Velocity source, so I'd certainly appreciate any help with diagnosing the problem.


> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Reggie Riser (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=comments#action_12454472 ] 
            
Reggie Riser commented on VELOCITY-504:
---------------------------------------

I tried setting "velocimacro.context.localscope = true" in velocity.properties in my attached example, but that made no difference in the test using beta 2.  It broke the previously working test with beta 1.

Thanks for taking a look at this.  I'd really like to upgrade to beta 2, but this is a blocker for us until we find a workaround or fix.


> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461862 ] 

Nathan Bubna commented on VELOCITY-504:
---------------------------------------

oops.  i didn't finish that.  it should've read  "as a corollary to VelocityEngine.evaluate()"

in other words:

#evaluate( ... ) is to VTL

as

engine.evaluate(...) is to Java

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=comments#action_12461554 ] 
            
Will Glass-Husain commented on VELOCITY-504:
--------------------------------------------

Ok, figured this out.  I made an even simpler example; I can post it if others want to look at it.

This example is in direct conflict to the bug fix in VELOCITY-285.  In that issue we made it so that loop references are local to a macro.  This was done because of problems with recursive macros-- with a macro and a loop the loop references needed to be kept distinct.

The problem here is that the evaluated text passed to $tool.eval() (called within the macro) refers to $name, which is the loop reference.  Since $tool.eval is accessing the global context, and $name is within the macro local context it cannot be referenced by $tool.eval().

A workaround for this situation is to use #set($name2 = $name) and then have the evaluated text refer to $name2.  This works fine, since $name2 is set within the global context by default (unless velocimacro.context.localscope = true).

Bottom line, the bug fix for VELOCITY-285 is not backwards compatible.  But, this is such a rare case (calling an evaluation tool and referencing the loop variable) AND there's a workaround I'm inclined to leave this as is.  (with a note in the README file?)

Comments?  Particularly from Henning.

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=comments#action_12461108 ] 
            
Henning Schmiedehausen commented on VELOCITY-504:
-------------------------------------------------

This is on the very top of my list of things to do after the Velocity Site is deployed. Unfortunately I got distracted a bit with some creative Maven hacking. Don't worry, I will take care of this; Will if you want to dig into this, please start by reviewing the patch for VELOCITY-285 as mentioned above.

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Closed: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen closed VELOCITY-504.
-------------------------------------------


> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Reggie Riser (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/VELOCITY-504?page=all ]

Reggie Riser updated VELOCITY-504:
----------------------------------

    Attachment: macrotest.zip

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461798 ] 

Nathan Bubna commented on VELOCITY-504:
---------------------------------------

So, in order to trigger the issue, you have to be using a tool that calls evaluate() within a for loop within a macro, where the string being evaluated contains a reference to the loop variable?

If i understand this right, then the fix for VELOCITY-285 should definitely win out over this problem.   However, it should also be asked whether there is any way to give a tool access to the local context here?  Could the global context be somehow notified that a local macro or for-loop context is in effect?

I'm not aware of a way to do this offhand, and it doesn't sound simple to me.  But i'm not fully versed in the relevant code here either...

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
     [ http://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Will Glass-Husain updated VELOCITY-504:
---------------------------------------

    Attachment: evaltooltest.patch

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Assigned: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/VELOCITY-504?page=all ]

Henning Schmiedehausen reassigned VELOCITY-504:
-----------------------------------------------

    Assignee: Henning Schmiedehausen

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461812 ] 

Will Glass-Husain commented on VELOCITY-504:
--------------------------------------------

in response to your first question-- yes that is correct.

Here's a crazy idea.  Instead of using a tool to call a method, use a custom directive.  This would have access to the local context.  

Better yet-- include it in the core as #evaluate()

(why not?   it's always asked for).

WILL

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=comments#action_12454465 ] 
            
Henning Schmiedehausen commented on VELOCITY-504:
-------------------------------------------------

Without any looking at your example or the source code, I'd bet that this is related to VELOCITY-285 and my fix for it.

Could you please try whether changing velocimacro.context.localscope (default is false, so probably setting it to true) changes the behaviour for you?

I might be able to look into this over the weekend.

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484022 ] 

Will Glass-Husain commented on VELOCITY-504:
--------------------------------------------

note that VELOCITY-509 has been implemented with new directive #evaluate().  (for Velocity 1.6)

> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

Posted by "Reggie Riser (JIRA)" <de...@velocity.apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461817 ] 

Reggie Riser commented on VELOCITY-504:
---------------------------------------

FYI, the workaround that Will suggested worked fine for us.  That said, I'd love to see an included #evaluate directive that has access to the local context.


> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>             Fix For: 1.5
>
>         Attachments: evaltooltest.patch, macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org