[
https://issues.apache.org/jira/browse/AVRO-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776578#action_12776578
]
Philip Zeyliger commented on AVRO-182:
--------------------------------------
I like the new patch. One assertion suggestion and one set of test suggestions
below.
bq. public Name(String name, String space)
In the constructor for Name, would it be reasonable to assert "space==null" in
the case where name contains a ".". (There's a branch based on whether name is
qualified or not.) Alternately, just have two constructors?
bq. assert(o2.equals(o2));
I think it'd be prudent to add a test that checks avroRecord.equals({null, new
Object()}) is false. It would also be great to exercise the schema checking,
by having two records that have the same data, but schemas that differ in (say)
namespace. You might wish to check that Name works as expected, though there's
very little code there.
> hashCode and equals are not consistent with compareTo
> -----------------------------------------------------
>
> Key: AVRO-182
> URL: https://issues.apache.org/jira/browse/AVRO-182
> Project: Avro
> Issue Type: Bug
> Components: java
> Reporter: Doug Cutting
> Assignee: Doug Cutting
> Fix For: 1.3.0
>
> Attachments: AVRO-182.patch, AVRO-182.patch, AVRO-182.patch
>
>
> Java's specific and generic APIs implement compareTo according to the schema,
> where some fields might be ignored. To be consistent, fields that are
> ignored when comparing for ordering should also be ignored when comparing for
> equality and for computing hashCodes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.