You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Claude Brisson <cl...@renegat.net> on 2016/11/07 10:06:41 UTC

[ANNOUNCE] Velocity Engine 2.0 test build available

The test build of Velocity Engine 2.0 is available.

No determination as to the quality ('alpha,' 'beta,' or 'GA') of 
Velocity Engine 2.0 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.0/release-notes.html

Distribution:

  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/

Maven 2 staging repository:

  * 
https://repository.apache.org/content/repositories/orgapachevelocity-1010/

A vote regarding the quality of this test build will be initiated within 
the next couple of days.


Regards,

   Claude



Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Greg Huber <gr...@gmail.com>.
OK, I narrowed it down to org.apache.velocity.util.introspection.ClassMap
building its cache key, but since you can reproduce it I will give up now
and test the next release! :)

Thanks

On 9 November 2016 at 17:06, Claude Brisson <cl...@renegat.net> wrote:

> Ok, I reproduced it. It happens when the method is overloaded with a
> variant that takes no argument.
>
> Guess there will be a third release candidate...
>
>
> On 09/11/2016 17:44, Greg Huber wrote:
>
>> It seems to be returning the wrong class name in ClassUtils
>>
>>   method = node.getRuntimeServices().getUberspect().getMethod(o,
>> methodName,
>> params,
>>             new Info(node.getTemplateName(), node.getLine(),
>> node.getColumn()));
>>
>> It is returning a method name of .thumbResource() rather than
>> .thumbResource(String, String) and then further down the java reflection
>> throws the java.lang.IllegalArgumentException exception.
>>
>>
>> On 9 November 2016 at 16:09, Claude Brisson <cl...@renegat.net> wrote:
>>
>> I cannot reproduce it.
>>>
>>> Is the thumbResource() method overloaded?
>>>
>>> Do you have the full stacktrace?
>>>
>>>
>>> On 09/11/2016 16:50, Greg Huber wrote:
>>>
>>> Hello,
>>>>
>>>> I am getting an error when a parameter on a method name is null, it says
>>>> "wrong number of arguments at"
>>>>
>>>> eg :
>>>>
>>>> $entry.filePath == null
>>>>
>>>> $myPojo.thumbResource($entry.name, $entry.filePath)
>>>>
>>>> I get an exception :
>>>>
>>>> java.lang.IllegalArgumentException: wrong number of arguments at..
>>>>
>>>>
>>>>
>>>> public String thumbResource(String name, String filePath) {
>>>>           ...
>>>> }
>>>>
>>>> I have tried to debug it but it seems to originate in the ASTMethod
>>>> class.
>>>> If i change the variable to be blanks it works ok.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net> wrote:
>>>>
>>>> A new test build of Velocity Engine 2.0 is available.
>>>>
>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>> Velocity
>>>>> Engine 2.0 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-eng
>>>>> ine/2.0/release-notes.html
>>>>>
>>>>> Distribution:
>>>>>
>>>>>    * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>> ine/2.0/
>>>>>
>>>>> Maven 2 staging repository:
>>>>>
>>>>>    * https://repository.apache.org/content/repositories/orgapache
>>>>> velocity-1011/
>>>>>
>>>>> A vote regarding the quality of this test build will be initiated
>>>>> within
>>>>> the next couple of days.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>>     Claude
>>>>>
>>>>>
>>>>> On 07/11/2016 11:06, Claude Brisson wrote:
>>>>>
>>>>> The test build of Velocity Engine 2.0 is available.
>>>>>
>>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>>> Velocity
>>>>>> Engine 2.0 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-eng
>>>>>> ine/2.0/release-notes.html
>>>>>>
>>>>>> Distribution:
>>>>>>
>>>>>>    * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>>> ine/2.0/
>>>>>>
>>>>>> Maven 2 staging repository:
>>>>>>
>>>>>>    * https://repository.apache.org/content/repositories/orgapache
>>>>>> velocity-1010/
>>>>>>
>>>>>> A vote regarding the quality of this test build will be initiated
>>>>>> within
>>>>>> the next couple of days.
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>>     Claude
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>>> For additional commands, e-mail: dev-help@velocity.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Greg Huber <gr...@gmail.com>.
Claude,

I have tested the fix and it now works, thanks.

##

One thing now is I cannot get the log into debug mode.  I use
commons-logging with log4j and the log4j-slf4j-impl as a bridge.

<logger name="org.apache.velocity" level="DEBUG" additivity="false">
   <appender-ref ref="RollingFile" />
</logger>


Other jars that use slf4j will log to debug ok.

The notes mention runtime.log.instance= maybe I need to set something here?







On 9 November 2016 at 22:40, Claude Brisson <cl...@renegat.net> wrote:

