lhotari commented on code in PR #19215:
URL: https://github.com/apache/pulsar/pull/19215#discussion_r1068606954
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/reader/JacksonJsonReader.java:
##########
@@ -33,17 +34,17 @@
*/
public class JacksonJsonReader<T> implements SchemaReader<T> {
private final Class<T> pojo;
- private final ObjectMapper objectMapper;
+ private final ObjectReader objectReader;
public JacksonJsonReader(ObjectMapper objectMapper, Class<T> pojo) {
this.pojo = pojo;
- this.objectMapper = objectMapper;
+ this.objectReader = pojo != null ? objectMapper.readerFor(pojo) :
objectMapper.reader();
Review Comment:
null handling is done this way because of backwards compatibility. The
previous solution accepted null as pojo and a test breaks if this logic doesn't
exist for the ObjectReader.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]