This PR(https://github.com/apache/velocity-engine/pull/45) is the route cause for this issue.
Because of this change, in *UberspectImpl.getPropertyGet()* method the *executor* value is *PropertyExecutor* instead of *MapGetExecutor* *to replicate this issue sample program:* import com.fasterxml.jackson.core.JsonProcessingException; > import com.fasterxml.jackson.databind.ObjectMapper; > import org.apache.velocity.VelocityContext; > import org.apache.velocity.app.VelocityEngine; > import org.apache.velocity.runtime.VelocityEngineVersion; > > import java.io.StringWriter; > import java.util.Map; > > public class TestVelocity { > public static final String studentData = "{ \"student\": { \"values\": > [ " + > "{ \"id\": 1, \"name\": \"Alice\", \"age\": 20, \"grade\": > \"A\" }, " + > "{ \"id\": 2, \"name\": \"Bob\", \"age\": 21, \"grade\": \"B\" > } ] } }"; > public static final String editorContent = "{\n" + > " \"students\" : $student.values\n" + > "}\n"; > public static final String LOG_LABEL = "TemplateParser"; > public static void main(String[] args) throws JsonProcessingException { > VelocityEngine velocityEngine = new VelocityEngine(); > StringWriter writer = new StringWriter(); > Map studentsMap = new ObjectMapper().readValue(studentData, > Map.class); > VelocityContext context = new VelocityContext(studentsMap); > velocityEngine.init(); > velocityEngine.evaluate(context,writer,LOG_LABEL,editorContent); > System.out.println("Velocity Version: " + > VelocityEngineVersion.VERSION); > System.out.println(writer.toString()); > } > } *output in v2.3: * Velocity Version: 2.3 { "students" : [{id=1, name=Alice, age=20, grade=A}, {id=2, name=Bob, age=21, grade=B}] } *output in v 2.4.1:* Velocity Version: 2.4.1 { "students" : [[{id=1, name=Alice, age=20, grade=A}, {id=2, name=Bob, age=21, grade=B}]] } *Screenshots:* *Java program in version 2.3:* https://github.com/mergurishaan/VelocityIssue/blob/main/jpv23.png?raw=true *vg.executor value in 2.3:* https://github.com/mergurishaan/VelocityIssue/blob/main/vg_23.png?raw=true *java program In version 2.4.1:* https://github.com/mergurishaan/VelocityIssue/blob/main/jpv241.png?raw=true *vg.executor value in 2.4.1: * https://github.com/mergurishaan/VelocityIssue/blob/main/vg_241.png?raw=true On Tue, Jul 22, 2025 at 7:08 PM Mergu Ravi <mergu.r...@gaiansolutions.com> wrote: > Dear Velocity Team, > > I hope this message finds you well. > > I'm currently using Apache Velocity in my Java application, and I noticed > a behavioral difference in template rendering when upgrading from version > *2.3* to *2.4.1*. > Template: > > { > "students" : $student.values > } > > Sample JSON (studentData): > > { > "student": { > "values": [ > { "id": 1, "name": "Alice", "age": 20, "grade": "A" }, > { "id": 2, "name": "Bob", "age": 21, "grade": "B" } > ] > } > } > > Output in Velocity 2.3: > > { > "students" : [{id=1, name=Alice, age=20, grade=A}, {id=2, name=Bob, age=21, > grade=B}] > } > > Output in Velocity 2.4.1: > > { > "students" : [[{id=1, name=Alice, age=20, grade=A}, {id=2, name=Bob, > age=21, grade=B}]] > } > > Concern: > > In *2.4.1*, the result includes an extra set of brackets, indicating that > Velocity is now treating the .values object as a list containing a list > instead of a list itself. > > This change in behavior breaks backward compatibility in my use case. I'm > unsure if this change was intentional or a regression. > Screenshots: > > I’ve attached screenshots of the same Java code executed with both > versions: > > - > > *velocity-2.3* > - [image: Screenshot from 2025-07-22 18-38-28.png] > > - > > *velocity-2.4.1* > - [image: Screenshot from 2025-07-22 18-39-00.png] > > > Request: > > Could you please clarify if this is: > > - > > An intended change in how Velocity handles map values, or > - > > A bug introduced in the recent release? > > Additionally, if there's a recommended workaround or best practice for > handling this in 2.4.1, I’d greatly appreciate the guidance. > > Thanks for maintaining such a helpful project! > > Best regards, > *Ravi Mergu* > ------------------------------ >