> Thanks Nathan!
>
> Greg, the bug is fixed. But I'll wait at least 48h for potential more
> feedback (thanks, by the way!) before submitting a new release candidate.
>
> If you want to test the corrected version before, you can grab the latest
> snapshot here:
>
> https://repository.apache.org/content/repositories/snapshots
> /org/apache/velocity/velocity-engine-core/2.0-SNAPSHOT/
> velocity-engine-core-2.0-20161109.221234-5.jar
>
> (with the usual signatures in .sha1 and .md5 files).
>
>   Claude
>
>
> On 09/11/2016 18:45, Nathan Bubna wrote:
>
>> Gah, really wish i had time to help. Keep up the great work, Claude!
>>
>> On Wed, Nov 9, 2016 at 9:06 AM, Claude Brisson <cl...@renegat.net>
>> wrote:
>>
>> Ok, I reproduced it. It happens when the method is overloaded with a
>>> variant that takes no argument.
>>>
>>> Guess there will be a third release candidate...
>>>
>>>
>>>
>>> On 09/11/2016 17:44, Greg Huber wrote:
>>>
>>> It seems to be returning the wrong class name in ClassUtils
>>>>
>>>>    method = node.getRuntimeServices().getUberspect().getMethod(o,
>>>> methodName,
>>>> params,
>>>>              new Info(node.getTemplateName(), node.getLine(),
>>>> node.getColumn()));
>>>>
>>>> It is returning a method name of .thumbResource() rather than
>>>> .thumbResource(String, String) and then further down the java reflection
>>>> throws the java.lang.IllegalArgumentException exception.
>>>>
>>>>
>>>> On 9 November 2016 at 16:09, Claude Brisson <cl...@renegat.net> wrote:
>>>>
>>>> I cannot reproduce it.
>>>>
>>>>> Is the thumbResource() method overloaded?
>>>>>
>>>>> Do you have the full stacktrace?
>>>>>
>>>>>
>>>>> On 09/11/2016 16:50, Greg Huber wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>>> I am getting an error when a parameter on a method name is null, it
>>>>>> says
>>>>>> "wrong number of arguments at"
>>>>>>
>>>>>> eg :
>>>>>>
>>>>>> $entry.filePath == null
>>>>>>
>>>>>> $myPojo.thumbResource($entry.name, $entry.filePath)
>>>>>>
>>>>>> I get an exception :
>>>>>>
>>>>>> java.lang.IllegalArgumentException: wrong number of arguments at..
>>>>>>
>>>>>>
>>>>>>
>>>>>> public String thumbResource(String name, String filePath) {
>>>>>>            ...
>>>>>> }
>>>>>>
>>>>>> I have tried to debug it but it seems to originate in the ASTMethod
>>>>>> class.
>>>>>> If i change the variable to be blanks it works ok.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net>
>>>>>> wrote:
>>>>>>
>>>>>> A new test build of Velocity Engine 2.0 is available.
>>>>>>
>>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>>>> Velocity
>>>>>>> Engine 2.0 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-eng
>>>>>>> ine/2.0/release-notes.html
>>>>>>>
>>>>>>> Distribution:
>>>>>>>
>>>>>>>     * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>>>> ine/2.0/
>>>>>>>
>>>>>>> Maven 2 staging repository:
>>>>>>>
>>>>>>>     * https://repository.apache.org/content/repositories/orgapache
>>>>>>> velocity-1011/
>>>>>>>
>>>>>>> A vote regarding the quality of this test build will be initiated
>>>>>>> within
>>>>>>> the next couple of days.
>>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>>      Claude
>>>>>>>
>>>>>>>
>>>>>>> On 07/11/2016 11:06, Claude Brisson wrote:
>>>>>>>
>>>>>>> The test build of Velocity Engine 2.0 is available.
>>>>>>>
>>>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>>>>> Velocity
>>>>>>>> Engine 2.0 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-eng
>>>>>>>> ine/2.0/release-notes.html
>>>>>>>>
>>>>>>>> Distribution:
>>>>>>>>
>>>>>>>>     * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>>>>> ine/2.0/
>>>>>>>>
>>>>>>>> Maven 2 staging repository:
>>>>>>>>
>>>>>>>>     * https://repository.apache.org/content/repositories/orgapache
>>>>>>>> velocity-1010/
>>>>>>>>
>>>>>>>> A vote regarding the quality of this test build will be initiated
>>>>>>>> within
>>>>>>>> the next couple of days.
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>>      Claude
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------
>>>>>>>> ---------
>>>>>>>>
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>>>>> For additional commands, e-mail: dev-help@velocity.apache.org
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>>> For additional commands, e-mail: dev-help@velocity.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Claude Brisson <cl...@renegat.net>.
Thanks Nathan!

