Regression Bug in Velocity Library: JSON if Condition with {} Failing in v2.3 and Later

Muskaan B <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.devel
Message-ID <CA+ciEywEtCq0xY7ZnH9cUioQN7gCC5ectWLWYQ6uE85Ej01B8g@mail.gmail.com>
Dear Apache velocity Team,

I hope this email finds you well.

I have identified a regression bug in the Velocity library that affects the
handling of if conditions within JSON documents when curly braces ({}) are
present. This issue is identified in version 2.3 and present in later
versions as well, but was working as expected in  version 1.7.

To help reproduce the issue, I have provided a sample project along with
the stack trace in the following

*Git repository:* link
<https://github.com/muskaan62/velocityTest/blob/main/src/main/java/org/example/VelocityExample.java>

*Stacktrace:*

*=============*
























*Exception in thread "main"
org.apache.velocity.exception.ParseErrorException: Encountered ")\n" at
Template[line 2, column 64]Was expecting one of:    "||" ...    ")" ...
<WHITESPACE> ...    <NEWLINE> ...    "-" ...    "+" ...    "*" ...    "/"
...    "%" ...    <LOGICAL_AND> ...    <LOGICAL_OR> ...    <LOGICAL_LT>
...    <LOGICAL_LE> ...    <LOGICAL_GT> ...    <LOGICAL_GE> ...
<LOGICAL_EQUALS> ...    <LOGICAL_NOT_EQUALS> ...   at
org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1440)at
org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1398)at
org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:213)at
org.example.VelocityExample.main(VelocityExample.java:28)*

*========================================*

I kindly request your assistance in addressing this issue. If there are any
potential workarounds or a timeline for a fix, please let me know. Your
guidance on resolving this would be greatly appreciated.

Thank you for your time and support.

Best regards,
Muskaan
ReplyReply allForward
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.