AEM 6.1 - ValueMapDecorator doesn't wrap input map
Hi,
We are using AEM 6 at the moment, and take advantage of ValueMap's in Sightly. We use the following code:
import org.apache.sling.api.resource.ValueMap;import org.apache.sling.api.wrappers.ValueMapDecorator;
ValueMap map = new ValueMapDecorator(new HashMap<String, Object>() {{ put("key", "value"); }});
map.size() is expected to be equal to 1, but with AEM 6.1, the values aren't wrapped anymore and the size of ValueMapDecorator is equal to 0.
In the attach there is map var expansion.
Thanks
P.S. using
com.adobe.cq.commerce.common.ValueMapDecorator;didn't solve the problem, but in AEM 6 both approaches worked fine
P.S.1 this classes are referenced from this dependency:
<dependency> <groupId>com.adobe.aem</groupId><artifactId>uber-jar</artifactId><version>6.1.0</version><scope>provided</scope></dependency>