Greg, the bug is fixed. But I'll wait at least 48h for potential more 
feedback (thanks, by the way!) before submitting a new release candidate.

If you want to test the corrected version before, you can grab the 
latest snapshot here:

https://repository.apache.org/content/repositories/snapshots/org/apache/velocity/velocity-engine-core/2.0-SNAPSHOT/velocity-engine-core-2.0-20161109.221234-5.jar

(with the usual signatures in .sha1 and .md5 files).

   Claude


On 09/11/2016 18:45, Nathan Bubna wrote:
> Gah, really wish i had time to help. Keep up the great work, Claude!
>
> On Wed, Nov 9, 2016 at 9:06 AM, Claude Brisson <cl...@renegat.net> wrote:
>
>> Ok, I reproduced it. It happens when the method is overloaded with a
>> variant that takes no argument.
>>
>> Guess there will be a third release candidate...
>>
>>
>>
>> On 09/11/2016 17:44, Greg Huber wrote:
>>
>>> It seems to be returning the wrong class name in ClassUtils
>>>
>>>    method = node.getRuntimeServices().getUberspect().getMethod(o,
>>> methodName,
>>> params,
>>>              new Info(node.getTemplateName(), node.getLine(),
>>> node.getColumn()));
>>>
>>> It is returning a method name of .thumbResource() rather than
>>> .thumbResource(String, String) and then further down the java reflection
>>> throws the java.lang.IllegalArgumentException exception.
>>>
>>>
>>> On 9 November 2016 at 16:09, Claude Brisson <cl...@renegat.net> wrote:
>>>
>>> I cannot reproduce it.
>>>> Is the thumbResource() method overloaded?
>>>>
>>>> Do you have the full stacktrace?
>>>>
>>>>
>>>> On 09/11/2016 16:50, Greg Huber wrote:
>>>>
>>>> Hello,
>>>>> I am getting an error when a parameter on a method name is null, it says
>>>>> "wrong number of arguments at"
>>>>>
>>>>> eg :
>>>>>
>>>>> $entry.filePath == null
>>>>>
>>>>> $myPojo.thumbResource($entry.name, $entry.filePath)
>>>>>
>>>>> I get an exception :
>>>>>
>>>>> java.lang.IllegalArgumentException: wrong number of arguments at..
>>>>>
>>>>>
>>>>>
>>>>> public String thumbResource(String name, String filePath) {
>>>>>            ...
>>>>> }
>>>>>
>>>>> I have tried to debug it but it seems to originate in the ASTMethod
>>>>> class.
>>>>> If i change the variable to be blanks it works ok.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net> wrote:
>>>>>
>>>>> A new test build of Velocity Engine 2.0 is available.
>>>>>
>>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>>> Velocity
>>>>>> Engine 2.0 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-eng
>>>>>> ine/2.0/release-notes.html
>>>>>>
>>>>>> Distribution:
>>>>>>
>>>>>>     * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>>> ine/2.0/
>>>>>>
>>>>>> Maven 2 staging repository:
>>>>>>
>>>>>>     * https://repository.apache.org/content/repositories/orgapache
>>>>>> velocity-1011/
>>>>>>
>>>>>> A vote regarding the quality of this test build will be initiated
>>>>>> within
>>>>>> the next couple of days.
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>>      Claude
>>>>>>
>>>>>>
>>>>>> On 07/11/2016 11:06, Claude Brisson wrote:
>>>>>>
>>>>>> The test build of Velocity Engine 2.0 is available.
>>>>>>
>>>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>>>> Velocity
>>>>>>> Engine 2.0 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-eng
>>>>>>> ine/2.0/release-notes.html
>>>>>>>
>>>>>>> Distribution:
>>>>>>>
>>>>>>>     * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>>>> ine/2.0/
>>>>>>>
>>>>>>> Maven 2 staging repository:
>>>>>>>
>>>>>>>     * https://repository.apache.org/content/repositories/orgapache
>>>>>>> velocity-1010/
>>>>>>>
>>>>>>> A vote regarding the quality of this test build will be initiated
>>>>>>> within
>>>>>>> the next couple of days.
>>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>>      Claude
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>>>> For additional commands, e-mail: dev-help@velocity.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: dev-help@velocity.apache.org
>>
>>


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


Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Nathan Bubna <nb...@gmail.com>.
Gah, really wish i had time to help. Keep up the great work, Claude!

On Wed, Nov 9, 2016 at 9:06 AM, Claude Brisson <cl...@renegat.net> wrote:

