Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2337

Possibility of NPE in SchemaCompatibility

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.9.0, 1.8.2
    • None
    • java
    • None

    Description

      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 {
      ...
      

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: