[jira] [Closed] (VELOCITY-677) a '#' or '$' character at the end of VTL causes a ParseException

2019-01-02 Thread Michael Osipov (JIRA)


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

Michael Osipov closed VELOCITY-677.
---

> a '#' or '$' character at the end of VTL causes a ParseException
> 
>
> Key: VELOCITY-677
> URL: https://issues.apache.org/jira/browse/VELOCITY-677
> Project: Velocity
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 1.6, 1.6.1, 1.7
>Reporter: Byron Foster
>Assignee: Claude Brisson
>Priority: Minor
> Fix For: 2.1
>
>
> If either the character '#' or '$' is the last character in VTL, then the 
> following results:
> Threw: class org.apache.velocity.exception.ParseErrorException
> Msg: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical 
> error at line 4, column 2. Encountered:  after : ""
> org.apache.velocity.Template.process(Template.java:142) 
> org.apache.velocity.runtime.resource.ResourceManagerImpl.refreshResource(ResourceManagerImpl.java:556)
>  
> org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:319)
>  
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1442)
>  
> org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:319)
>  
> org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:332) 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (VELOCITY-677) a '#' or '$' character at the end of VTL causes a ParseException

2019-01-02 Thread Michael Osipov (JIRA)


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

Michael Osipov updated VELOCITY-677:

Fix Version/s: (was: 2.1)

> a '#' or '$' character at the end of VTL causes a ParseException
> 
>
> Key: VELOCITY-677
> URL: https://issues.apache.org/jira/browse/VELOCITY-677
> Project: Velocity
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 1.6, 1.6.1, 1.7
>Reporter: Byron Foster
>Assignee: Claude Brisson
>Priority: Minor
>
> If either the character '#' or '$' is the last character in VTL, then the 
> following results:
> Threw: class org.apache.velocity.exception.ParseErrorException
> Msg: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical 
> error at line 4, column 2. Encountered:  after : ""
> org.apache.velocity.Template.process(Template.java:142) 
> org.apache.velocity.runtime.resource.ResourceManagerImpl.refreshResource(ResourceManagerImpl.java:556)
>  
> org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:319)
>  
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1442)
>  
> org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:319)
>  
> org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:332) 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (VELOCITY-893) Calling macro with closing brace on newline throws ParseErrorException

2019-01-02 Thread Michael Osipov (JIRA)


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

Michael Osipov updated VELOCITY-893:

Fix Version/s: (was: 2.1)

> Calling macro with closing brace on newline throws ParseErrorException
> --
>
> Key: VELOCITY-893
> URL: https://issues.apache.org/jira/browse/VELOCITY-893
> Project: Velocity
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 2.0
> Environment: V2.0, line whitespace gobbling
>Reporter: Steve O'Hara
>Assignee: Claude Brisson
>Priority: Minor
>
> This is a regression from 1.7.
> {code:java}
> #macroLayoutPlanner(
> "planWidget"
> "false"
> [
>  "plannerConfigs_controlBarConfigs,$PaletteOvrd,
>  layoutPlanWidgetAdditions"
> ],
> $Props,
> ${PlanEntity.SVGContent}
> )
> {code}
> This fails because the closing bracket is on a new line.
> {code}
> 2018-05-30 19:00:54 ERROR filter.RequestFilter - 
> org.springframework.core.NestedIOException: Could not load Velocity template 
> for URL [widgets/layoutplanner.vm]; nested exception is 
> org.apache.velocity.exception.ParseErrorException: Encountered ")" at 
> widgets/layoutplanner.vm[line 144, column 17]
> Was expecting one of:
> "," ...
> "##" ...
>  ...
>  ...
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (VELOCITY-805) Unable to convert instances of two separate enums on a Velocity Template

2019-01-02 Thread Michael Osipov (JIRA)


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

Michael Osipov updated VELOCITY-805:

Fix Version/s: (was: 2.1)