> Ok, I reproduced it. It happens when the method is overloaded with a
> variant that takes no argument.
>
> Guess there will be a third release candidate...
>
>
>
> On 09/11/2016 17:44, Greg Huber wrote:
>
>> It seems to be returning the wrong class name in ClassUtils
>>
>>   method = node.getRuntimeServices().getUberspect().getMethod(o,
>> methodName,
>> params,
>>             new Info(node.getTemplateName(), node.getLine(),
>> node.getColumn()));
>>
>> It is returning a method name of .thumbResource() rather than
>> .thumbResource(String, String) and then further down the java reflection
>> throws the java.lang.IllegalArgumentException exception.
>>
>>
>> On 9 November 2016 at 16:09, Claude Brisson <cl...@renegat.net> wrote:
>>
>> I cannot reproduce it.
>>>
>>> Is the thumbResource() method overloaded?
>>>
>>> Do you have the full stacktrace?
>>>
>>>
>>> On 09/11/2016 16:50, Greg Huber wrote:
>>>
>>> Hello,
>>>>
>>>> I am getting an error when a parameter on a method name is null, it says
>>>> "wrong number of arguments at"
>>>>
>>>> eg :
>>>>
>>>> $entry.filePath == null
>>>>
>>>> $myPojo.thumbResource($entry.name, $entry.filePath)
>>>>
>>>> I get an exception :
>>>>
>>>> java.lang.IllegalArgumentException: wrong number of arguments at..
>>>>
>>>>
>>>>
>>>> public String thumbResource(String name, String filePath) {
>>>>           ...
>>>> }
>>>>
>>>> I have tried to debug it but it seems to originate in the ASTMethod
>>>> class.
>>>> If i change the variable to be blanks it works ok.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net> wrote:
>>>>
>>>> A new test build of Velocity Engine 2.0 is available.
>>>>
>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>> Velocity
>>>>> Engine 2.0 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-eng
>>>>> ine/2.0/release-notes.html
>>>>>
>>>>> Distribution:
>>>>>
>>>>>    * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>> ine/2.0/
>>>>>
>>>>> Maven 2 staging repository:
>>>>>
>>>>>    * https://repository.apache.org/content/repositories/orgapache
>>>>> velocity-1011/
>>>>>
>>>>> A vote regarding the quality of this test build will be initiated
>>>>> within
>>>>> the next couple of days.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>>     Claude
>>>>>
>>>>>
>>>>> On 07/11/2016 11:06, Claude Brisson wrote:
>>>>>
>>>>> The test build of Velocity Engine 2.0 is available.
>>>>>
>>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>>> Velocity
>>>>>> Engine 2.0 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-eng
>>>>>> ine/2.0/release-notes.html
>>>>>>
>>>>>> Distribution:
>>>>>>
>>>>>>    * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>>> ine/2.0/
>>>>>>
>>>>>> Maven 2 staging repository:
>>>>>>
>>>>>>    * https://repository.apache.org/content/repositories/orgapache
>>>>>> velocity-1010/
>>>>>>
>>>>>> A vote regarding the quality of this test build will be initiated
>>>>>> within
>>>>>> the next couple of days.
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>>     Claude
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>>> For additional commands, e-mail: dev-help@velocity.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Claude Brisson <cl...@renegat.net>.
Ok, I reproduced it. It happens when the method is overloaded with a 
variant that takes no argument.

Guess there will be a third release candidate...


