Re: [ANNOUNCE] Velocity Engine 2.2 RC4 test build available

2020-01-03 Thread Thomas Mortagne
Hi sorry me again,

I just hit https://issues.apache.org/jira/browse/VELOCITY-924.

On Wed, Jan 1, 2020 at 11:12 PM Claude Brisson
 wrote:
>
> The test build of Velocity Engine 2.2 RC4 is available.
>
> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
> Velocity Engine 2.1 RC3 has been made, and at this time it is simply a
> "test build". We welcome any comments you may have, and will take all
> feedback into account if a quality vote is called for this build.
>
> Release notes:
>
> *
> https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.2/release-notes.html
>
> Distribution:
>
>   * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.2/
>
> Maven 2 staging repository:
>
>   *
> https://repository.apache.org/content/repositories/orgapachevelocity-1032/
>
> Documentation:
>
> * https://velocity.apache.org/engine/2.2/
>
> Sources:
>
>   * https://svn.apache.org/repos/asf/velocity/engine/tags/2.2/
>
> Release Candidates History:
>
>   * RC1 Initial RC
>
>   * RC2
>   - added BigInteger and BigDecimal implicit conversions
>   - [VELOCITY-923] fixed a parser regression for `$foo||`
>   - [VELOCITY-904] fixed two corner case bugs for the
> velocimacro.arguments.preserve_literals backward compatibility flag
>   - fixed engine and dependency versions in README and mention the
> parser customization feature in the *building* section
>   - nicified README links
>   - upgraded surfire plugin version from 2.19.1 to 2.22.1
>   - upgraded maven-jar-plugin from 3.1.1 to 3.2.2
>   - added version 1.2 for extra-enforcer-rules
>   - upgraded maven-javadoc-plugin from 3.1.0 to 3.1.1
>   - upgraded findbugs-maven-plugin from 3.0.4 to 3.0.5
>   - upgraded maven-release-plugin from *unspecified* to 3.0.0-M1
>   - added a new templatized static class
> org.apache.velocity.runtime.VelocityEngineVersion.java
>   - use the File Separator control character to mark the end of stream
> for the parser (instead of the zero-width space char)
>   - reviewed packaging of engine examples (refreshed content, plus made
> them as a standalone zip file with readme, shell scripts, dependencies
> and examples sources rather than a meaningless standalone pom next to a
> jar without explanations...)
>
> * RC3
>   - [VELOCITY-904] fixed yet another corner case bugs for the
> velocimacro.arguments.preserve_literals backward compatibility flag
>   - upgraded SLF4J from 1..7.28 to 1.7.30
>
> * RC4
>   - [VELOCITY-904] fixed a regression introduced in RC3
>
>
>--
>Claude
>
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
> For additional commands, e-mail: dev-h...@velocity.apache.org
>


-- 
Thomas Mortagne

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



[jira] [Updated] (VELOCITY-924) Bad cache handling for java.lang.Class methods

2020-01-03 Thread Thomas Mortagne (Jira)


 [ 
https://issues.apache.org/jira/browse/VELOCITY-924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Mortagne updated VELOCITY-924:
-
Labels: regression  (was: )

> Bad cache handling for java.lang.Class methods
> --
>
> Key: VELOCITY-924
> URL: https://issues.apache.org/jira/browse/VELOCITY-924
> Project: Velocity
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 2.2
>Reporter: Thomas Mortagne
>Priority: Blocker
>  Labels: regression
>
> Requirement:
> A binding $var containing an object which class (org.xwiki.MyClass) 
> implementing a {{String getName()}} method.
> The following code:
> {code}
> $var.class.getName()
> $var.getName()
> {code}
> fail with:
> {noformat}
> Caused by: org.apache.velocity.exception.MethodInvocationException: 
> Invocation of method 'getName' in  class org.xwiki.MyClass threw exception 
> java.lang.IllegalArgumentException: object is not an instance of declaring 
> class at mytemplaye[line 1, column 26]
>   at 
> org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:306)
>   at 
> org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:239)
>   at 
> org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:369)
>   at 
> org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:490)
>   at 
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:423)
>   at org.apache.velocity.Template.merge(Template.java:358)
>   at org.apache.velocity.Template.merge(Template.java:262)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:271)
>   ... 69 more
> Caused by: java.lang.IllegalArgumentException: object is not an instance of 
> declaring class
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at 
> org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:565)
>   at 
> org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:548)
>   at 
> org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:219)
>   ... 75 more
> {noformat}
> The reason is that ClassUtils.getMethod cache does not make any difference 
> between an instance of Class and and instance of 
> org.xwiki.MyClass so when ASTMethod#execute ask for the second getName() it 
> end up with Class#getName() instead of MyClass#getName().



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (VELOCITY-924) Bad cache handling for java.lang.Class methods