> Unable to convert instances of two separate enums on a Velocity Template
> 
>
> Key: VELOCITY-805
> URL: https://issues.apache.org/jira/browse/VELOCITY-805
> Project: Velocity
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 1.7
> Environment: Tomcat 6, Spring 3.0.4
>Reporter: Scott
>Assignee: Claude Brisson
>Priority: Minor
> Attachments: Test.zip
>
>
> I am unable to utilize the valueOf method on two separate instances of an 
> enum - which share the same name.  The issue is that when the second valueOf 
> method is called, it is invoked on the first enum which is accessed in the 
> template.
> This can be tested by creating two enums with the same name in two separate 
> classes.  Place these onto the context, and then try to utilize the valueOf 
> method and you'll receive a stack trace stating that no value exists.  For 
> example create two separate classes with an inner enum which both have the 
> same name.  Add each enum onto the context, and then in a template attempt to 
> access them in the following way: $enum1.valueOf("VAL1") 
> $enum2.valueOf("SOME_OTHER_VAL").  This will not work.  Luckily you are able 
> to do the following as a workaround: $enum1.valueOf($enum1, "VAL1") 
> $enum2.valueOf($enum2, "SOME_OTHER_VAL")
> Stack trace below:
> java.lang.IllegalArgumentException: No enum const class 
> org.velocity.testing.domain.User$Actions.MODIFY_NAME
>   java.lang.Enum.valueOf(Enum.java:196)
>   org.velocity.testing.domain.User$Actions.valueOf(User.java:1)
>   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>   
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>   java.lang.reflect.Method.invoke(Method.java:597)
>   
> org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
>   
> org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
>   
> org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
>   
> org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
>   
> org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
>   
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
>   org.apache.velocity.Template.merge(Template.java:356)
>   org.apache.velocity.Template.merge(Template.java:260)
>   
> org.springframework.web.servlet.view.velocity.VelocityLayoutView.renderScreenContent(VelocityLayoutView.java:180)
>   
> org.springframework.web.servlet.view.velocity.VelocityLayoutView.doRender(VelocityLayoutView.java:150)
>   
> org.springframework.web.servlet.view.velocity.VelocityView.renderMergedTemplateModel(VelocityView.java:291)
>   
> org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167)
>   
> org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
>   
> org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
>   
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
>   
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
>   
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
>   
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Comment Edited] (VELOCITY-896) Regression in the handling of String literal ending with a sharp sign

2019-01-02 Thread Thomas Mortagne (JIRA)


[ 
https://issues.apache.org/jira/browse/VELOCITY-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16732170#comment-16732170
 ] 

Thomas Mortagne edited comment on VELOCITY-896 at 1/2/19 3:52 PM:
--

[~claude] any idea when 2.1 release is planned ? Anything I can do to help ?


was (Author: tmortagne):
[~claude] any idea when 2.1 release is planned ?

> Regression in the handling of String literal ending with a sharp sign
> -
>
> Key: VELOCITY-896
> URL: https://issues.apache.org/jira/browse/VELOCITY-896
> Project: Velocity
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Thomas Mortagne
>Assignee: Claude Brisson
>Priority: Blocker
> Fix For: 2.1
>
>
> The following produce a ParseErrorException after upgrading to Velocity 2:
> {code}
> #set($var = "#")
> {code}
> or 
> {code}
> #set($var = "toto#")
> {code}
> {noformat}
> org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id 
> [mytemplate]
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:279)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:244)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngineTest.assertEvaluate(DefaultVelocityEngineTest.java:92)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngineTest.assertEvaluate(DefaultVelocityEngineTest.java:85)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngineTest.testMisc(DefaultVelocityEngineTest.java:287)
>   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.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
>   at 
> org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
>   at 
> org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
>   at 
> org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
>   at 
> org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
>   at 
> org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:113)
>   at 
> org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:58)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:112)
>   at 
> org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:120)
>   at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
>   at 
> java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
>   at java.util.Iterator.forEachRemaining(Iterator.java:116)
>   at 
> java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
>   at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
>   at 
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
>   at 
> java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
>   at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
>   at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
>   at 
> java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:120)
>   at 
> org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
>   at 
> 

[jira] [Commented] (VELOCITY-896) Regression in the handling of String literal ending with a sharp sign

2019-01-02 Thread Thomas Mortagne (JIRA)


[ 
https://issues.apache.org/jira/browse/VELOCITY-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16732170#comment-16732170
 ] 

Thomas Mortagne commented on VELOCITY-896:
--

[~claude] any idea when 2.1 release is planned ?

> Regression in the handling of String literal ending with a sharp sign
> -
>
> Key: VELOCITY-896
> URL: https://issues.apache.org/jira/browse/VELOCITY-896
> Project: Velocity
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Thomas Mortagne
>Assignee: Claude Brisson
>Priority: Blocker
> Fix For: 2.1
>
>
> The following produce a ParseErrorException after upgrading to Velocity 2:
> {code}
> #set($var = "#")
> {code}
> or 
> {code}
> #set($var = "toto#")
> {code}
> {noformat}
> org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id 
> [mytemplate]
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:279)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:244)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngineTest.assertEvaluate(DefaultVelocityEngineTest.java:92)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngineTest.assertEvaluate(DefaultVelocityEngineTest.java:85)
>   at 
> org.xwiki.velocity.internal.DefaultVelocityEngineTest.testMisc(DefaultVelocityEngineTest.java:287)
>   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.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
>   at 
> org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
>   at 
> org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
>   at 
> org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
>   at 
> org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
>   at 
> org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:113)
>   at 
> org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:58)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:112)
>   at 
> org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:120)
>   at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
>   at 
> java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
>   at java.util.Iterator.forEachRemaining(Iterator.java:116)
>   at 
> java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
>   at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
>   at 
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
>   at 
> java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
>   at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
>   at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
>   at 
> java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:120)
>   at 
> org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
>   at 
> org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
>   at 
>