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

GenericData compare fails for Maps size = 0 or sizes not same

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.11.2
    • None
    • java

    Description

      Comparison of GenericData in the java avro library is incorrectly implemented.

       

      Two bugs exists:

      1) Shortcut returning of 'different' is wrong, since it compares m1.size() != m1.size() instead of m1.size() != m2.size()

       

      2) When one of both maps are empty, the iterator throws an exception. There is no 'isEmpty' check.

       

      See PR: https://github.com/apache/avro/pull/2325

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              markpaxton Mark Paxton
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m