You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/01/23 18:46:35 UTC

[jira] [Commented] (CURATOR-186) Port Curator to Jackson FasterXML library from Jackson Codehaus library

    [ https://issues.apache.org/jira/browse/CURATOR-186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14289584#comment-14289584 ] 

ASF GitHub Bot commented on CURATOR-186:
----------------------------------------

GitHub user ae6rt opened a pull request:

    https://github.com/apache/curator/pull/65

    Port Codehaus Jackson to fasterxml Jackson.

    CURATOR-186
    
    One line of executable code changed, here, in
    
    org.apache.curator.x.discovery.server.contexts.GenericDiscoveryContext#unMarshallJson
    
    	@Override
        public T unMarshallJson(JsonNode node) throws Exception
        {
            T payload;
            ObjectMapper mapper = new ObjectMapper();
            //noinspection unchecked
            payload = (T)mapper.readValue(mapper.treeAsTokens(node),  // <<<<<<<<<<<<<<<<
            payloadType.getRawType());
            return payload;
        }
    
    Jackson v2 has no method on ObjectMapper supporting readValue(JsonNode, Class).  However, Jackson v1 states the form I used
    is a shortcut for that legacy method.
    
    All other changes to the code and poms were simply replacing imports
    and maven dependencies.
    
    Jackson 2.3.2 was chosen to be compatible with the version already
    being transitively provided through the dependency
    io.dropwizard:dropwizard-configuration:jar:0.7.0:compile

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xoom/curator CURATOR-186

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/65.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #65
    
----
commit 4bd2c0bfb516f23c8ca168642cf43f6a1822fbd9
Author: Mark Petrovic <ma...@xoom.com>
Date:   2015-01-22T00:28:00Z

    Port Codehaus Jackson to fasterxml Jackson.
    
    One line of executable code changed, here, in
    
    org.apache.curator.x.discovery.server.contexts.GenericDiscoveryContext#unMarshallJson
    
    	@Override
        public T unMarshallJson(JsonNode node) throws Exception
        {
            T payload;
            ObjectMapper mapper = new ObjectMapper();
            //noinspection unchecked
            payload = (T)mapper.readValue(mapper.treeAsTokens(node),  // <<<<<<<<<<<<<<<<
            payloadType.getRawType());
            return payload;
        }
    
    Jackson v2 has no method on ObjectMapper supporting readValue(JsonNode, Class).  However, Jackson v1 states the form I used
    is a shortcut for that legacy method.
    
    All other changes to the code and poms were simply replacing imports
    and maven dependencies.
    
    Jackson 2.3.2 was chosen to be compatible with the version already
    being transitively provided through the dependency
    io.dropwizard:dropwizard-configuration:jar:0.7.0:compile

----


> Port Curator to Jackson FasterXML library from Jackson Codehaus library
> -----------------------------------------------------------------------
>
>                 Key: CURATOR-186
>                 URL: https://issues.apache.org/jira/browse/CURATOR-186
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 2.7.1
>            Reporter: mark petrovic
>            Priority: Minor
>             Fix For: 2.7.2
>
>
> There may be value in porting Curator to the Jackson FasterXML library, from Codehaus Jackson.  This lowers the possibility of accidentally mixing Jackson version 1 and 2 in Java imports if transitive dependencies use Jackson 2/FasterXML.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)