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

ProtobufData does not correctly handle nested enums

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.4
    • 1.7.5
    • java
    • None

    Description

      When an enum is nested in several messages, a ClassNotFoundException is thrown when calling the DataFileWriter append method. I've attached a stack trace.

      The offending line (ProtobufData.java 112):
      Class c = Class.forName(SpecificData.getClassName(s));

      Say we have an enum nested as follows (I've left out some syntax):

      message A
        message B
          message C
            enum D
      

      Expected class name: org.foo.bar.A$B$C$D

      Actual class name being returned: org.foo.bar.A$D

      Only the package name, outer class, and enum class name are being taken into consideration. All parent classes besides the outer class are ignored. Nested messages are not afflicted by the same problem because they are resolved recursively.

      Please let me know if you require any more information or if anything is unclear.

      Thanks.

      Attachments

        1. cnfe_protobuf_stack_trace.txt
          2 kB
          Steve Zesch
        2. AVRO-1309.patch
          23 kB
          Doug Cutting

        Activity

          People

            cutting Doug Cutting
            szesch Steve Zesch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: