I took a look at the bytecode, and the only maps involved are the maps that are created to initialize the Car
objects.
Once the two car objects are initialized, they are put into a list. The spread operator translates (in this case) to a call to ScriptBytecodeAdapter.getPropertySpreadSafe
.
Looking at the source of that method, you'll see that it basically just creates a new ArrayList
and adds the requested property (in this case make
) of each object:
public static Object More ...getPropertySpreadSafe(Class senderClass, Object receiver, String messageName) throws Throwable {
if (receiver == null) return null;
List answer = new ArrayList();
for (Iterator it = InvokerHelper.asIterator(receiver); it.hasNext();) {
answer.add(getPropertySafe(senderClass, it.next(), messageName));
}
return answer;
}