On 09/11/2016 17:44, Greg Huber wrote:
> It seems to be returning the wrong class name in ClassUtils
>
>   method = node.getRuntimeServices().getUberspect().getMethod(o, methodName,
> params,
>             new Info(node.getTemplateName(), node.getLine(),
> node.getColumn()));
>
> It is returning a method name of .thumbResource() rather than
> .thumbResource(String, String) and then further down the java reflection
> throws the java.lang.IllegalArgumentException exception.
>
>
> On 9 November 2016 at 16:09, Claude Brisson <cl...@renegat.net> wrote:
>
>> I cannot reproduce it.
>>
>> Is the thumbResource() method overloaded?
>>
>> Do you have the full stacktrace?
>>
>>
>> On 09/11/2016 16:50, Greg Huber wrote:
>>
>>> Hello,
>>>
>>> I am getting an error when a parameter on a method name is null, it says
>>> "wrong number of arguments at"
>>>
>>> eg :
>>>
>>> $entry.filePath == null
>>>
>>> $myPojo.thumbResource($entry.name, $entry.filePath)
>>>
>>> I get an exception :
>>>
>>> java.lang.IllegalArgumentException: wrong number of arguments at..
>>>
>>>
>>>
>>> public String thumbResource(String name, String filePath) {
>>>           ...
>>> }
>>>
>>> I have tried to debug it but it seems to originate in the ASTMethod class.
>>> If i change the variable to be blanks it works ok.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net> wrote:
>>>
>>> A new test build of Velocity Engine 2.0 is available.
>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
>>>> Engine 2.0 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-eng
>>>> ine/2.0/release-notes.html
>>>>
>>>> Distribution:
>>>>
>>>>    * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>>>>
>>>> Maven 2 staging repository:
>>>>
>>>>    * https://repository.apache.org/content/repositories/orgapache
>>>> velocity-1011/
>>>>
>>>> A vote regarding the quality of this test build will be initiated within
>>>> the next couple of days.
>>>>
>>>>
>>>> Regards,
>>>>
>>>>     Claude
>>>>
>>>>
>>>> On 07/11/2016 11:06, Claude Brisson wrote:
>>>>
>>>> The test build of Velocity Engine 2.0 is available.
>>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>>> Velocity
>>>>> Engine 2.0 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-eng
>>>>> ine/2.0/release-notes.html
>>>>>
>>>>> Distribution:
>>>>>
>>>>>    * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>>> ine/2.0/
>>>>>
>>>>> Maven 2 staging repository:
>>>>>
>>>>>    * https://repository.apache.org/content/repositories/orgapache
>>>>> velocity-1010/
>>>>>
>>>>> A vote regarding the quality of this test build will be initiated within
>>>>> the next couple of days.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>>     Claude
>>>>>
>>>>>
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: dev-help@velocity.apache.org
>>
>>


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


Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Greg Huber <gr...@gmail.com>.
It seems to be returning the wrong class name in ClassUtils

 method = node.getRuntimeServices().getUberspect().getMethod(o, methodName,
params,
           new Info(node.getTemplateName(), node.getLine(),
node.getColumn()));

It is returning a method name of .thumbResource() rather than
.thumbResource(String, String) and then further down the java reflection
throws the java.lang.IllegalArgumentException exception.


On 9 November 2016 at 16:09, Claude Brisson <cl...@renegat.net> wrote:

> I cannot reproduce it.
>
> Is the thumbResource() method overloaded?
>
> Do you have the full stacktrace?
>
>
> On 09/11/2016 16:50, Greg Huber wrote:
>
>> Hello,
>>
>> I am getting an error when a parameter on a method name is null, it says
>> "wrong number of arguments at"
>>
>> eg :
>>
>> $entry.filePath == null
>>
>> $myPojo.thumbResource($entry.name, $entry.filePath)
>>
>> I get an exception :
>>
>> java.lang.IllegalArgumentException: wrong number of arguments at..
>>
>>
>>
>> public String thumbResource(String name, String filePath) {
>>          ...
>> }
>>
>> I have tried to debug it but it seems to originate in the ASTMethod class.
>> If i change the variable to be blanks it works ok.
>>
>>
>>
>>
>>
>>
>>
>>
>> On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net> wrote:
>>
>> A new test build of Velocity Engine 2.0 is available.
>>>
>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
>>> Engine 2.0 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-eng
>>> ine/2.0/release-notes.html
>>>
>>> Distribution:
>>>
>>>   * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>>>
>>> Maven 2 staging repository:
>>>
>>>   * https://repository.apache.org/content/repositories/orgapache
>>> velocity-1011/
>>>
>>> A vote regarding the quality of this test build will be initiated within
>>> the next couple of days.
>>>
>>>
>>> Regards,
>>>
>>>    Claude
>>>
>>>
>>> On 07/11/2016 11:06, Claude Brisson wrote:
>>>
>>> The test build of Velocity Engine 2.0 is available.
>>>>
>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>> Velocity
>>>> Engine 2.0 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-eng
>>>> ine/2.0/release-notes.html
>>>>
>>>> Distribution:
>>>>
>>>>   * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>> ine/2.0/
>>>>
>>>> Maven 2 staging repository:
>>>>
>>>>   * https://repository.apache.org/content/repositories/orgapache
>>>> velocity-1010/
>>>>
>>>> A vote regarding the quality of this test build will be initiated within
>>>> the next couple of days.
>>>>
>>>>
>>>> Regards,
>>>>
>>>>    Claude
>>>>
>>>>
>>>>
>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Greg Huber <gr...@gmail.com>.
I have a template with a pojo in the context with a method called

thumbResource(String, String)

When I parse the template with an null for the second parameter

$myPojo.thumbResource(main, null)

it throws the exception.

Debugging it in eclipse is just says :

java.lang.IllegalArgumentException: wrong number of arguments


It is thrown in the method.invoke method below  ASTMethod.java

