GitHub user ae6rt opened a pull request:
https://github.com/apache/curator/pull/64
Port Codehaus Jackson to fasterxml Jackson.
We believed there might be value in providing a port of Curator from legacy
Codehaus Jackson to FasterXML Jackson. This PR is that port.
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 fasterxml
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/curator/pull/64.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 #64
----
commit 4bd2c0bfb516f23c8ca168642cf43f6a1822fbd9
Author: Mark Petrovic <[email protected]>
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
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---