提交 23133f3b 编写于 作者: F fjy

Merge pull request #305 from metamx/npe-deprecated-fix

Remove deprecated jackson calls and fix NPE
......@@ -49,7 +49,7 @@ public class JacksonModule implements Module
public ObjectMapper smileMapper()
{
ObjectMapper retVal = new DefaultObjectMapper(new SmileFactory());
retVal.getJsonFactory().setCodec(retVal);
retVal.getFactory().setCodec(retVal);
return retVal;
}
}
......@@ -89,7 +89,7 @@ public class DirectDruidClient<T> implements QueryRunner<T>
this.httpClient = httpClient;
this.host = host;
this.isSmile = this.objectMapper.getJsonFactory() instanceof SmileFactory;
this.isSmile = this.objectMapper.getFactory() instanceof SmileFactory;
this.openConnections = new AtomicInteger();
}
......@@ -269,7 +269,7 @@ public class DirectDruidClient<T> implements QueryRunner<T>
{
if (jp == null) {
try {
jp = objectMapper.getJsonFactory().createJsonParser(future.get());
jp = objectMapper.getFactory().createParser(future.get());
if (jp.nextToken() != JsonToken.START_ARRAY) {
throw new IAE("Next token wasn't a START_ARRAY, was[%s]", jp.getCurrentToken());
} else {
......@@ -292,7 +292,9 @@ public class DirectDruidClient<T> implements QueryRunner<T>
@Override
public void close() throws IOException
{
jp.close();
if(jp != null) {
jp.close();
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册