try
        {
            /*
             *  get the returned object.  It may be null, and that is
             *  valid for something declared with a void return type.
             *  Since the caller is expecting something to be returned,
             *  as long as things are peachy, we can return an empty
             *  String so ASTReference() correctly figures out that
             *  all is well.
             */

            Object obj = method.invoke(o, params);

            if (obj == null)
            {
                if( method.getReturnType() == Void.TYPE)
                {
                    return "";
                }
            }

            return obj;
        }
        catch( InvocationTargetException ite )
        {
            return handleInvocationException(o, context,
ite.getTargetException());
        }

        /** Can also be thrown by method invocation **/
        catch( IllegalArgumentException t )
        {
            return handleInvocationException(o, context, t);
        }


I will try to debug it further.

Thanks

On 9 November 2016 at 16:09, Claude Brisson <cl...@renegat.net> wrote:

> I cannot reproduce it.
>
> Is the thumbResource() method overloaded?
>
> Do you have the full stacktrace?
>
>
> On 09/11/2016 16:50, Greg Huber wrote:
>
>> Hello,
>>
>> I am getting an error when a parameter on a method name is null, it says
>> "wrong number of arguments at"
>>
>> eg :
>>
>> $entry.filePath == null
>>
>> $myPojo.thumbResource($entry.name, $entry.filePath)
>>
>> I get an exception :
>>
>> java.lang.IllegalArgumentException: wrong number of arguments at..
>>
>>
>>
>> public String thumbResource(String name, String filePath) {
>>          ...
>> }
>>
>> I have tried to debug it but it seems to originate in the ASTMethod class.
>> If i change the variable to be blanks it works ok.
>>
>>
>>
>>
>>
>>
>>
>>
>> On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net> wrote:
>>
>> A new test build of Velocity Engine 2.0 is available.
>>>
>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
>>> Engine 2.0 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-eng
>>> ine/2.0/release-notes.html
>>>
>>> Distribution:
>>>
>>>   * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>>>
>>> Maven 2 staging repository:
>>>
>>>   * https://repository.apache.org/content/repositories/orgapache
>>> velocity-1011/
>>>
>>> A vote regarding the quality of this test build will be initiated within
>>> the next couple of days.
>>>
>>>
>>> Regards,
>>>
>>>    Claude
>>>
>>>
>>> On 07/11/2016 11:06, Claude Brisson wrote:
>>>
>>> The test build of Velocity Engine 2.0 is available.
>>>>
>>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
>>>> Velocity
>>>> Engine 2.0 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-eng
>>>> ine/2.0/release-notes.html
>>>>
>>>> Distribution:
>>>>
>>>>   * https://dist.apache.org/repos/dist/dev/velocity/velocity-eng
>>>> ine/2.0/
>>>>
>>>> Maven 2 staging repository:
>>>>
>>>>   * https://repository.apache.org/content/repositories/orgapache
>>>> velocity-1010/
>>>>
>>>> A vote regarding the quality of this test build will be initiated within
>>>> the next couple of days.
>>>>
>>>>
>>>> Regards,
>>>>
>>>>    Claude
>>>>
>>>>
>>>>
>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Claude Brisson <cl...@renegat.net>.
I cannot reproduce it.

Is the thumbResource() method overloaded?

Do you have the full stacktrace?


On 09/11/2016 16:50, Greg Huber wrote:
> Hello,
>
> I am getting an error when a parameter on a method name is null, it says
> "wrong number of arguments at"
>
> eg :
>
> $entry.filePath == null
>
> $myPojo.thumbResource($entry.name, $entry.filePath)
>
> I get an exception :
>
> java.lang.IllegalArgumentException: wrong number of arguments at..
>
>
>
> public String thumbResource(String name, String filePath) {
>          ...
> }
>
> I have tried to debug it but it seems to originate in the ASTMethod class.
> If i change the variable to be blanks it works ok.
>
>
>
>
>
>
>
>
> On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net> wrote:
>
>> A new test build of Velocity Engine 2.0 is available.
>>
>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
>> Engine 2.0 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-eng
>> ine/2.0/release-notes.html
>>
>> Distribution:
>>
>>   * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>>
>> Maven 2 staging repository:
>>
>>   * https://repository.apache.org/content/repositories/orgapache
>> velocity-1011/
>>
>> A vote regarding the quality of this test build will be initiated within
>> the next couple of days.
>>
>>
>> Regards,
>>
>>    Claude
>>
>>
>> On 07/11/2016 11:06, Claude Brisson wrote:
>>
>>> The test build of Velocity Engine 2.0 is available.
>>>
>>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
>>> Engine 2.0 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-eng
>>> ine/2.0/release-notes.html
>>>
>>> Distribution:
>>>
>>>   * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>>>
>>> Maven 2 staging repository:
>>>
>>>   * https://repository.apache.org/content/repositories/orgapache
>>> velocity-1010/
>>>
>>> A vote regarding the quality of this test build will be initiated within
>>> the next couple of days.
>>>
>>>
>>> Regards,
>>>
>>>    Claude
>>>
>>>
>>>


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


Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Greg Huber <gr...@gmail.com>.
Hello,