2020-01-03 Thread Thomas Mortagne (Jira)


 [ 
https://issues.apache.org/jira/browse/VELOCITY-924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Mortagne updated VELOCITY-924:
-
Description: 
Requirement:

A binding $var containing an object which class (org.xwiki.MyClass) 
implementing a {{String getName()}} method.

The following code:

{code}
$var.class.getName()
$var.getName()
{code}

fail with:

{noformat}
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation 
of method 'getName' in  class org.xwiki.MyClass threw exception 
java.lang.IllegalArgumentException: object is not an instance of declaring 
class at mytemplaye[line 1, column 26]
at 
org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:306)
at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:239)
at 
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:369)
at 
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:490)
at 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:423)
at org.apache.velocity.Template.merge(Template.java:358)
at org.apache.velocity.Template.merge(Template.java:262)
at 
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:271)
... 69 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of 
declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:565)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:548)
at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:219)
... 75 more
{noformat}

The reason is that ClassUtils.getMethod cache does not make any difference 
between an instance of Class and and instance of 
org.xwiki.MyClass so when ASTMethod#execute ask for the second getName() it end 
up with Class#getName() instead of MyClass#getName().

Was working fine in 1.7.

  was:
Requirement:

A binding $var containing an object which class (org.xwiki.MyClass) 
implementing a {{String getName()}} method.

The following code:

{code}
$var.class.getName()
$var.getName()
{code}

fail with:

{noformat}
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation 
of method 'getName' in  class org.xwiki.MyClass threw exception 
java.lang.IllegalArgumentException: object is not an instance of declaring 
class at mytemplaye[line 1, column 26]
at 
org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:306)
at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:239)
at 
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:369)
at 
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:490)
at 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:423)
at org.apache.velocity.Template.merge(Template.java:358)
at org.apache.velocity.Template.merge(Template.java:262)
at 
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:271)
... 69 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of 
declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:565)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:548)
at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:219)
... 75 more
{noformat}

The reason is that ClassUtils.getMethod cache does not make any difference 
between an instance of Class and and instance of 
org.xwiki.MyClass so when ASTMethod#execute ask for the second getName() it end 
up with Class#getName() instead of MyClass#getName().


> Bad cache handling for java.lang.Class methods
> --
>
> Key: VELOCITY-924
> URL: https://issues.apache.org/jira/browse/VELOCITY-924
> Project: Velocity
>  Issue Type: Bug
>  

[jira] [Created] (VELOCITY-924) Bad cache handling for java.lang.Class methods

2020-01-03 Thread Thomas Mortagne (Jira)
Thomas Mortagne created VELOCITY-924:


 Summary: Bad cache handling for java.lang.Class methods
 Key: VELOCITY-924
 URL: https://issues.apache.org/jira/browse/VELOCITY-924
 Project: Velocity
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.2
Reporter: Thomas Mortagne


Requirement:

A binding $var containing an object which class (org.xwiki.MyClass) 
implementing a {{String getName()}} method.

The following code:

{code}
$var.class.getName()
$var.getName()
{code}

fail with:

{noformat}
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation 
of method 'getName' in  class org.xwiki.MyClass threw exception 
java.lang.IllegalArgumentException: object is not an instance of declaring 
class at mytemplaye[line 1, column 26]
at 
org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:306)
at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:239)
at 
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:369)
at 
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:490)
at 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:423)
at org.apache.velocity.Template.merge(Template.java:358)
at org.apache.velocity.Template.merge(Template.java:262)
at 
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:271)
... 69 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of 
declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:565)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:548)
at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:219)
... 75 more
{noformat}

The reason is that ClassUtils.getMethod cache does not make any difference 
between an instance of Class and and instance of 
org.xwiki.MyClass so when ASTMethod#execute ask for the second getName() it end 
up with Class#getName() instead of MyClass#getName().



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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