David Mollitor created AVRO-2337:
------------------------------------
Summary: Possibility of NPE in SchemaCompatibility
Key: AVRO-2337
URL: https://issues.apache.org/jira/browse/AVRO-2337
Project: Apache Avro
Issue Type: Improvement
Components: java
Affects Versions: 1.8.2, 1.9.0
Reporter: David Mollitor
{code:java}
final Field writerField = lookupWriterField(writer, readerField);
// ---- following block is only entered if writerField is 'null'
if (writerField == null) {
if (readerField.defaultValue() == null) {
if (readerField.schema().getType() == Type.ENUM &&
readerField.schema().getEnumDefault() != null) {
// ---- writerField is accessed
result = result.mergedWith(getCompatibility("type", readerField.schema(),
writerField.schema(), location));
} else {
...
{code}
[https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/SchemaCompatibility.java#L417]
[https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/SchemaCompatibility.java#L424]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)