I am getting an error when a parameter on a method name is null, it says
"wrong number of arguments at"

eg :

$entry.filePath == null

$myPojo.thumbResource($entry.name, $entry.filePath)

I get an exception :

java.lang.IllegalArgumentException: wrong number of arguments at..



public String thumbResource(String name, String filePath) {
        ...
}

I have tried to debug it but it seems to originate in the ASTMethod class.
If i change the variable to be blanks it works ok.








On 9 November 2016 at 14:50, Claude Brisson <cl...@renegat.net> wrote:

> A new test build of Velocity Engine 2.0 is available.
>
> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
> Engine 2.0 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-eng
> ine/2.0/release-notes.html
>
> Distribution:
>
>  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>
> Maven 2 staging repository:
>
>  * https://repository.apache.org/content/repositories/orgapache
> velocity-1011/
>
> A vote regarding the quality of this test build will be initiated within
> the next couple of days.
>
>
> Regards,
>
>   Claude
>
>
> On 07/11/2016 11:06, Claude Brisson wrote:
>
>>
>> The test build of Velocity Engine 2.0 is available.
>>
>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
>> Engine 2.0 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-eng
>> ine/2.0/release-notes.html
>>
>> Distribution:
>>
>>  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>>
>> Maven 2 staging repository:
>>
>>  * https://repository.apache.org/content/repositories/orgapache
>> velocity-1010/
>>
>> A vote regarding the quality of this test build will be initiated within
>> the next couple of days.
>>
>>
>> Regards,
>>
>>   Claude
>>
>>
>>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Claude Brisson <cl...@renegat.net>.
A new test build of Velocity Engine 2.0 is available.

No determination as to the quality ('alpha,' 'beta,' or 'GA') of 
Velocity Engine 2.0 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.0/release-notes.html

Distribution:

  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/

Maven 2 staging repository:

  * 
https://repository.apache.org/content/repositories/orgapachevelocity-1011/

A vote regarding the quality of this test build will be initiated within 
the next couple of days.


Regards,

   Claude


On 07/11/2016 11:06, Claude Brisson wrote:
>
> The test build of Velocity Engine 2.0 is available.
>
> No determination as to the quality ('alpha,' 'beta,' or 'GA') of 
> Velocity Engine 2.0 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.0/release-notes.html
>
> Distribution:
>
>  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>
> Maven 2 staging repository:
>
>  * 
> https://repository.apache.org/content/repositories/orgapachevelocity-1010/
>
> A vote regarding the quality of this test build will be initiated 
> within the next couple of days.
>
>
> Regards,
>
>   Claude
>
>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Claude Brisson <cl...@renegat.net>.
A new test build of Velocity Engine 2.0 is available.

No determination as to the quality ('alpha,' 'beta,' or 'GA') of 
Velocity Engine 2.0 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.0/release-notes.html

Distribution:

  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/

Maven 2 staging repository:

  * 
https://repository.apache.org/content/repositories/orgapachevelocity-1011/

A vote regarding the quality of this test build will be initiated within 
the next couple of days.


Regards,

   Claude


On 07/11/2016 11:06, Claude Brisson wrote:
>
> The test build of Velocity Engine 2.0 is available.
>
> No determination as to the quality ('alpha,' 'beta,' or 'GA') of 
> Velocity Engine 2.0 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.0/release-notes.html
>
> Distribution:
>
>  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>
> Maven 2 staging repository:
>
>  * 
> https://repository.apache.org/content/repositories/orgapachevelocity-1010/
>
> A vote regarding the quality of this test build will be initiated 
> within the next couple of days.
>
>
> Regards,
>
>   Claude
>
>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Greg Huber <gr...@gmail.com>.
Unfortunately it only takes a String :

javax.servlet.ServletContext.getResourceAsStream(java.lang.String path)

So hopefully the encoding will be correct (Tomcat).

....Also I have noticed that if I call a method that has a null

eg $entry.filePath == null

$myPojo.thumbResource($entry.name, $entry.filePath)

I get an exception :

java.lang.IllegalArgumentException: wrong number of arguments at..

where before it used to work :

public String thumbResource(String name, String filePath) {
        if (StringUtils.isNotEmpty(name)
                && StringUtils.isNotEmpty(filePath)) {
            return getThumbResource(name, filePath);
        } else {
            return thumbResource();
        }
    }

Is there a workaround for this?

Thanks



On 8 November 2016 at 13:54, Sergiu Dumitriu <se...@gmail.com>
wrote:

> If you don't want surprises, you should also specify the encoding to
> use. I'm guessing that the files you're reading have a known encoding
> that's kept from the build into the distribution package, but you don't
> always have control over the system where it's installed.
>
> try {
>     return new BufferedReader(new
> InputStreamReader(servletContext.getResourceAsStream(path), "UTF-8"));
> } catch (UnsupportedEncodingException e) {
>     // This should never happen, UTF-8 is mandatory for a valid JVM
>     return null;
> }
>
> On 11/08/2016 07:13 AM, Greg Huber wrote:
> > Seems to be working OK.  Thanks.
> >
> > For the ResourceLoader changes I have been doing this :
> >
> > public  InputStream getResourceStream(String name)....
> >
> > return result = servletContext.getResourceAsStream(path);
> >
> > but now must use :
> >
> > public Reader getResourceReader(String name, String encoding)....
> >
> > return result = new BufferedReader(new InputStreamReader(
> >                             servletContext.getResourceAsStream(path)));
> >
> > Is this the most efficient way to the Reader class?  Seems a lot more
> > processing than just the InputStream??
> >
> >
> >
> >
> >
> > On 7 November 2016 at 10:06, Claude Brisson <cl...@renegat.net> wrote:
> >
> >> The test build of Velocity Engine 2.0 is available.
> >>
> >> No determination as to the quality ('alpha,' 'beta,' or 'GA') of
> Velocity
> >> Engine 2.0 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-eng
> >> ine/2.0/release-notes.html
> >>
> >> Distribution:
> >>
> >>  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
> >>
> >> Maven 2 staging repository:
> >>
> >>  * https://repository.apache.org/content/repositories/orgapache
> >> velocity-1010/
> >>
> >> A vote regarding the quality of this test build will be initiated within
> >> the next couple of days.
> >>
> >>
> >> Regards,
> >>
> >>   Claude
> >>
> >>
> >>
> >
>
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Sergiu Dumitriu <se...@gmail.com>.
If you don't want surprises, you should also specify the encoding to
use. I'm guessing that the files you're reading have a known encoding
that's kept from the build into the distribution package, but you don't
always have control over the system where it's installed.

try {
    return new BufferedReader(new
InputStreamReader(servletContext.getResourceAsStream(path), "UTF-8"));
} catch (UnsupportedEncodingException e) {
    // This should never happen, UTF-8 is mandatory for a valid JVM
    return null;
}

On 11/08/2016 07:13 AM, Greg Huber wrote:
> Seems to be working OK.  Thanks.
> 
> For the ResourceLoader changes I have been doing this :
> 
> public  InputStream getResourceStream(String name)....
> 
> return result = servletContext.getResourceAsStream(path);
> 
> but now must use :
> 
> public Reader getResourceReader(String name, String encoding)....
> 
> return result = new BufferedReader(new InputStreamReader(
>                             servletContext.getResourceAsStream(path)));
> 
> Is this the most efficient way to the Reader class?  Seems a lot more
> processing than just the InputStream??
> 
> 
> 
> 
> 
> On 7 November 2016 at 10:06, Claude Brisson <cl...@renegat.net> wrote:
> 
>> The test build of Velocity Engine 2.0 is available.
>>
>> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
>> Engine 2.0 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-eng
>> ine/2.0/release-notes.html
>>
>> Distribution:
>>
>>  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>>
>> Maven 2 staging repository:
>>
>>  * https://repository.apache.org/content/repositories/orgapache
>> velocity-1010/
>>
>> A vote regarding the quality of this test build will be initiated within
>> the next couple of days.
>>
>>
>> Regards,
>>
>>   Claude
>>
>>
>>
> 


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu

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


Re: [ANNOUNCE] Velocity Engine 2.0 test build available

Posted by Greg Huber <gr...@gmail.com>.
Seems to be working OK.  Thanks.

For the ResourceLoader changes I have been doing this :

public  InputStream getResourceStream(String name)....

return result = servletContext.getResourceAsStream(path);

but now must use :

public Reader getResourceReader(String name, String encoding)....

return result = new BufferedReader(new InputStreamReader(
                            servletContext.getResourceAsStream(path)));

Is this the most efficient way to the Reader class?  Seems a lot more
processing than just the InputStream??





On 7 November 2016 at 10:06, Claude Brisson <cl...@renegat.net> wrote:

> The test build of Velocity Engine 2.0 is available.
>
> No determination as to the quality ('alpha,' 'beta,' or 'GA') of Velocity
> Engine 2.0 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-eng
> ine/2.0/release-notes.html
>
> Distribution:
>
>  * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/
>
> Maven 2 staging repository:
>
>  * https://repository.apache.org/content/repositories/orgapache
> velocity-1010/
>
> A vote regarding the quality of this test build will be initiated within
> the next couple of days.
>
>
> Regards,
>
>   Claude
>
>
>