File tree 1 file changed +4
-9
lines changed
bundle/src/main/java/com/adobe/acs/samples/resources
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 24
24
import org .apache .sling .api .resource .Resource ;
25
25
import org .apache .sling .api .resource .ResourceWrapper ;
26
26
import org .apache .sling .api .resource .ValueMap ;
27
- import org .apache .sling .api .wrappers .ValueMapDecorator ;
28
-
29
- import java .util .HashMap ;
30
- import java .util .Map ;
27
+ import org .apache .sling .api .wrappers .CompositeValueMap ;
31
28
32
29
33
30
public class SampleResourceWrapper extends ResourceWrapper {
@@ -39,11 +36,9 @@ public class SampleResourceWrapper extends ResourceWrapper {
39
36
public SampleResourceWrapper (final Resource resource , final ValueMap overlayProperties ) {
40
37
super (resource );
41
38
42
- final Map <String , Object > mergedProperties = new HashMap <String , Object >();
43
- mergedProperties .putAll (super .getValueMap ());
44
- mergedProperties .putAll (overlayProperties );
45
-
46
- this .properties = new ValueMapDecorator (mergedProperties );
39
+ // The use of CompositeValueMap is used to address SLING-6420 which does not handle data type such as Date's well.
40
+ // Set the overlayedProperties as the "property set" and the resoure's "real" valueMap as the defaults.
41
+ this .properties = new CompositeValueMap (overlayProperties , super .getValueMap ());
47
42
}
48
43
49
44
You can’t perform that action at this time.
0 commit comments