You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (Jira)" <ji...@apache.org> on 2019/12/20 13:43:00 UTC

[jira] [Created] (SLING-8943) The Sling API ObjectConverter does not correctly convert JCR values

Radu Cotescu created SLING-8943:
-----------------------------------

             Summary: The Sling API ObjectConverter does not correctly convert JCR values
                 Key: SLING-8943
                 URL: https://issues.apache.org/jira/browse/SLING-8943
             Project: Sling
          Issue Type: Bug
          Components: API
    Affects Versions: API 2.21.0
            Reporter: Radu Cotescu
             Fix For: API 2.21.2


SLING-8116 delegates value conversions to the {{org.osgi.util.converter.Converter}}. However, JCR values will be wrongly processed by the {{Converter}}, since it will first convert them to maps and then return the map's key if the key's type is the same as the conversion type. For JCR values, the Map's keys will be the value's public method names, whereas the values will be the invocation of said methods. This is definitely not the behaviour we want.

The simplest solution would be to optionally import the {{javax.jcr}} API and, if present, add some custom rules based on {{javax.jcr.Value}} into the {{Converter}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)