Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
5.4.5, 5.4.7
-
-
Empty show more show less
-
Saigon 48
-
3
Description
Even though JCR's Node API doesn't explicitly allow setting an Integer as a node property (Long is accepted), I think our API could be more lenient and accept an integer value instead of failing as happens to the following code
info.magnolia.jcr.util.PropertyUtil.setProperty(node, "someProperty", 123)
will fail with
java.lang.IllegalArgumentException: Cannot set property to a value of type class java.lang.Integer at info.magnolia.jcr.util.PropertyUtil.setProperty(PropertyUtil.java:132)
A simple
else if (propertyValue instanceof Integer) { node.setProperty(propertyName, ((Integer) propertyValue).intValue()); }
should do.
Checklists
Acceptance criteria