avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Douglas Kaminsky (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AVRO-796) Problems using Schema.equals() method
Date Tue, 05 Apr 2011 21:00:05 GMT
Problems using Schema.equals() method
-------------------------------------

                 Key: AVRO-796
                 URL: https://issues.apache.org/jira/browse/AVRO-796
             Project: Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.5.0
            Reporter: Douglas Kaminsky


I was writing some code that dynamically creates schemas based on existing schemas and noticed
when I was compiling the schemas I needed to reconstruct that the size of my java.util.Set
did not reflect the number of times I called the .add method on that set. Naturally, I was
led to investigate the schema.equals method, and noticed some alarming issues.

It seems that the current logic reports that two schemas are equal IFF they are both the same
in memory OR they are both schemas of the same type with the same props. There are several
issues that seem to be present here:

1) schema.equals(null) throws an exception instead of returning false as one would expect
2) Two schemas of the same type with a different name or documentation are considered equal
(this may or may not be a "feature")


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message