This already fixed. I'm reporting it to keep track of the issue and also to warn that we should keep in mind the changes this fix required, in case of other bugs or strange behaviours.
AbstractMetaData.equals( o ) is fine when the o.getClass() is MetaData. I've discovered that this wrong in a case where I had a ConceptClass with ID Chromosome and an AttributeName with the same ID = 'Chromosome'. If you compare them with the current implementation, they result equal, cause it's the same ID, however they are obviously two different entity types.
Exact match of this.getClass() and o.getClass() doesn't seem to be enough either, since, for instance, ConceptClassImplA and ConceptClassImplB should be considered the same if they don't differ conceptually. The solution is checking against the right interface in the right hierarchy level (e.g., o.getClass () instanceof AttributeName).
This already fixed. I'm reporting it to keep track of the issue and also to warn that we should keep in mind the changes this fix required, in case of other bugs or strange behaviours.
AbstractMetaData.equals( o )
is fine when theo.getClass()
isMetaData
. I've discovered that this wrong in a case where I had aConceptClass
with ID Chromosome and anAttributeName
with the same ID = 'Chromosome'. If you compare them with the current implementation, they result equal, cause it's the same ID, however they are obviously two different entity types.Exact match of
this.getClass()
ando.getClass()
doesn't seem to be enough either, since, for instance,ConceptClassImplA
andConceptClassImplB
should be considered the same if they don't differ conceptually. The solution is checking against the right interface in the right hierarchy level (e.g.,o.getClass () instanceof AttributeName
).